End orders but not active trade
Forums › ProRealTime English forum › ProOrder support › End orders but not active trade
- This topic has 7 replies, 4 voices, and was last updated 11 months ago by slumpy man.
-
-
11/19/2023 at 1:41 PM #223918
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?
11/19/2023 at 5:13 PM #223927Pending 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.
11/19/2023 at 11:57 PM #223937the 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
11/20/2023 at 11:51 AM #22395911/20/2023 at 12:59 PM #223963I 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 :1234567If 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
12345Buy x Contracts at MyPrice Limit // Needs to be repeated each bar (= call of code).//orSell x Contracts at MyPrice Stop // Ditto.Buy x Contracts at Market // This is not a Pending order. It will execute immediately.11/22/2023 at 6:50 AM #224099Hmm still not working for me. Trades are coming in after 830 with that code still
11/22/2023 at 12:59 PM #22413311/24/2023 at 9:34 AM #224226I figured it out. I just had to add endtime = 083000 and then add endtime to my orders line
-
AuthorPosts
Find exclusive trading pro-tools on