ProOrder live entries differ from backtest entries…..

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • #265664 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Hi everyone,

    First of all for complete transparency I inform the forum that the script has been written with the help and collaboration of AI.

    I’m looking for some technical help understanding why my ProOrder autotrading entries do not always correspond with the entries produced by the backtest, despite using the same strategy code and parameter settings.

    Strategy setup

    • Platform: ProRealTime v12
    • Instrument: US Tech 100 (DFB)
    • Execution timeframe: 10 seconds
    • Directional filters: Internally calculated, confirmed 5-minute and 1-minute swing directions must agree.
    • Entry logic: A 10-second entry score, EMA-based calculations, spread and slope filters, and a minimum entry-score threshold.
    • Parameters: Min1MinEntryScore = 5, MinSpread = 0, MinSlope = 1.
    • Risk management: 12-point stop loss and 10-point profit target.
    • Trading session tested: 17:00–19:30 on 16 October 2026.

    The strategy calculates its own swing directions internally; it does not rely on the chart’s external swing indicator to determine directional alignment.

    What I am observing

    Some live entries correspond very closely with the backtest, both in timing and price. However, other entries differ substantially in both respects.

    For example:

    BacktestLive Entry time 17:40:00 Entry price 29,442.6

    ProOrderShort Entry time 17:41:30 Entry price 29,422.8

    That is a difference of 90 seconds and 19.8 points.

    Another example:

    BacktestLive entry time18:12:20 Entry price 29,308.3

    ProOrderShort entry time18:13:10 Entry price 29,293.6

    That is a difference of 50 seconds and 14.7 points.

    Other entries match closely, with price differences of less than a point. This is why I am trying to understand what causes the inconsistent behaviour rather than assuming every live entry is different.

    What I have checked

    • The same strategy code and parameter settings are being used.
    • The backtest and live trading cover the same session.
    • ProOrder is running the strategy on the 10-second timeframe.
    • The 5-minute and 1-minute directional charts show established downward movement around the examples above.
    • The ProOrder order list confirms that the live orders were executed, but the order-status information I have accessed does not identify when the strategy’s entry conditions first became true.

    My questions

    1. Can ProOrder evaluate a multi-timeframe strategy differently from the backtest, even when the same code, settings and execution timeframe are used?
    2. Could the interaction between TIMEFRAME(..., UPDATEONCLOSE), the internally calculated swing states and the 10-second execution timeframe cause the live strategy to recognise an entry later than the backtest?
    3. Are there differences in historical initialisation, bar synchronisation or strategy evaluation that could explain why some entries match closely while others occur one or more bars later?


    I can provide the complete strategy code if required…

    My objective is to identify the technical reason for the discrepancy so that live ProOrder can reproduce the intended backtest behaviour as faithfully as possible. I would prefer to establish the cause before changing the strategy logic or parameters.

    Thanks in advance for any guidance.

    #265671 quote
    JSJS
    Participant
    Master

    Hi,

    There are several possible explanations for the discrepancies you’ve described, but the most effective way to identify the actual cause is to share the complete strategy code…

    That would allow to examine the logic, the multi-timeframe calculations and the entry conditions in detail, rather than speculating about possible causes…

    #265675 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Hi JS

    Many thanks for showing an interest in my script, I attach the 5/1/10 itf file for your perusal and analysis, I await your feedback and responses forthwith.

    Kind regards.



    10pts-swing-5110-FIXED.itf
    #265677 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Hello. The code you provided is not visible…

    #265710 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Hello Ivan

    Also to you I extend my thanks for your help and interest. I have uploaded the file again and trust this one is viewable. I really need to get to the bottom of this as the strategy made 66pts today while the live autotrading made a loss, all to do with delayed execution or a code discrepancy.


    Many thanks



    10pts-swing-5110-FIXED-1.itf
    #265711 quote
    JSJS
    Participant
    Master

    Hi,

    The parameter settings and session date in the code you shared are different from the ones you described above…

    Is this the correct version of the code used for the backtest and live trading…?

    #265712 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Hi JS


    Yes the parameter settings are optimised over a period prior to the trading session. The ‘fixed’ identical script is then adjusted, the date changed to reflect that days trading session with the trading session remaining constant at 17:00 – 19:30, this is then used to autotrade the aforementioned session.

    Sadly, sometimes there is a discrepancy between the strategy entry values and times and that of the autotrading even though both scripts are identical.

    #265715 quote
    JSJS
    Participant
    Master

    Hi,

    I believe this is caused by the difference between the spread used in the backtest (fixed spread) and the spread in live trading (dynamic spread)…

    Your system uses tight stop orders in a volatile market, with a default timeframe of 10 seconds…

    This combination makes the system vulnerable to differences in spread between the backtest and the live environment…

    These differences may cause stop-loss and take-profit orders to be triggered in a different order or at different times…

    As a result, a position may close with a profit in one scenario but with a loss in the other…

    Differences may also arise in how long a position remains open, which can affect the subsequent development of the strategy…

    In addition, you use NOT OnMarket in combination with a threshold that starts building up again once a position has been closed…

    This means that new entries may occur at different times, depending on when the previous position is closed…

    #265737 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Hi JS.


    First of all many thanks, that’s a very useful explanation and gives me a clear direction to investigate.

    The point about NOT ONMARKET and ReadyToTrade is particularly interesting, as I have seen subsequent entries differ after a trade closes differently in live trading.

    I’m trading US Tech 100 DFB with a 10-second execution timeframe, a 10-point profit target and a 12-point stop-loss. The backtest has been using a 2-point spread assumption, although the live spread can vary.

    Could I ask two follow-up questions?

    1. Spread: Is there a recommended way to configure the ProBacktest spread so that it more closely reflects the live spread on US Tech 100 DFB? Would using a higher fixed spread be a reasonable diagnostic test?
    2. Entry logic: Would you recommend changing the NOT ONMARKET / ReadyToTrade mechanism, or would that risk changing the strategy’s intended entry behaviour? I’m keen to establish the cause before modifying the code.

    My aim is to make live autotrading reproduce the strategy as closely as possible, rather than simply optimise the backtest results.

    Thanks again for your help.

    #265738 quote
    JSJS
    Participant
    Master

    Hi,

    You can try different spread values in the backtest, but a fixed spread can never fully reproduce the actual live trading conditions…

    With a 10-point profit target and a 12-point stop-loss, even relatively small differences in spread and execution costs can have a significant impact on the results…

    I wouldn’t change the code at this stage, because the code itself is not necessarily the underlying cause of the problem…

    #265741 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Hi JS. Many thanks once again for the advice. I am indeed loathe to change the code prematurely, the results are promising, today was a relatively weak day..

    I’ve attached two screenshots showing the detailed order reports from today: one from the live autotrading system and one from the strategy report.

    There are some encouraging similarities, with many entries occurring at the same time and prices generally within around 0.5 points. However, there are also some material discrepancies in entry timing, exit timing and outcomes.

    One example is around 18:08–18:11, where the strategy and live order records appear to diverge significantly in their entry timing. There are also trades where the strategy reports a profit but live trading records a loss.

    I understand that a fixed backtest spread cannot fully reproduce live conditions. My question is whether the differences visible in these reports could reasonably be explained by spread and execution alone, or whether they suggest that the strategy is reaching different entry conditions after a previous position closes.

    If you’ve time I’d appreciate you looking at the attached reports and advise which discrepancy you would investigate first?

    I’m keen to establish the cause before changing the code. If I (we) can achieve the objective to make ProOrder live autotrading follow the strategy as closely as the platform allows.

    Thanks again for your help.

    Screenshot-2026-10-20-202119.png Screenshot-2026-10-20-202119.png Screenshot-2026-10-20-202746.png Screenshot-2026-10-20-202746.png
    #265742 quote
    JSJS
    Participant
    Master

    Hi,

    If you look at the trade with the entry time of 18:57:50, the Buy entry was executed at the same time in both the backtest and live trading…

    However, the entry price was 29,578.8 in the backtest and 29,579.3 in live trading…

    This illustrates the difference between the fixed spread used in the backtest and the live spread…

    Because the entry prices differ, the effective price levels of the stop-loss and take-profit will also differ…

    This can result in different exit prices and/or execution times…

    In my view, this is the fundamental reason for the discrepancies between the backtest and live trading…

    I don’t see how this can be fully resolved by changing the strategy code, since the live spread is variable and cannot be known in advance…

    robertogozzi thanked this post
    #265743 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Thanks for the explanation — I can see how differences between fixed backtest spread and live spread could account for the small price differences at matching entry times. That’s helpful.

    There is one specific example I’m still trying to understand, and I’d welcome your thoughts or those of anyone else familiar with ProOrder.

    On 20 October, around 18:08–18:11, the strategy report shows a short entry at 18:08:50, followed by a losing exit at 18:11:10. The live trading report, however, shows no corresponding entry at 18:08:50; its next short entry is at 18:10:40, followed by an exit at 18:11:17.

    So this appears to be more than a difference in entry price or exit execution — the entry times themselves differ by approximately 110 seconds.

    Could a difference in spread or execution plausibly account for that, perhaps through an earlier position closing at a different time and affecting when the strategy can re-enter? Or would this point towards a difference in signal generation or order processing?

    I appreciate that a backtest can never perfectly reproduce live trading, and I’m not looking to change the code prematurely. I’m simply trying to understand which part of the process could explain this particular discrepancy.

    One related question, if you don’t mind: do you have any experience with MT5 for this type of short-timeframe automated strategy? Would testing an equivalent strategy in MT5, using real-tick historical data and variable spreads where available, give us a more reliable way to investigate these discrepancies? Or do you think we’d encounter essentially the same limitations when comparing backtests with live execution?

    I’m not committed to changing platforms; I’d simply value your opinion before considering the work involved in rebuilding the strategy.

    If anyone else has encountered similar behaviour with ProOrder on a short timeframe, I’d be very grateful for their insight. Thanks again for your help.

    #265746 quote
    JSJS
    Participant
    Master

    Hi,

    I can’t reproduce your backtest for 20 October 2026 using the code you provided. Have the parameters been changed?

    In my backtest, I checked the different variables using the Graph function. Are you familiar with this feature, and do you use it?

    ProRealTime provides three useful debugging functions that allow you to display variable values in your chart: Graph, GraphOnPrice and Print.

    For example, you can add the following line at the end of your code:

    GRAPH TradeAllowed AS "TradeAllowed"

    This allows you to inspect the values of TradeAllowed directly in the backtest chart…

    You can do the same for the other relevant variables to see exactly when their values change…

    In my backtest, the values I checked correspond exactly to what the code specifies…

    I’m not familiar with the MT5 programming language, but I suspect you could run into the same underlying problem there: even when the strategy code is identical, differences in spread and execution conditions can prevent live trading from reproducing the backtest results exactly…

    #265753 quote
    LivJoJadeLivJoJade
    Participant
    Junior

    Hi JS

    If you would be kind enough to try again the variables for the 20/10 were 7/2/1.

    Many thanks as always.


Viewing 15 posts - 1 through 15 (of 31 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

ProOrder live entries differ from backtest entries…..


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
LivJoJade @livjojade Participant
Summary

This topic contains 30 replies,
has 5 voices, and was last updated by LivJoJadeLivJoJade
1 week, 4 days ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/17/2026
Status: Active
Attachments: 15 files
ProRealCode ProRealCode
Loading...