Jump to content

Opening a trade @ a specific time?


melon2112

Recommended Posts

I am trying to see how to write a script (or use 1 already out there) for the days I am away. What I am looking for is a script that will put an OrderSend() at a specific time. I have already written the script to do the specific trade...just looking to put the order in the night before and not let it execute until a specific time the following day. Is there a way to do it using either my computer time (or preferably the online broker time) or would I have to use like a delay feature?

 

If anyone has a suggestion, it would be greatly appreciated. Thanks in advance.

Link to comment
Share on other sites

Hi melon2112,

 

It's pointless placing a pending order which you then want to execute at a particular time the next day, because pending orders will always be triggered at their entry price. You're better off creating an EA which uses iTime() to select the appropriate time to place your trades.

 

I assume that your entry criteria is determined on the previous day, though can't this be read in the next day by looking back in history? If so, then you just need an EA to enter market orders the next day based on your entry signals which uses iTime() to ensure that the orders are entered at the time you need.

 

If your entry criteria is determined on the previous day however it cannot be easily determined in the day when you want to enter the trade, then you may need to store the relevant variables as GlobalVariables (which are stored on the hard disk), so that they can be brought back into the EA at the right time.

 

Without knowing exactly what you're trying to do, it's hard to give a full solution.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...