Here is some code I have been working on. I will go into detail on the code a little later. But this is how you monitor re-entering at a better price after taking a profit. The problem with taking profits on longer term trend following systems is that the logic that got you into the position is probably still true and you will notice your algorithm will re-enter in the same direction. So you need to inform your algorithm not to re-enter until a certain condition is met. In this example, I only re-enter at a better price if the condition that got me into the trade is still valid.
if not(longProfTaken) and mp <> 1 then Buy("BreakOut-B") next bar at highest(h[1],20) on a stop; if not(shortProfTaken) and mp <>-1 then SellShort("BreakOut-S") next bar at lowest(l[1],20) on a stop;
//If mp[0] = 0 and mp[1] = 1 then print(date," ",exitPrice(1)," ",entryPrice(1));
If longProfTaken then Begin If c < exitPrice(1) - getBackInAfterProfAmt$/bigPointValue then begin longProfTaken = false; If mp <> -1 then buy("longRe-Entry") next bar at open; end; end;
If shortProfTaken then Begin If c > exitPrice(1) + getBackInAfterProfAmt$/bigPointValue then begin shortProfTaken = false; If mp <>-1 then sellShort("shortRe-Entry") next bar at open; end; end;
If mp = 1 and c > entryPrice + profitAmt$/bigPointValue then begin sell this bar on close; longProfTaken = true; end;
If mp =-1 and c < entryPrice - profitAmt$/bigPointValue then begin buyToCover this bar on close; shortProfTaken = true; end;
If mp = -1 then longProfTaken = false; If mp = 1 then shortProfTaken = false;
//if mp = 1 then setStopLoss(stopAmt$); //if mp = 1 then setProfitTarget(profitAmt$);
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.