Download MetaTrader 5
To add comments, please log in or register
Examine the Top MetaTrader 5 signals. Choose the best one and subscribe to it!
Akshay
48
Akshay 2016.10.03 20:39 

Hi I want to write a EA that will place buy order at fix price interval like this


for (i = 0; i < 5; i++)
                {
                BuyPrice1 = BuyPrice + DPR*(i)/n;
                
                                if( Close[0] >= BuyPrice1)                                   // Buy Order 1
                
             ticket = OrderSend (Symbol(),OP_BUYLIMIT,Lots,BuyPrice1,0,0,0,NULL,0,clrNONE); 
                
 }


Where DPR, n is manual input, now lets say I want to buy USDJPY at 101 and DPR/n is 0.4 so it will place an order at 101.40 and so on. My problem is that keep placing order at every tick how do I stop it too the once per price increment ?

whroeder1
13656
whroeder1 2016.10.04 15:09  
akshay12489: My problem is that keep placing order at every tick how do I stop it too the once per price increment ?
Where do you check if you already have placed the orders?
/
To add comments, please log in or register