sir i got A ERROR modify error 4051 in this...
ankit29030:
sir i got A ERROR modify error 4051 in this...
sir i got A ERROR modify error 4051 in this...
If this fails . . .
ticket = OrderSend(Symbol(), pot, 0.01, Ask, 3, 0, 0);
. . . what happens with the following code ?
READ THIS and USE IT : What are Function return values ? How do I use them ?
int start(){ int ticket; if(OrdersTotal()==0) ticket=OrderSend(Symbol(),pot,0.01,Ask,3,0,0); OrderModify(ticket,OrderOpenPrice(),sl,tp,0,0); <<<<here problem lies
- The first time through you open an order. Maybe.You DON'T CHECK. What are Function return values ? How do I use them ? - MQL4 forum
- The next time through OrdersTotal will be nonzero, so ticket REMAINS equal to zero and modify fails.
- Not adjusting for 4/5 digit brokers (tp, sl, AND slippage)
RaptorUK:
If this fails . . .
. . . what happens with the following code ?
READ THIS and USE IT : What are Function return values ? How do I use them ?
invalid stoploss for order modify function..but my sl is 20pips down and take profit is 10 pips up..that is the thing..
WHRoeder:
- The first time through you open an order. Maybe.You DON'T CHECK. What are Function return values ? How do I use them ? - MQL4 forum
- The next time through OrdersTotal will be nonzero, so ticket REMAINS equal to zero and modify fails.
- Not adjusting for 4/5 digit brokers (tp, sl, AND slippage)
orderstotal is non zero as it places a buy order-i have checked that in journal...
should i place another variable instead of ticket??
and for most brokers minimum distance is 5 pips
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