A reader of this blog wanted a conversion from my Ratchet Trailing Stop indicator into a Strategy. You will notice a very close similarity with the indicator code as the code for this strategy. This is a simple N-Bar [Hi/Lo] break out with inputs for the RatchetAmt and TrailAmt. Remember RatchetAmt is how far the market must move in your favor before the stop is pulldown the TrailAmt. So if the RatchetAmt is 12 and the TrailAmt is 6, the market would need to move 12 handles in your favor and the Trail Stop would move to break even. If it moves another 12 handles then the stop would be moved up/down by 6 handles. Let me know if you have any questions – this system is similar to the one I just posted.
If d <> d[1] then Begin longMult = 0; shortMult = 0; myBarCount = 0; mp = 0; lep = 0; sep = 0; buysToday = 0; shortsToday = 0; end;
myBarCount = myBarCount + 1;
If myBarCount = 6 then // six 5 min bars = 30 minutes Begin stb = highD(0); //get the high of the day sts = lowD(0); //get low of the day end;
If myBarCount >=6 and t < calcTime(sess1Endtime,-3*barInterval) then Begin if buysToday = 0 then buy("NBar-Range-B") next bar stb stop; if shortsToday = 0 then sellShort("NBar-Range-S") next bar sts stop; end;
mp = marketPosition; If mp = 1 then begin lep = entryPrice; buysToday = 1; end; If mp =-1 then begin sep = entryPrice; shortsToday = 1; end;
// Okay initially you want a X point stop and then pull the stop up // or down once price exceeds a multiple of Y points // longMult keeps track of the number of Y point multipes of profit // always key off of lep(LONG ENTRY POINT) // notice how I used + 1 to determine profit // and - 1 to determine stop level
If mp = 1 then Begin If h >= lep + (longMult + 1) * ratchetAmt then longMult = longMult + 1; Sell("LongTrail") next bar at (lep + (longMult - 1) * trailAmt) stop; end;
If mp = -1 then Begin If l <= sep - (shortMult + 1) * ratchetAmt then shortMult = shortMult + 1; buyToCover("ShortTrail") next bar (sep - (shortMult - 1) * trailAmt) stop; end;
setExitOnClose;
I Used my Ratchet Indicator for the Basis of this Strategy
Backtesting with [Trade Station,Python,AmiBroker, Excel]. Intended for informational and educational purposes only!
Take Advantage of George's Black Friday Special until Christmas
George Pruitt’s Easing into EasyLangauge – Academy
A video-based approach to teaching EasyLanguage. Learn at your own pace.
Module #1
and Pattern Smasher 2024 too!
From the creator of the bestselling Easing into EasyLanguage series comes his latest project – Easing into EasyLanguage Academy. In this introductory course, George shows you to program a George Taylor Technique into a day trading system. You will start with a blank slate and learn everything you need to take advantage of Taylor’s Buy and Short – day techniques. Give the gift the keeps on giving – knowledge.
Can You Program This Trading Strategy?
Imagine this: On a buy day, you want to:
Enter: Place a buy order for tomorrow if the market:
Trades a certain amount below today’s low, and
Then travels back up to today’s low.
Protect: Use a protective stop at tomorrow’s low (before the buy stop is triggered).
Risk Manage: If the entry and exit levels are too large, limit your risk to a predefined amount.
Profit Secure: When a specific profit level is reached, implement a ratcheting trailing stop to lock in a percentage of the maximum open trade equity.
Time Manage: If still in the trade at a specific time of day, exit the position.
PURCHASE NOW AND GET PATTERN SMASHER 2024 FOR FREE!
Learn how to do this and then pick intelligent and robust paremeter sets.s
Get the Pattern Smasher Cheat Code to create this strategy. This is a 4 Pattern relationship based on the last three day’s closing relationships. You can learn more at George’s Digital Store.