Download MetaTrader 5

Help set delay on open new order

To add comments, please log in or register
Telmo Fernandes
254
Telmo Fernandes  

I have these 2 Ea´s, one for H1 other for H4, both of them will place a market order ( if trading conditions are met) at the end of the H1 and H4 candle respectively .

The change I would like to have done is : I would like the EA´s to wait X seconds before placing the orders ( there should be an user input) so instead of placing an order at the end of H1/H4  Candle , the ea should wait the inputted time and place the market order at the price available at that time ( if trading conditions are met).

Best Regards 

qjol
3243
qjol  

there is many ways to do it, here is a guideline for one of them

input int Seconds_To_Wait = 10;
bool SendOrder = false;
datetime Time_to_send_Order;
//code ...

if (trading conditions are met)
   {
   SendOrder = true;
   Time_to_send_Order = TimeCurrent() + Seconds_To_Wait;
   }


if (SendOrder && TimeCurrent() >= Time_to_send_Order)
   int Ticket = OrderSend(...);
   //code ...
   SendOrder = false;
   // code ...

of course i didn't tested it or compiled it

Telmo Fernandes
254
Telmo Fernandes  
qjol:

there is many ways to do it, here is a guideline for one of them

of course i didn't tested it or compiled it


Thank you,

 

Will try 

Telmo Fernandes
254
Telmo Fernandes  
pt2004:


Thank you,

 

Will try 


Well my coding skills are extremely limited, anyone here willing to code this for me?

 

I am willing to make donation through paypal.

whroeder1
14781
whroeder1  
pt2004: anyone here willing to code this for me?
Top of every page is a link labeled Freelance
Telmo Fernandes
254
Telmo Fernandes  
WHRoeder:
pt2004: anyone here willing to code this for me?
Top of every page is a link labeled Freelance


Ok,

 

Thank you 

To add comments, please log in or register