AotoTrade not Triggering when backtest shows a trigger
Forums › ProRealTime English forum › ProOrder support › AotoTrade not Triggering when backtest shows a trigger
-
-
09/08/2025 at 9:05 AM #250465
Hi
I have just started this algo on Autotrade on a 10 Sec TF but the no trade was triggered when the backtest shows a trigger .
Can anyone offer an explanation
//————————————————————————-
// Main code : ASX Daily close H/LV2.4(1)
//————————————————————————-
defparam cumulateorders = false
DEFPARAM FLATBEFORE = 080000
DEFPARAM FLATAFTER = 172900
DM=0//Month=6//no trade for June
If Month=MM and currentdayofweek=DW then
NT=1
else
NT=0
endif
Start=080000
If time=start then
BT=0
ST=0
Flg=0
RT=0
Endif
noentrybeforetime=008000
noentryaftertime=170000
timeenterbefore=time>=noentrybeforetime
timeenterafter=timeIntradayBarIndex)
//——————————————-
if low[2] < low[3] AND high[1] > low[2] AND low < low[2] THEN buyTrigger = high[1] endif // === 1-2-3 HIGH REVERSAL SETUP (SHORT) === if high[2] > high[3] AND low[1] < high[2] AND high > high[2] THEN
sellTrigger = low[1]
endif
If close crosses over buytrigger and ind1>ind2 and OTD and TW Then
BUY N CONTRACT AT market
BT=BT+1
SL= lstp
TP=ltgt
Endif
If close crosses under selltrigger and TW and ind1strategyprofit and RT<2then
Flg=1
if ind1strategyprofit and RT<2 then
if ind1>ind2 then
buy 2*N contracts at market
RT=RT+1
SL=lstp1
TP=ltgt1
MK2=MK2+1
endif
endif
set stop ploss SL
set Target Pprofit TP
09/08/2025 at 9:23 AM #2504701234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374//-------------------------------------------------------------------------// Main code : ASX Daily close H/LV2.4(1)//-------------------------------------------------------------------------defparam cumulateorders = falseDEFPARAM FLATBEFORE = 080000DEFPARAM FLATAFTER = 172900DM=0//Month=6//no trade for JuneIf Month=MM and currentdayofweek=DW thenNT=1elseNT=0endifStart=080000If time=start thenBT=0ST=0Flg=0RT=0Endifnoentrybeforetime=008000noentryaftertime=170000timeenterbefore=time>=noentrybeforetimetimeenterafter=time<noentryaftertimeTW=timeenterbefore and timeenterafter and not DM and not NTind1=EXPONENTIALAVERAGE[SP](close)ind2=EXPONENTIALAVERAGE[LP](close)N=0.5OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)//-------------------------------------------if low[2] < low[3] AND high[1] > low[2] AND low < low[2] THENbuyTrigger = high[1]endif // === 1-2-3 HIGH REVERSAL SETUP (SHORT) ===if high[2] > high[3] AND low[1] < high[2] AND high > high[2] THENsellTrigger = low[1]endifIf close crosses over buytrigger and ind1>ind2 and OTD and TW ThenBUY N CONTRACT AT marketBT=BT+1SL= lstpTP=ltgtEndifIf close crosses under selltrigger and TW and ind1<ind2 and OTD thenSellshort N contracts At marketST=ST+1SL=sstpTP=stgtEndifIf CurrentDayofweek=1 thenM=2elseM=1EndifIf longonmarket[1] and not onmarket and strategyprofit[1]>strategyprofit and RT<2thenFlg=1if ind1<ind2 and Flg=1thensellshort M*N contracts at marketRT=RT+1SL=sstp1TP=stgt1MK=MK+1endifendifIf shortonmarket[1] and not onmarket and strategyprofit[1]>strategyprofit and RT<2 thenif ind1>ind2 thenbuy 2*N contracts at marketRT=RT+1SL=lstp1TP=ltgt1MK2=MK2+1endifendifset stop ploss SLset Target Pprofit TP09/08/2025 at 10:57 AM #250487Aunque no lo he mirado en profundidad, esta linea no esta incorrecta?
noentrybeforetime=008000, no seria 0800002 users thanked author for this post.
09/08/2025 at 10:58 AM #250488Here are some clues about those differences https://www.prorealcode.com/topic/backtesting-and-demo-account-algo-doesnt-match-live-algo/#post-175691.
1 user thanked author for this post.
09/08/2025 at 12:37 PM #250503no trade was triggered
Might it be due to Instrument changes which have been made over this last weekend re DAX, see this Topic …
https://www.prorealcode.com/topic/algo-stopped-position-closed/page/2/#post-250455
1 user thanked author for this post.
09/09/2025 at 7:14 AM #250534 -
AuthorPosts
Find exclusive trading pro-tools on