Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Lessons
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-03-2007, 04:46 PM
mercury_man mercury_man is offline
Junior Member
 
Join Date: Aug 2007
Posts: 18
mercury_man is on a distinguished road
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???

Code:
OrderSend(Symbol(),OP_BUY ,Lots,Ask,1,Ask-loss*Point,Ask+profit*Point,"Mercury_Man",1,??????????????,Green);
thank you for help me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-03-2007, 05:18 PM
omelette omelette is online now
Senior Member
 
Join Date: Jan 2006
Posts: 983
omelette is on a distinguished road
Quote:
Originally Posted by mercury_man View Post
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???

Code:
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);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-04-2007, 06:32 AM
mercury_man mercury_man is offline
Junior Member
 
Join Date: Aug 2007
Posts: 18
mercury_man is on a distinguished road
Thank you very much my dear .
Is chart time frame import ??? on which time frame must expert be opened
thank you again .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-04-2007, 12:34 PM
omelette omelette is online now
Senior Member
 
Join Date: Jan 2006
Posts: 983
omelette is on a distinguished road
Quote:
Originally Posted by mercury_man View Post
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:

Code:
OrderSend(Symbol(),OP_BUY ,Lots,Ask,1,Ask-loss*Point,Ask+profit*Point,"Mercury_Man",1,iTime(NULL,Period_M1,0) + 3600,Green);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-04-2007, 01:18 PM
jlpi's Avatar
jlpi jlpi is offline
Senior Member
 
Join Date: Oct 2006
Posts: 275
jlpi is an unknown quantity at this point
Quote:
Originally Posted by omelette View Post
Good point - it would depend on how much time has elapsed on the current bar...

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

Code:
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-04-2007, 02:00 PM
omelette omelette is online now
Senior Member
 
Join Date: Jan 2006
Posts: 983
omelette is on a distinguished road
Quote:
Originally Posted by jlpi View Post
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-05-2007, 06:38 AM
mercury_man mercury_man is offline
Junior Member
 
Join Date: Aug 2007
Posts: 18
mercury_man is on a distinguished road
Quote:
Originally Posted by jlpi View Post
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

Quote:
Originally Posted by omelette View Post
Good point, I hadn't realised that, having never used TimeCurrent() in anger before. Thanks for pointing that out.
thank you very much omelette
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump



All times are GMT. The time now is 03:03 AM.