This strategy is an add-on to the #TheStrat Reversals indicator (also posted in the library) which is a dedication to the work of @RobInTheBlack (Twitter Handle) who has helped countless traders with this pure price action based strategy that he developed over the past 27 years of trading, It is called #TheStrat
This strategy is dedicated to testing the various #TheStrat reversal (and continuation) setups as explained on the picture provided in the attached gallery which in itself is based on the 4 different Price Action scenarios discussed here: https://www.newtraderu.com/2019/02/13/what-do-we-know-to-be-true-about-price-action/
I recommend importing the .ITF in order to load the test variables, but for those interested here is the code (The x,y and a,b,c,d,e,f variables are used to test different combinations):
Defparam cumulateorders = False
possize = 1
Tollerance = x
OrderTollerance = x
SLBuffer = y
TPBuffer = y
Type2121 = a//TwoOneTwo Continuation
Type2122 = b//TwoOneTwo Reversal
Type312 = c//ThreeOneTwo Reversal
Type322 = d//ThreeTwoTwo Reversal
Type122 = e//OneTwoTwo
Type22 = f//TwoTwo
LongOnly = 0
ShortOnly = 0
InsideBar = high < high[1]-tollerance*pointsize and low > low[1]+tollerance*pointsize
OutsideBar = high > high[1]+tollerance*pointsize and low < low[1]-tollerance*pointsize
TwoUp = high > high[1]+tollerance*pointsize and low > low[1]+tollerance*pointsize
TwoDown = low < low[1]-tollerance*pointsize and high < high[1]-tollerance*pointsize
Up = close > open+tollerance*pointsize
Down = close < Open-tollerance*pointsize
If onmarket = 0 and Type2121 = 1 Then
If TwoUp[1] and Up[1] and InsideBar and ShortOnly = 0 Then
Buy possize contract at high+OrderTollerance stop
SL = high-low
TP = high[1]-high
ElsIf TwoDown[1] and Down[1] and InsideBar and LongOnly = 0 Then
Sellshort possize contract at low-OrderTollerance stop
SL = high-low
TP = low-low[1]
EndIf
Type = 2121
EndIf
If onmarket = 0 and Type2122 = 1 Then
If TwoUp[1] and Up[1] and InsideBar and LongOnly = 0 Then
Sellshort possize contract at low-OrderTollerance stop
SL = high-low
TP = low-low[1]
ElsIf TwoDown[1] and Down[1] and InsideBar and ShortOnly = 0 Then
Buy possize contract at high+OrderTollerance stop
SL = high-low
TP = high[1]-high
EndIf
Type = 2122
EndIf
If onmarket = 0 and Type312 = 1 Then
If OutsideBar[1] and Up[1] and InsideBar and LongOnly = 0 Then
Sellshort possize contract at low-OrderTollerance stop
SL = high-low
TP = low-low[1]
ElsIf OutsideBar[1] and Down[1] and InsideBar and ShortOnly = 0 Then
Buy possize contract at high+OrderTollerance stop
SL = high-low
TP = high[1]-high
EndIf
Type = 312
EndIf
If onmarket = 0 and Type322 = 1 Then
If OutsideBar[1] and Up[1] and TwoDown and Up and ShortOnly = 0 Then
Buy possize contract at high+OrderTollerance stop
SL = high-low
TP = high[1]-high
ElsIf OutsideBar[1] and Down[1] and TwoUp and Down and LongOnly = 0 Then
Sellshort possize contract at low-OrderTollerance stop
SL = high-low
TP = low-low[1]
EndIf
Type = 322
EndIf
If onmarket = 0 and Type122 = 1 Then
If InsideBar[1] and TwoUp and Up and LongOnly = 0 Then
Sellshort possize contract at low-OrderTollerance stop
SL = high-low
TP = low-low[2]
ElsIf InsideBar[1] and TwoDown and Down and ShortOnly = 0 Then
Buy possize contract at high+OrderTollerance stop
SL = high-low
TP = high[2]-high
EndIf
Type = 122
EndIf
If onmarket = 0 and Type22 = 1 Then
If InsideBar[1] = 0 and TwoUp and Up and LongOnly = 0 Then
Sellshort possize contract at low-OrderTollerance stop
SL = high-low
TP = low-low[1]
ElsIf InsideBar[1] = 0 and TwoDown and Down and ShortOnly = 0 Then
Buy possize contract at high+OrderTollerance stop
SL = high-low
TP = high[1]-high
EndIf
Type = 22
EndIf
Graph Type as "Type"
Set Stop loss SL+SLBuffer
Set Target profit TP+TPBuffer
You must be logged in to post a comment.
Thanks @Juanj. Love this! It's really does not take much to make this into a winning strategy. Backtested with 10k on multiple 15min and 30min charts and it's returns good results (the most volatile stocks return the best results) - Add Full Time Frame Continuity Parameter - Add increased Volume parameter - Tweak the Target/Stop Loss parameters to suit your personal risk level Thanks again, appreciate you sharing your work :)
Hi @aaronparry1 .. i kind of got lost in multi time frame continuity .. tried a lot (Rob s too fast for me to comprehend him :) ).. can you help & share your work.. you can hide the IP or any special edge if you want.. i want to learn the concept..
This script does not include timeframe continuity it simply tests for the best signals. I am just saying that if you plan on using this in a strategy it should be implemented. When used on it's own a higher timeframe (4H+) would obviously give more reliable signals. But when used in a strategy it can be utilized on a lower timeframe in conjunction with multi timeframe continuity
Hi juanj. Can you type variable optimization code with same value?
Hi How are you ensuring full time frame continuity in this script? i tried it on same instrument & few others.. my pro back test results were poor. please help.
In your code I see If onmarket = 0 and Type22 = 1 and hora1 and hora2 Then If InsideBar[1] = 0 and TwoUp and Up and LongOnly = 0 Then Sellshort possize contract at low-OrderTollerance stop SL = high-low TP = low-low[1] ElsIf InsideBar[1] = 0 and TwoDown and Down and ShortOnly = 0 Then Buy possize contract at high+OrderTollerance stop SL = high-low TP = high[1]-high EndIf Type = 22 EndIf Is the condition to go long not for the shortposition and visa versa??
How do we apply this to a strategy we have made, Thanks