Probacktest the trade doesn’t trigger but in the live market it does!

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #261764 quote
    Stam
    Participant
    Junior

    Hello all,


    Can anyone help me understand why in Probacktest a trade doesn’t trigger but in the live market it does??? I am with IG, it has happened twice now, I have raised a query with them about two weeks ago and haven’t heard back yet.

    I am hoping that someone can shade some light on this? My entries are stop entries, and I am accounting for spread. I looked at the ask price on the IG platform for the buy order, and the condition of adding extra points about the previous candle high were not met.

    Thank you in advance to all the wise oracles out there!


    #261767 quote
    Nicolas
    Keymaster
    Legend

    I bet on spread differences between backtest and live.

    What do you mean by “accounting for spread”?

    #261770 quote
    turame
    Participant
    Master

    Hello Stam,

    Ok you are accounting for spread. But when you backtest, the spread you choose is fixed. However, the spread at IG is variable. I don’t know the time periods during which you trade your strategy, but if you trade at all hours of the day, you will inevitably see differences between the backtest and the actual results.

    #261799 quote
    Stam
    Participant
    Junior

    Thank you for your reply.

    By accounting for spread I mean I add half the spread to my trigger. The code run on an index, and bar any crazy market moves (which this one was a normal no meltdown day), the spread of the index while the underline market is open is set at 1pt. So I add 0.5pt + an extra 0.8pt above the high of the trigger candle for entry. That 1.3pt amount was not reached on the next candle and therefore the trade should have not been entered.

    I checked on the IG platform to make sure the spread was 1pt, so I looked at the Bid price and the Ask price at that point, and the spread was a 1pt.

    Another conundrum that I have discovered, is that I limit the time the program is active to about 40 min after the market opens and 40 min before market close, to avoid opening/closing spikes. The trade triggered at 25 min past the opening time, which is not within the allowed period for the program to be active. (I’ve doubled checked that on the backtest it “gets” when the program should be active and when it shouldn’t, and I have also accounted for Daylight saving).

    Any thoughts on these issues? How reliable is the execution process of PRT if conditions are not met yet execution takes place?

    Many thanks for your thoughts!


    #261802 quote
    PeterSt
    Participant
    Master

    Hi there Stam,


    Your question will be unusual to most of us, because in your scenario/case Backtest won’t enter while Live does, while 999 out of 1000 issues regarding this, it is the other way around. But it intrigues anyway (or because of that).


    First things first :


    How reliable is the execution process of PRT if conditions are not met yet execution takes place?

    A very good question, but IMHO n/a;

    Or maybe better : hard to wrap my head around because how or what then ? Read :


    How could an execution take place on conditions *I* did not set ?? Of course, I understand that you seek for something like that because it seems to happen to you, but this is not how it can go. This can (and this is the other way around) :

    How can conditions in Backtest *not* be met while in Live they are not.

    … And of course, this *is* your stance, but it is also something to have straight.


    First off, I don’t think that Spread can cause an order to not-enter or enter. This IMO works the other way around : the price is met, and next the spread is deducted so you catch a loss right away at that moment. Is that with a spread of 1 points ? then your loss is 1 point. Is it 5 ? then 5. … One thing with this : the taken loss on spread can be charged at Entry, Exit or Both (I explicitly take IG as the example, because this is not so everywhere). But it is unrelated to Yes/No Entry.


    The fact that your Entries are Pending Stops could be something which is more special. So much so that a Backtest engine can run behind on their possibilities while Live depicts the truth and with that also how PRT behaves. This latter means : PRT will follow the broker (a real one (IBKR) or a not-so real one (IG) and there is nothing to be doubted for PRT in that realm. Errors in the communication (in the API with the broker) sure, but you will receive errors indeed (by means of 100+ different messages) and your System (Autotrading code) will be kicked out for further prevention of more anomaly). Mind you please, PRT is relatively unique in this, as the connection with the brokers is 100% tight because all server side processed.

    Watch out ! with this I take it that you yourself do not used PRT’s own API which also exists (could be for Australia, USA and more). So in the case of you using the PRT API, all is moot (because now that can run behind on modern broker approaches).


    One thing I wonder myself : can Manual Trading with IG via PRT (!) be done by means of a Pending Stop for Entry ?

    I wonder because most of such more special means can not by done with the IG version of PRT, while “all” can be done in PRT-IB. This means that the native PRT platform would do it, but the constraints at PRT-IG must be filtered. But are they (sufficiently) ?


    Something else is that you’d need a kind of special thinking to let an Entry happen in your Stop situation. Although this normally surely can be done, most people will tell you that it is not possible. And there you have it again : what is not possibly by general stance may be rejected by stupid theoretical software (PRT Backtest) while Live (IG) just allows it.

    Small problem with this : you cannot backtest it. Arghhh.


    It looks like you bear your experience from somewhere else (platform) and it could be good to tell which that is (no real need, but people may tell you experiences with the very same right away). But the message : because you *seem to* know how things should or could go, you may make the mistake to think of PRT as a just as decent platform with adjacent possibilities. And well, in many cases that cannot be. For example, you take into account the spread yo say. Well, without Bid, Ask and Price differentiation, you actually can’t. You may think to mimic or fake it, but you can’t. You thus also cannot form Entries around that, of which you seem to say you do that.


    Having said this all, especially referring to PRT following the Broker’s interface (communication) for obtaining order status etc. while PRT is the instance to hand out the order of accepted type, not rejected by the parser/compiler (your Stop order in code), how would you now reason yourself what can be happening ?

    • Backtest does not take position;
    • very same code in Live does.


    With this question on the table, you maybe realize that Backtest as such does not know about markets and queues and you will be later in Live than in Backtest (backtest always takes position once the price is properly touched). However : that is the normal situation with a Limit Order looking for the Entry. You do this the other way around; it wouldn’t be so that “something” now tells your turn is later ??

    Read :

    It wouldn’t be so that in Live your order at the wrong side of the price which you did not expect … because … that will be treated as a Market Order now (instantly filled) ?

    If that is so, then this is also the one-line explanation. In that case, however, I like to add this :

    Supposed you are used doing these things not with IG (CFDs) but with a real broker, then with IG things may turn against you more than with a normal broker because IG will have “10 fold” the peaks (and depths) that causing Live to behave really different from historical data. This is harder to explain but it may cause your strategy to end up at the right side of the price within a bar (the moment your program code is called). This may make it work, while it actually should not (think slippage for the direction I am think of).


    As I said, intriguing; that’s why the long story.

    #261817 quote
    GraHal
    Participant
    Master


    Stam wrote: shade some light on this

    On the link below:

    Compare text and find differences online or offline – Diffchecker

    1. Copy and Paste the code direct from your ‘Backtest Algo’.
    2. Copy and Paste the code direct from your Algo as running under ProOrder.


    Click the Green ‘Find Difference’ button and tell us if there are any differences?

    #261835 quote
    Stam
    Participant
    Junior


    GraHal wrote: Click the Green ‘Find Difference’ button and tell us if there are any differences?

    Thank you for that, I was hoping all day that that would be the reason but alas, they are the same… For the time being I’ve increased the number of points for trigger above the previous candle high, but that does create it’s own issues :/

    Any thoughts about the time of day issue? I can’t find any reason why a trigger would occur at a time when the program should not be active. And of course, I have yet to hear back from IG.

    Thanks again for all the help, much appreciated.

    #261837 quote
    Stam
    Participant
    Junior

    Hey PeterSt,

    Thank you for your thoughts, what do you mean by a “real broker”? I am curious on the points you’ve made.

    A couple of years back, I did have a similar issue, when a trigger happened even though the total of the calculations for the trigger ended up as false. I did raise it with PRT and IG, and eventually they confirmed that it should have never been triggered, so if PRT does the calculations, how relevant is who is the broker, what am I missing?

    Many thanks!

    PeterSt thanked this post
    #261840 quote
    GraHal
    Participant
    Master


    Stam wrote: time of day issue?

    Have you tried starting a Backtest and ProOrder at exactly the same time?

    Some strategies / code give different trades depending on market / price action when the Algo starts running.

    Unless you have seen above happen, it’s hard to believe. Try it on your Demo Account and let us know outcome.

    #261841 quote
    PeterSt
    Participant
    Master


    Stam wrote: what am I missing?

    Almost explicitly that any Backtest engine may not match the Live engine of concern. See below for manual (!) order possibilities;


    1st : PRT-IB, hence the inherent PRT possibilities for the real broker, IBKR.

    2nd : PRT-IG, hence not a real broker at all which does what it likes with its own hedging (within a bandwidth of say 40 Nasdaq points, beyond that following a real underlaying (e.g. Nasdaq 100)).


    Point is : it is not said at all which of those possibilities are

    a. supported by the Backtest engine of either;

    b. Live of either.


    One example (out of I think dozens) : IG allows to trail via PRT commands, while IBKR does not allow trailing at all.

    This counts for Autotrading, while for Manual trading it is sort of the other way around (look at the “command sets” below).


    Most of the examples (the dozens) do not apply to your case; thy instead incur for the other way around : what does work in Backtest does not work in Live. Example of this : a minimum point distance which is applied in Live at IG (holding back a trade and even kills your System if violated), while Backtest won’t nag whatsoever. In parallel the point distance in IG is variable (it is even manually set at will by IG hedgers – ugh) while with IB the phenomenon does not even exist.

    Or in an other dimension again : with IG no orders can be rejected because of an unknown status (or very very difficult at least) while with IB this can easily happen because of the additional communication between broker and exchange (with IG the exchange is the broker).

    But let’s keep in mind, this is all not your case.


    But personally I don’t see why there wouldn’t be also dozens of situations that Backtest does not fire while Live does. I mean, do *I* ever investigate that ? no, I don’t. Actually there is no spur in me that would compare backtest to live anyway, except for yett again the other way around : doesn’t Backtest execute more trades than Live ? If not, then it is fine ! Read : very often Backtest executes more trades because that works on Price only, instead of Live which acts upon Bid and Ask (Price was reached while Ask or Bid weren’t even close). <– PRT can act upon Price only.


    And so I dare bet you that it will be the most normal that Live can execute where Backtest does not, just because the differences will exist and they are not even described. Yeah, in this forum challenged by trial and error, maybe by your case.


    FYI and FWIW : I have had analysed a 100++ cases by PRT (and IBKR) employees which were all suspect. But the news is : exactly none of those could not be explained. Most of them take hours to work out but in the end all can be explained.

    afbeelding_2026-06-09_113118113.png afbeelding_2026-06-09_113118113.png afbeelding_2026-06-09_114203755.png afbeelding_2026-06-09_114203755.png
    #261842 quote
    PeterSt
    Participant
    Master


    GraHal wrote: Try it on your Demo Account and let us know outcome.

    Great. That’s another dimension not to trust at all.

    In Demo the data can already be different, right ? It shouldn’t, but it often is. And outside of that, the rights we have on data may already differ (to give one example again : one allows for 0.1 contract the other 0.5 only).


    Plus the Sept 2025 happening beats it all. Some people still suffer from that (and I don’t mean loss of $).

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

Probacktest the trade doesn’t trigger but in the live market it does!


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Stam @stam Participant
Summary

This topic contains 10 replies,
has 5 voices, and was last updated by PeterSt
1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/05/2026
Status: Active
Attachments: 2 files
Logo Logo
Loading...