I don't know what is the chance for "(TimeCurrent()-Time[Bar_Low])" or" (TimeCurrent()-Time[Bar_High])" to become 0
- Debugging on Terminal stops immediately
- Dose it posible to creat any function of "mql code" posting in this forum?
- Strategy tester stops for no reason at a certain date.
vx0532:
expert complain that"zero devide"
I don't know what is the chance for "(TimeCurrent()-Time[Bar_Low])" or" (TimeCurrent()-Time[Bar_High])" to become 0
When Time[Bar_Low] is the same as TimeCurrent(). This could happen when you're dealing with minute bars for example.
I don't know what is the chance for "(TimeCurrent()-Time[Bar_Low])" or" (TimeCurrent()-Time[Bar_High])" to become 0
ubzen:
When Time[Bar_Low] is the same as TimeCurrent(). This could happen when you're dealing with minute bars for example.
When Time[Bar_Low] is the same as TimeCurrent(). This could happen when you're dealing with minute bars for example.
there is no chance for them to be the same because of "Profit_Points > 55".
vx0532:
I don't know what is the chance for "(TimeCurrent()-Time[Bar_Low])" or" (TimeCurrent()-Time[Bar_High])" to become 0
How do you know it is that divide causing the issue ? how have you verified it ?
I don't know what is the chance for "(TimeCurrent()-Time[Bar_Low])" or" (TimeCurrent()-Time[Bar_High])" to become 0
RaptorUK:
How do you know it is that divide causing the issue ? how have you verified it ?
How do you know it is that divide causing the issue ? how have you verified it ?
only these two items were devided.
vx0532:
only these two items were devided.
only these two items were devided.
Profit_Points = NormalizeDouble( (High[Bar_High] - Low[Bar_Low])/Pips_SL,0 );
angevoyageur:
"Pips_SL" have a fixed value, which i should explain before, sorry for this.
vx0532:
Are you selecting an order using OrderSelect() before calling OrderOpenTime(), and if so, are you checking OrderSelect's return code to determine whether the OrderSelect was successful? If you are not using OrderSelect() before calling OrderOpenTime() or if OrderSelect() fails and you subsequently call OrderOpenTime(), OrderOpenTime() could return a value of 0. If Bar_Open is 0, this could have unintended effects on Bar_High and Bar_Low, which would also effect the calculations involving Profit_Points, Bar_High, and Bar_Low, including B and S.
I don't know what is the chance for "(TimeCurrent()-Time[Bar_Low])" or" (TimeCurrent()-Time[Bar_High])" to become 0
int Bar_Open = iBarShift(NULL,0,OrderOpenTime(),0) , Bar_High = iHighest(NULL,0,MODE_HIGH,Bar_Open,0) , Bar_Low = iLowest(NULL,0,MODE_LOW,Bar_Open,0) , Profit_Points = NormalizeDouble( (High[Bar_High] - Low[Bar_Low])/Pips_SL,0 ) ; if(Profit_Points > 55) { double B =Profit_Points*60/(TimeCurrent()-Time[Bar_Low]), S =Profit_Points*60/(TimeCurrent()-Time[Bar_High]); ............ }
vx0532:
"Pips_SL" have a fixed value, which i should explain before, sorry for this.
"Pips_SL" have a fixed value, which i should explain before, sorry for this.
OK, so the logical next step is to Print() . . .
(TimeCurrent()-Time[Bar_Low])" or" (TimeCurrent()-Time[Bar_High])
. . . and then you will know if it is zero or not . . . when you get a divide by zero error.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register