Here is the finalized tutorial on building the pyramiding ES-day-trade system that was presented in the last post.
I will admit this video should be half as long as the end result. I get a bit long-winded. However, I think there are some good pointers that should save you some time when programming a similar system.
EasyLanguage Source:
Here is the final code from the video:
vars: mp(0),lastTradePrice(0),canSell(true);
mp = marketPosition * currentContracts;
if date[0] <> date[1] then begin canSell = true; // canSell on every day end;
if mp = -1 then canSell = false; // one trade on - no more if time > 1430 then canSell = false; //no entries afte 230 central
if mp = 0 and canSell = true then sellShort next bar at OpenD(0) - 3 stop;
if mp = -1 then sellShort next bar at OpenD(0) - 6 stop; //add 1 if mp = -2 then sellShort next bar at OpenD(0) - 9 stop; //add 2
if mp = -1 then lastTradePrice = OpenD(0) - 3; //keep track of entryPrice if mp = -2 then lastTradePrice = OpenD(0) - 6; if mp = -3 then lastTradePrice = OpenD(0) - 9;
if mp <> 0 then buyToCover next bar at lastTradePrice + 3 stop; // 3 handle risk on last trade
// next line provides a threshold prior to engaging trailing stop if mp = -3 and barsSinceEntry > 0 and lowD(0) < lastTradePrice - 3 then buyToCover next bar at lowD(0) + 3 stop;
setExitOnClose;
EasyLanguage for Pyramiding and Day-Trading ES
What we learned here:
can’t use entriesToday(date) to determine last entry price
must use logic to not issue an order to execute on the first bar of the next day
mp = marketPosition * currentContracts is powerful stuff!
In the next few days, I will publish the long side version of this code and also a more eloquent approach to the programming that will allow for future modifications and flexibility.
Let me know how it works out for you.
Take this code and add some filters to prevent trading every day or a filter to only allow long entries!
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.