if(NormalizeDouble(price_140-Move_step*pm*Point,Digits)>NewPrice
&& NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits)
|| price_116==0.0
|| Open_order_on_trend && CountBuys==0
|| NewPrice>=NormalizeDouble(price_108+Distance_between_orders*pm*Point,Digits)
|| NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits))
- Coding help
- Need help to round order last digit to 0 or 5
- How can I read the history file using kernell32 library in mql4 and mql5?
rod777:
if(NormalizeDouble(price_140-Move_step*pm*Point,Digits)>NewPrice
&& NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits)
|| price_116==0.0
|| Open_order_on_trend && CountBuys==0
|| NewPrice>=NormalizeDouble(price_108+Distance_between_orders*pm*Point,Digits)
|| NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits))
You're missing a set of parenthesis. I can't tell you where because it's your logic so you need to determine the correct precedence.
rod777:
Don't mix ands and ors together. Add parentheses to make it specific. if(A && B || C || D && E || F || G)
bool A = NormalizeDouble(price_140-Move_step*pm*Point,Digits)>NewPrice; bool B = NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits); bool C = price_116==0.0; bool D = Open_order_on_trend; bool E = CountBuys==0; bool F = NewPrice>=NormalizeDouble(price_108+Distance_between_orders*pm*Point,Digits); bool G = NewPrice<=NormalizeDouble(price_116-Distance_between_orders*pm*Point,Digits); if(A && (B || C || D) && (E || F || G) ) // or if( (A && B) || C || (D && E) || F || G)
thanks
it works, was the first one
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