Trading System Automatically Stopped

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #251649 quote
    Alistair SS
    Participant
    New

    Hi All,

    I have an automated trading strategy which calls the Adaptive ATR-ADX Trend indicator from within the strategy code. The strategy works perfectly when backtesting however, when I go live in automatic trading it gets stopped by IG/PRT after the close of the first 5 minute candle and the attached reason for stopping pops up – server.strategy.probacktest.error.missing_data.call 

    I’ve increased the DEFPARAM PreLoadBars to 20,000 and still no difference. Checked that the indicator name aligns with the code etc.. Tried loads of different call variations and still no joy. Below is an example of one of the strategy indicator call code blocks which did not work! Any advice would be hugely appreciated:

    // =====================================================================
    // ATR/ADX from indicator — guarded CALL (stable live, baseline results)
    // =====================================================================
    tAtrStop   = close
    tTrendDir  = 1
    tADX       = 0
    tAtrUp2    = 0
    tAtrDown2  = 0
    
    // Keep this modest so you’re not waiting ages live; adjust if needed.
    // 8 bars = 40 minutes on 5m.
    safeMinBarsForCall = 8
    
    // Only CALL after enough bars to avoid first-bar live hiccups
    IF BarIndex >= safeMinBarsForCall THEN
    tAtrStop, tTrendDir, tADX, tAtrUp2, tAtrDown2 = CALL "ATRADX_SAFE"
    ENDIF
    
    // Readiness (only gates entries; CALL itself is above)
    IF useATRModule THEN
    atrReady = (tADX > 0) OR (BarIndex >= safeMinBarsForCall)
    ELSE
    atrReady = 1
    ENDIF
    
    // Route to live vars (once ready) or harmless stubs before
    IF useATRModule AND atrReady THEN
    atrStop  = tAtrStop
    trendDir = tTrendDir
    aADX     = tADX
    atrUp2   = tAtrUp2
    atrDown2 = tAtrDown2
    ELSE
    atrStop  = close   // price-level stub so distance checks don’t blow up
    trendDir = 1
    aADX     = 0
    atrUp2   = 0
    atrDown2 = 0
    ENDIF
    
    #251651 quote
    PeterSt
    Participant
    Master

    Hi there !

    Can you remove that If around the call and retry ?
    I understand the logic of the If, but I have had a situation at hand where this implied the same error.

    Alistair SS thanked this post
    #251671 quote
    Alistair SS
    Participant
    New

    Thanks. Tried it and still stopped. Have tried replicating them inline but the performance is reduced.

    #251672 quote
    PeterSt
    Participant
    Master

    OK, then try to add

    DefParams Preloadbars = 10000

    and adjust your line 15 accordingly. Thus with If again, but also try without that if. This if should actually be at the top of your code.

    If that helps, reduce the PreLoadBars till about the points that it stops working. Always keep the If in line with PreLoadBars.

    I hope this helps ! (it helped someone else)

    Iván González thanked this post
    #251718 quote
    Alistair SS
    Participant
    New

    Many thanks. I’ll give that a go.

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

Trading System Automatically Stopped


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Alistair SS
4 months, 3 weeks ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/23/2025
Status: Active
Attachments: No files
Logo Logo
Loading...