Help set delay on open new order

 

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 

 

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

 
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 

 
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.

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


Ok,

 

Thank you 

Reason: