Division zero error
Forums › ProRealTime English forum › ProOrder support › Division zero error
- This topic has 34 replies, 4 voices, and was last updated 1 year ago by GraHal.
-
-
04/03/2023 at 4:28 PM #21273604/03/2023 at 5:29 PM #21274504/03/2023 at 9:44 PM #212754
As it happend most recently 30th march I checked with bars only covering that trade. But Maybe I did not check the division for that only backtest. And I also checked different variations of bars to remove the options its not preloadbars.
But I guess i should do the same for all division and check if they act different (Become 0) if the barset is different.
I will check that tomorrow and get back here again. Thanks again!
04/04/2023 at 9:11 AM #21276304/04/2023 at 9:28 AM #21276504/04/2023 at 9:40 AM #21276704/04/2023 at 11:12 AM #21278104/04/2023 at 11:33 AM #212782StochRSI = (myRSI–MinRSI) / (MaxRSI–MinRSI)
Should I just not.. Graph stochRSI <= 0 ?
Because “(myRSI–MinRSI)” can also be 0?
Well none of that works. I will just graph StochRSI and all the other division but still 0. I am getting nuts on this haha
04/04/2023 at 11:48 AM #21278304/04/2023 at 12:01 PM #212784I have been running this system wihtout any problems for 3 years. I just tweaked some numbers and changed the trailingstop
So as I thought it be some kind of preload bars thing as I have ran the system for long time in demo I tried backtesting with only the recent trade fitting (meaning bascily 0 preload bars) the trade still shows up. This means preloadbars is not the issue.
I checked all the division none is 0. I checked if trialingstop somehow is below minimum no problem there also. I went through the code several times just to think of what it can be.
04/04/2023 at 12:27 PM #21278604/04/2023 at 12:34 PM #212787I looked arround the forum for the same problem.. And I found this part
“x = std[Period](close)
if x=0 then
x=1
endif”which means I can do it on every divison to secure 0 not to come again. In this scenario I can just
“if StochRSI = 0 then
x=1
endif”
Right?04/04/2023 at 12:39 PM #21278804/04/2023 at 12:45 PM #212790I saw @robertgozzi write this
“Check that all periods within brackets have a “normal” period number, such as 10, 20, 200 or 500 and not 10000 or 15000!
This may happen if some period numbers are not simple constants but are the result of an expression, or use BARINDEX or the like incorrectly.”
Means in my case 3 would cause a problem division 0 error?
04/04/2023 at 12:56 PM #212792and not 10000 or 15000!
Robert said above because the max number of preload bars is 10000 and so any period >= 10000 would likely bring problems.
3 would cause a problem division 0 error?
Not in itself no, 3 can be fine, 3 can cause problems, but not because it is a value = 3.
Re your div0 Rejection … try my max(1,??) suggestion I posted above … this is the one fix that works for me when I get div0 Rejections.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on