Download MetaTrader 5
To add comments, please log in or register
Do you need a programmer? Freelance service will find the developer you need!
Mahmood
75
Mahmood 2016.01.26 10: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);

Keith Watford
Moderator
7969
Keith Watford 2016.01.26 10: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
Mahmood
75
Mahmood 2016.01.26 11:28  
Thanks man
whroeder1
13627
whroeder1 2016.01.26 18: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.
/
To add comments, please log in or register