Limit orders
Forums › ProRealTime English forum › ProOrder support › Limit orders
- This topic has 6 replies, 3 voices, and was last updated 2 hours ago by
JC_Bywan.
-
-
11/20/2025 at 12:01 AM #253794
Hi everyone.
I’ve written a code for algorithmic trading of the US Tech 100 1 Euro contract on daily charts. Orders are placed when the first bar after the signal day opens, and as I understand it, they are automatically cancelled if they’re not filled that same day. It works well with “buy 1 contract at market.” I’m trying to achieve a lower entry by buying at, for example, open * 0.996. In the backtest it appears to work, but when I check specific transactions I see that it’s incorrect. Some orders are filled in the backtest even though the limit was never reached. Anyone with long experience who has dealt with this? Thanks in advance.
11/20/2025 at 10:34 AM #25379611/20/2025 at 10:53 AM #253797Hi,
Your code is read at candle close (and therefore before start of the candle on which the order will be executed).
So, if the code decides at candle close to place an order for next candle, and you use your “buy 1 contract at market” line, it places the order and executes it, so far so good.
But, when you use the line “buy 1 contract at open * 0.996 LIMIT”, the value used for open cannot be the open of the next candle it doesn’t know yet, it is the open of the candle just closed. If you took this into account when seeing orders you think shouldn’t be taken, then the problem is not this. But, in case you looked at open value of the candle where the order is executed instead of the open value of the previous candle the code has been read on to be able to send its order, then this would be the issue?
4 users thanked author for this post.
11/24/2025 at 9:46 PM #253935Here is a precise English translation:
Thanks for your reply, JC_Bywan.
I wrote “buy at open” and thought it would use the open of the next candle. Let’s say the signal comes on Monday’s close — then the order is placed on Tuesday, and I want to use Tuesday’s open to calculate the limit. Is there a code I can use to achieve that? Thanks in advance 🙂
11/25/2025 at 8:04 AM #253939Hi, no there isn’t, because to be executed “when the candle opens” (horizontal axis), the limit order has to be placed before the value of the open (vertical axis) is known to be able to specify such limit rather than timing.
1 user thanked author for this post.
11/25/2025 at 2:25 PM #25394711/25/2025 at 6:07 PM #253966It would raise other questions (list not necessarily exhaustive):
– how much daily history would be needed for the code to work, this didn’t matter maybe when running in daily, but considering a multitimeframe choice it would now be the small timeframe defining max history available
– what is the “biggest” small timeframe acceptable to capture the daily open, and send order only from small timeframe second candle
– what is the multiplying coefficient between these 2 timeframes, and is this coefficient small enough to allow enough history for the bigger timeframe (the daily one) defined at top of the list
– and should all above be ok, how to handle the case of the 0.996*open possibly occuring during the small timeframe first candle of the day, should it not occur later.
-
AuthorPosts
Find exclusive trading pro-tools on 