Hello,
I am new at backtesting with IRT. The system I want to test is pretty simple. I want to look at previous quarter retracements vs the current price. For example when the current price reaches a retracement of 75% of the previous quarter, then the system enters the trade. The system will then exit the trade when the current price >= then the current quarterly high. I am not sure what I am doing wrong in the code?
Sesst (125 % quarter, 1 previous back) >= Low
Sesst (High, quarter) <= High
Sesst(200% quarter, 1,previous back) >= Low
Should I be setting an MPD for the different time frames? Do I need to set variables each time I backtest? I am looking to really understand backtesting in IRT. The ability to pull data in any shape or form with IRT is amazing. I then can plug the csv into Python and it allows me to do quick research. IRT is much easier to use then zip line or quant connect. I would love to be able to master the backtesting portion of the IRT.
BEGIN Investor/RT TRADING SIGNAL DEFINITION for 150_Previous_day_retracement
COMMENT=NONE
SOURCE=
PLATFORM=Windows 10 (6.2, Build 9200)
DATE=2018-10-05 19:45
VERSION=13.3.5 (Build #33313 Jun 22 2018 12:57:26)
DATAFEED=Rithmic
NAME=150_Previous_day_retracement
BARCOUNT=AUTOMATIC
ELEM=LOW:Low
ELEM=SESST:Session Statistics Indicator:SESST[ ] RetracementRange PREFS: 0,128,255,2,2,0,0,128,0,1,0,0,10,4,60,1,12701270,2,1,4,1,T,F,1020,3,150,F,F,3539980800,3540326400,2,0,60,F,3,F,F,F,1020,405,F,
ELEM=MPD:Mixed Periodicity Data:MPD[ ] X PREFS: 0,128,255,2,2,0,18,239,0,0,0,1,12731273,36,1,0,138,0,30,1073741824,F,F,T,T,T,F,51,\0,SES,010000000200000000000000FF800000010000000000000000000000008000000A000000040000003C0000000100000056CEC10002000100040000000100000001000000FC030000030000000000FA420000000000D2FFD2001805D302000000000000003C00000000000300000000000000FC03950100000000000000000000,F,1,F,0,1,F,F,31,3,0,
SIGNAL=SESST <= LOW\MPD
END Investor/RT TRADING SIGNAL DEFINITION for 150_Previous_day_retracement
BEGIN Investor/RT TRADING SIGNAL DEFINITION for 200_PERCENT_RETRACEMENT
COMMENT=NONE
SOURCE=
PLATFORM=Windows 10 (6.2, Build 9200)
DATE=2018-10-05 19:45
VERSION=13.3.5 (Build #33313 Jun 22 2018 12:57:26)
DATAFEED=Rithmic
NAME=200_PERCENT_RETRACEMENT
BARCOUNT=AUTOMATIC
ELEM=SESST:Session Statistics Indicator:SESST[ ] RetracementRange PREFS: 0,128,255,2,2,0,0,128,0,1,0,0,10,4,60,1,12701270,2,1,4,1,T,F,1020,3,200,F,F,3539980800,3540326400,2,0,60,F,3,F,F,F,1020,405,F,
ELEM=LOW:Low
SIGNAL=SESST >= LOW
END Investor/RT TRADING SIGNAL DEFINITION for 200_PERCENT_RETRACEMENT
BEGIN Investor/RT TRADING SIGNAL DEFINITION for Retracement_Exit
COMMENT=NONE
SOURCE=
PLATFORM=Windows 10 (6.2, Build 9200)
DATE=2018-10-05 19:45
VERSION=13.3.5 (Build #33313 Jun 22 2018 12:57:26)
DATAFEED=Rithmic
NAME=Retracement_Exit
BARCOUNT=AUTOMATIC
ELEM=SESST:Session Statistics Indicator:SESST[ ] Highest PREFS: 0,128,255,2,2,0,0,128,0,1,0,0,0,3,60,1,12701270,2,1,4,1,F,F,1020,3,50,F,F,3539980800,3540326400,2,0,60,F,3,F,F,F,1020,405,T,
ELEM=HI:High
SIGNAL=SESST > HI.1
END Investor/RT TRADING SIGNAL DEFINITION for Retracement_Exit
BEGIN Investor/RT TRADING SYSTEM DEFINITION for Retracement
SOURCE=
PLATFORM=Windows 10 (6.2, Build 9200)
DATE=2018-10-05
VERSION=13.3.5
DATAFEED=Rithmic
NAME=Retracement
PERIODICITY= 60 Minutes
SYSTEM=Retracement,.All Symbols,ESZ8,52,7,1078223,1,1,10,10,3621612457,3102595738,3102595738,2000,3,\0,\0,50,0,0,0,0,5,0,\0,0,18,\0,0,0,0,
RULE 1: Action: BUY, Signal: 150_Previous_day_retracement,1,4,1,49,1,16,34816,0,134,0,0,0,0,0,0,3,60,0,
RULE 2: Action: SELL, Signal: Retracement_Exit,5,3,1,49,1,16,34816,0,134,0,0,0,0,0,0,3,60,0,
RULE 3: Action: SELLSTOP, Signal: 200_PERCENT_RETRACEMENT,2,15,1000,48,1,16,34816,0,134,0,0,0,0,0,0,3,60,0,
END Investor/RT TRADING SYSTEM DEFINITION for Retracement
BEGIN Investor/RT CHART DEFINITION for Retracement
--
--To Import This Definition:
--1. Select all the text in this file.
--2. COPY to clipboard (Ctrl+C)
--3 Go to Investor/RT and PASTE (Ctrl+V)
--To learn more about importing definitions see www.linnsoft.com/importing.
--
COMMENT=retracement
SOURCE=
PLATFORM=Windows 10 (6.2, Build 9200)
DATE=2018-10-05 19:45
TIMEZONE=Eastern Daylight Time (GMT - 5:00) DST
VERSION=13.3.5 (Build #33313 Jun 22 2018 12:57:26)
DATAFEED=Rithmic + DTNMA ORS=N/A
NAME=Retracement SIZE=736,1358
PERIODICITY=3,60,0 (60 Minutes)
PIXELS=8:0
LOOKAHEAD=0
RMARGIN=67
CFLAGS=786432 CFLAGS2=150017
VIEWPERIOD=1,1,120,3607318800,3621600000 (Last 120 hours)
SUBSESSION=0,30,2
COLORS=12632256,0,5329233,16053492,2434341,11382189,16777215,0,0
DESC=Retracement: ESZ8 (60m), ESZ8 (D) 60 Minutes, Session #0 09:30-16:00
SESSION OVERRIDE=0 US Stocks: Hours: 09:30 to 16:00
TICKER=ESZ8:GLOBEX:7 SECTYPE=3 DISPLAY=12 ALIAS=@ES#
-Tick Data: 5 Days, Intraday: All Data, Daily: 2600 Days
PANE #1 PCT=0.001890 PFLAGS=272 SCALE=1,0.000000,0.000000,0.000000,0.000000,0.000000,0,0
PANE #2 PCT=1.000000 PFLAGS=33808 SCALE=17,2865.809798,2948.000000,0.000000,0.000000,0.000000,0,0
INDICATOR: SIG #10 ASSOC: ESZ8:GLOBEX:0 ID#1 PERIODICITY: 3,60,0 DESC: SIGNAL[ESZ8 (60m) 0] 150_Previous_day_retracement,0 LABEL: T TXTLBL: F,"",F RECALC: 0,0 PREFS: 0,136,0,1,0,0,150_Previous_day_retracement,0,1,0,F,159416448,524288,16,\0,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,0,0,0,0,0,0,0,0,0,0,F,\0,F,F,F,2,12781278,3,F,3,F,\0,1,0,1,0,0,2,
INDICATOR: SIG #10 ASSOC: ESZ8:GLOBEX:0 ID#1 PERIODICITY: 3,60,0 DESC: SIGNAL[ESZ8 (60m) 0] 200_PERCENT_RETRACEMENT,0 LABEL: T TXTLBL: F,"",F RECALC: 0,0 PREFS: 0,136,0,1,0,0,200_PERCENT_RETRACEMENT,0,1,0,F,159416448,524288,16,\0,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,0,0,0,0,0,0,0,0,0,0,F,\0,F,F,F,2,12781278,3,F,0,F,\0,1,0,1,0,0,2,
INDICATOR: SIG #10 ASSOC: ESZ8:GLOBEX:0 ID#1 PERIODICITY: 3,60,0 DESC: SIGNAL[ESZ8 (60m) 0] Retracement_Exit,0 LABEL: T TXTLBL: F,"",F RECALC: 0,0 PREFS: 0,136,0,1,0,0,Retracement_Exit,0,1,0,F,159416448,524288,16,\0,F,0,0,0,0,0,F,0,F,F,F,F,0,0,0,0,0,0,0,0,0,0,0,0,F,F,0,0,0,0,0,0,0,0,0,0,0,F,\0,F,F,F,2,12781278,3,F,0,F,\0,1,0,1,0,0,2,
INSTRUMENT: ESZ8:GLOBEX:0 ID#1 PERIODICITY: 3,60,0 TYPE: 3,2,12 COLORS: 64256,16711680,1,0 [Alias: @ES#]
VAP_FOOTPRINT: 0,0,2,0,9,0,0,100,0,0,0,4160,50,0,0.25,0,0,0,0,0,Arial,0,
SESSION #0. US Stocks: Closed,Posted, Hours: 09:30 to 16:00
INDICATOR: TSYS #135 ASSOC: ESZ8:GLOBEX:0 ID#1 PERIODICITY: 3,60,0 DESC: TSYS[ESZ8 (60m) 16] Retracement LABEL: T TXTLBL: T,"",F RECALC: 0,0 PREFS: 0,149,0,1,0,0,0,149,0,1,2,0,255,0,0,1,0,0,187,0,0,1,2,0,0,0,255,1,2,0,255,0,0,1,2,0,0,149,0,1,2,0,255,0,255,1,2,0,0,149,0,1,0,0,255,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Retracement,0,6,11,0,11,0,0,0,0,8,8,3,2,1,4,4,0,1,2,3,4,5,0,0,0,0,0,0,0,0,0,T,T,T,F,T,F,F,F,F,F,437665056,13011301,F,
--INVISIBLE INSTRUMENT: ESZ8:GLOBEX:0 PERIODICITY: 0,30,1073741824
- This chart definition references 3 RTL objects (scan/signal/custom indicator)
END Investor/RT CHART DEFINITION for Retracement