Hello Btoovey
Here is what your set up would look like in Tradestation with a time exit.
I added the easy language code for using data1 and data2. I leave the rest to you.
This kind of code has been around forever.
Set up
a) Calculate the percent change of the traded instrument IBM in data1
Data1 Percent Change = (Close/Close[1] -1) * 100
b) Calculate the percent change of the $INDU index in data 2
Data2 Percent Change = (Close/Close[1] -1) * 100
c) Calculate the relative strength of the percent change of the traded instrument versus the
percent change of the index:
Spread = (Data1 Percent Change/Data2 Percent Change -1) * 100
d) If the spread is less than the oversold level (92),
then buy this bar on the close.
e) If the spread is higher than the overbought level (108),
then sell this bar on the close.
f) Exit out of all long positions when the market retraces to the lowest low of the last 6 bars.
g) Exit out of all short positions when the market breaks out of the highest high of the last 6 bars.
h) If 6 bars have gone by without any significant profit, exit all positions.
Here is what your set up would look like in Tradestation with a time exit.
I added the easy language code for using data1 and data2. I leave the rest to you.
This kind of code has been around forever.
Set up
a) Calculate the percent change of the traded instrument IBM in data1
Data1 Percent Change = (Close/Close[1] -1) * 100
b) Calculate the percent change of the $INDU index in data 2
Data2 Percent Change = (Close/Close[1] -1) * 100
c) Calculate the relative strength of the percent change of the traded instrument versus the
percent change of the index:
Spread = (Data1 Percent Change/Data2 Percent Change -1) * 100
d) If the spread is less than the oversold level (92),
then buy this bar on the close.
e) If the spread is higher than the overbought level (108),
then sell this bar on the close.
f) Exit out of all long positions when the market retraces to the lowest low of the last 6 bars.
g) Exit out of all short positions when the market breaks out of the highest high of the last 6 bars.
h) If 6 bars have gone by without any significant profit, exit all positions.