Please Help

 

Hello every one .

I have a problem in the expiration time .

I want to make the order be expire after 1 houre , what the right code to do that???

OrderSend(Symbol(),OP_BUY ,Lots,Ask,1,Ask-loss*Point,Ask+profit*Point,"Mercury_Man",1,??????????????,Green);

thank you for help me.

 
mercury_man:
Hello every one .

I have a problem in the expiration time .

I want to make the order be expire after 1 houre , what the right code to do that???

OrderSend(Symbol(),OP_BUY ,Lots,Ask,1,Ask-loss*Point,Ask+profit*Point,"Mercury_Man",1,??????????????,Green);
thank you for help me.

OrderSend(Symbol(),OP_BUY ,Lots,Ask,1,Ask-loss*Point,Ask+profit*Point,"Mercury_Man",1,Time[0] + 3600,Green);

 

Thank you very much my dear .

Is chart time frame import ??? on which time frame must expert be opened

thank you again .

 
mercury_man:
Thank you very much my dear .

Is chart time frame import ??? on which time frame must expert be opened

thank you again .

Good point - it would depend on how much time has elapsed on the current bar...

To make it time-frame independent, use the following:

OrderSend(Symbol(),OP_BUY ,Lots,Ask,1,Ask-loss*Point,Ask+profit*Point,"Mercury_Man",1,iTime(NULL,Period_M1,0) + 3600,Green);
 
omelette:
Good point - it would depend on how much time has elapsed on the current bar...

To make it time-frame independent, use the following:

OrderSend(Symbol(),OP_BUY ,Lots,Ask,1,Ask-loss*Point,Ask+profit*Point,"Mercury_Man",1,iTime(NULL,Period_M1,0) + 3600,Green);

In my opinion you should rather use TimeCurrent()+3600 because it is the current time on whatever time frame and it is not the time of the beginning of the candle. (but of course on M1 candles it doesn't make such a big difference)

 
jlpi:
In my opinion you should rather use TimeCurrent()+3600 because it is the current time on whatever time frame and it is not the time of the beginning of the candle. (but of course on M1 candles it doesn't make such a big difference)

Good point, I hadn't realised that, having never used TimeCurrent() in anger before. Thanks for pointing that out.

 
jlpi:
In my opinion you should rather use TimeCurrent()+3600 because it is the current time on whatever time frame and it is not the time of the beginning of the candle. (but of course on M1 candles it doesn't make such a big difference)

Thank you very much jlpi

omelette:
Good point, I hadn't realised that, having never used TimeCurrent() in anger before. Thanks for pointing that out.

thank you very much omelette