End orders but not active trade
- This topic has 7 replies, 4 voices, and was last updated 1 year ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › End orders but not active trade
Hello everyone, I’m very new to all of this so this is probably a basic question for you.
I want my pending orders to stop at a certain time but my code also stops any active trades. So far I have this:
DEFPARAM FLATBEFORE=073000
DEFPARAM FLATAFTER=083000
How do I just let the active trades continue without being stopped?
Pending orders only last one bar. So you don’t need to cancel them. Just stop placing them after the time of your choice. This is valid for intraday timeframes.
If you are trading a daily timeframe you will need to resort to multiple timeframe, so that you can place pending orders in an intraday timeframe, stopping placing them when needed.
the pending orders do stop but its the active trade I’m concerned about. It gets stopped wherever it is at the DEFPARAM FLATAFTER time. I just want it to continue
I want my pending orders to stop at a certain time but my code also stops any active trades.
Possibly you don’t realize that a “pending order” is a functional phenomenon which really is different than “a program code which must stop trading new orders”.
I think you refer to the latter. In that case, you should try to make something like this :
1 2 3 4 5 6 7 |
If Time >= 073000 and Time <= 083000 then // Here your code to enter new trades. endif // Here your code to exit trades, assumed you want this between 07:30 and 08:30. |
A Pending Order is of the form
1 2 3 4 5 |
Buy x Contracts at MyPrice Limit // Needs to be repeated each bar (= call of code). //or Sell x Contracts at MyPrice Stop // Ditto. Buy x Contracts at Market // This is not a Pending order. It will execute immediately. |
Hmm still not working for me. Trades are coming in after 830 with that code still
I figured it out. I just had to add endtime = 083000 and then add endtime to my orders line
Find exclusive trading pro-tools on