How to place an order after x amount of time

Hello everyone! I need help :slight_smile:

How to implement this to an advisor.

If ( 5 minutes have passed since the last position was opened )

Do this



Thanks for your interest.

int OnTick()

     //Do This

 return 0;

datetime LastOrderTime()
 datetime time;

 for(int i=OrdersTotal()-1; i>=0; i--)
    if(OrderSymbol()==_Symbol && OrderMagicNumber()==MagicNumber)

 return time;

Many thanks to you!! I will try this

Hey cruddiforth2c. I tried this but didn’t work. I got an error. Which is :

 'MagicNumber' - undeclared identifier

Do you know why and how to fix this. Thanks for your help :slight_smile:

So this is a custom global variable that you would define it in your code for example :

int MagicNumber=12345;

The orders will be detected by their Magic Number,

Before int Ontick you must declare your magic number :
input int MagicNumber = 11223344;
Or whatever number you want

Many thanks to cruddiforth2c and dohms2b :slight_smile: