Problem with pending order

Back to topics list To post a new topic, please log in or register
avatar
26
Mahmood000 2016.01.26 11:01
 

I use this code to open a pending order at 100 pips under current price, but it opens a market order at the current price please guide me

double point = MarketInfo("EURUSD",MODE_POINT);

OrderSend("EURUSD",0,.01,MarketInfo("EURUSD",MODE_ASK)-100*point,3,0,0,"",0,0,Green);




avatar
Moderator
3418
GumRai 2016.01.26 11:17 #
 
OrderSend("EURUSD",OP_BUYLIMIT,.01,MarketInfo("EURUSD",MODE_ASK)-100*point,3,0,0,"",0,0,Green);
point needs to be calculated for the relevant pair
avatar
26
Mahmood000 2016.01.26 12:28 #
 
Thanks man
avatar
13001
WHRoeder 2016.01.26 19:01 #
 
GumRai: point needs to be calculated for the relevant pair
Point is a predefined variable. This is why I say:
Do not trade multiple currencies
  • You can't use any predefined variables, can't use the tester, must poll (not OnTick,) and usually other problems.
  • Code it to trade the chart pair only. Look at the others if you must.
  • Then put it on other charts to trade the other pairs. Done.

Back to topics list  

To add comments, please log in or register