Trading System Automatically Stopped
- This topic has 4 replies, 2 voices, and was last updated 1 month ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › Trading System Automatically Stopped
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:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
// ===================================================================== // 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 |
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.
Thanks. Tried it and still stopped. Have tried replicating them inline but the performance is reduced.
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)
Many thanks. I’ll give that a go.
Find exclusive trading pro-tools on 