Forums › ProRealTime English forum › ProOrder support › 1 Min Trading Strategy › Reply To: 1 Min Trading Strategy
07/19/2017 at 7:47 PM
#41109
Think I know where the potential ‘divide by zero’ problem could lie:
1 2 3 4 |
dojibull2 = open[2]<close[2] and abs(open[2]-close[2])/(high[2]-low[2])<0.6 dojibull1 = open[1]<close[1] and abs(open[1]-close[1])/(high[1]-low[1])<0.6 dojibear2 = open[2]>close[2] and abs(open[2]-close[2])/(high[2]-low[2])<0.6 dojibear1 = open[1]>close[1] and abs(open[1]-close[1])/(high[1]-low[1])<0.6 |
Can fix by replacing the above block of code with this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
If high[2]-low[2] = 0 Then HiLo2 = 1 Else HiLo2 = high[2]-low[2] EndIf If high[1]-low[1] = 0 Then HiLo1 = 1 Else HiLo1 = high[1]-low[1] EndIf dojibull2 = open[2]<close[2] and abs(open[2]-close[2])/HiLo2<0.6 dojibull1 = open[1]<close[1] and abs(open[1]-close[1])/HiLo1<0.6 dojibear2 = open[2]>close[2] and abs(open[2]-close[2])/HiLo2<0.6 dojibear1 = open[1]>close[1] and abs(open[1]-close[1])/HiLo1<0.6 |