In writing the Hi-Res edition of Easing Into EasyLanguage I should have included this sample program. I do point out the limitations of the EntryPrice keyword/function in the book. But recently I was tasked to create a pyramiding scheme template that used minute bars and would initiate a position with N Shares and then pyramid up to three times by adding on N Shares at the last entry price + one 10 -Day ATR measure as the market moves in favor of the original position. Here is an example of just such a trade.
Pyramid 3 Times After Initial Trade Entry. Where’s the EntryPrice?
EntryPrice only contains the original entry price. So every time you add on a position, the EntryPrice doesn’t reflect this add on price. I would like to be able to index into this keyword/function and extract any EntryPrice. If you enter at the market, then you can keep track of entry prices because a market order is usually issued from an if-then construct:
//Here I can keep track of entry prices because I know //exactly when and where they occur.
if c > c[1] and value1 > value2 then begin buy("MarketOrder") next bar at market; lastEntryPrice = open of next bar; end;
Last Entry Price tracking is easy if using Market Orders
But what if you are using a stop or limit order. You don’t know ahead of time where one of these types of orders will hit up. It could be the next bar or it could be five bars later or who knows.
AvgEntryPrice Makes Up for the Weakness of EntryPrice
AvgEntryPrice is a keyword/function that returns the average of the entries when pyramiding. Assume you buy at 42.00 and pyramid the same number of shares at 46.50 – AvgEntryPrice will be equal to (42.00 + 46.50) / 2 = 44.25. With this information you can determine the two entry prices. You already know the original price. Take a look at this code.
// remember currentShares and avgEntryPrice ARE EasyLanguage Keywords/Functions if mp[1] = mp and mp = -1 and currentShares > curShares then begin totShorts = totShorts + 1; if currentShares > initShares then begin lastEntryPrice = totShorts * avgEntryPrice - entryPriceSums; entryPriceSums = entryPriceSums + lastEntryPrice; print(d," Short addon ",lastEntryPrice," ",totShorts," ",avgEntryPrice," ",entryPriceSums); end; end;
Calculating the true LastEntryPrice
Remember currentShares is a keyword/function and it is immediately updated when more shares are added or taken off. CurShares is my own variable where I keep track of the prior currentShares , so if currentShares (real number of shares) is greater than the prior curShares (currentShares) then I know 100%, a position has been pyramided as long the the mp stays the same. If currentShares increases and mp stays constant, then you can figure out the last entry price where the pyramid takes place. First you tick totShorts up by 1. If currentShares > initShares, then you know you are pyramiding so
Don’t believe me. Let’s test it. Remember original entry was 42.00 and the add on was at 46.50. TotShorts now equals 2.
Initial entryPrice = 42.00 so entryPriceSums is set to 42.00
After pyramiding avgEntryPrice is set to 44.25
lastEntryPrice = 2 * 44.25 – 42.00 = 46.50
entryPriceSums is then set to 42.00 + 46.50 or 88.50
So every time you add on a position, then you flow through this logic and you can keep track of the actual last entry price even if it is via a limit or stop order.
But wait there is more. This post is also a small glimpse into what I will be writing about in the Easing Into EasyLanguage: Advanced Topics. This system definitely falls into what I discussed in the Hi-Res Edition. Here is where we tip over into Advanced Topics. The next book is not about creating dialogs or trading apps using OOEL (object oriented EasyLanguage), but we do use some of those topics to do some rather complicated back testing things.
Now that we know how to calculate the lastEntryPrice wouldn’t it be really cool if we could keep track of all of the entryPrices during the pyramid stream. If I have pyramided four times, I would like to know entryPrice 1, entryPrice 2, entryPrice 3 and entryPrice 4.
EntryPrice Vector
Dr. VectorLove or How I Learned to Stop Worrying and Love Objects
I have discussed vectors before but I really wanted to discuss them more. Remember Vectors are just lists or arrays that don’t need all the maintenance. Yes you have to create them which can be a pain, but once you learn and forget it twenty times it starts to sink in. Or just keep referring back to this web page.
Using elsystem.collections;
vars: Vector entryPriceVector(Null);
once Begin entryPriceVector = new Vector; end;
The Bare Minimum to Instantiate a Vector
Type – “Using elsystem.collections; “
Declare entryPriceVector as a Vector and set it equal to Null
Use Once and instantiate entryPriceVector by using the keyword new < object type>;
A Vector is part of elsystem’s collection objects. Take a look at this updated code,
if mp[1] = mp and mp = -1 and currentShares > curShares then begin totShorts = totShorts + 1; if currentShares > initShares then begin lastEntryPrice = totShorts * avgEntryPrice - entryPriceSums; entryPriceVector.push_back(lastEntryPrice); entryPriceSums = entryPriceSums + lastEntryPrice; print(d," Short addon ",lastEntryPrice," ",entryPrice," ",entryPrice(1)," ",totShorts," ",avgEntryPrice," ",entryPriceSums," ",entryPriceVector.back() astype double," ",entryPriceVector.count asType int); if not(entryPriceVector.empty()) then begin for m = 0 to entryPriceVector.count-1 begin print(entryPriceVector.at(m) astype double); end; end; end; end;
LastEntryPrice and Pushing It onto the Vector and Then Printing Out the Vector
After the lastEntryPrice is calculated it is pushed onto the entryPriceVector using the function (method same thing but it is attached to the Vector class).push_back(lastEntryPrice);
entryPriceVector.push_back(lastEntryPrice);
So every time a new lastEntryPrice is calculated it is pushed onto the Vector at the back end. Now if the entryPriceVector is not empty then we can print its contents by looping and indexing into the Vector.
if not(entryPriceVector.empty()) then begin for m = 0 to entryPriceVector.count-1 begin print(entryPriceVector.at(m) astype double); end; end;
Looping through a Vector and Printing Out its Contents
Remember if you NOT a boolean value then it turns it to off/on or just the opposite of the boolean value. If entryPriceVector is not empty then proceed. entryPriceVector.count holds the number of values stuffed into the vector. You can index into the Vector by using .at(m), If you want to print out the value of the Vector .at(m), then you will need to typecast the Vector object as what ever it is holding. We know we are pushing numbers with decimals (double type) onto the Vector so we know we can evaluate them as a double type. Just remember you have to do this when printing out the values of the Vector.
Okay you can see where we moved into an Advanced Topics area with this code. But it really becomes useful when trying to overcome some limitations of EasyLanguage. Remember keep an eye open for Advanced Topics sometime in the Spring.
This is my second book in the Easing Into EasyLanguage [EZNGN2EZLANG] series of books. Here are the table of contents.
Contents
Introduction
About Website Computer Code and Fonts In Print Version
Using EasyLanguage to Program on Minute Intervals?
Tutorial 14 – Why Do I Need to Use Intraday Data
Tutorial 15 – An Algorithm Template that Uses Minute Bars to Trade a Daily Bar Scheme
Tutorial 16 – Using Data2 as a Daily Bar
Tutorial 17 – Let’s Day Trade!
Tutorial 18 – Moving From Discrete Day-Trade Strategy to a Framework
Tutorial 19 – Day-Trading Continued: Volatility Based Open Range Break Out with Pattern Recognition
Tutorial 20 – Pyramiding with Camarilla
Tutorial 21 – Programming a Scale Out Scheme
Tutorial 22- Crawling Like A Bug on a Five Minute Chart
Tutorial 23 – Templates For Further Research
Appendix A-Source Code
Appendix B-Links to Video Instruction
I have included five hours of video instruction which is included via links in the book and in the supplemental resource download.
What’s In This Book
If you are not a Trend Follower, then in most cases, you will not be able to properly or accurately code and backtest your trading algorithm without the use of higher resolution data (minute bars). A very large portion of the consulting I have done over the years has dealt with converting a daily bar system to one that uses intraday data such as a 5-minute bar. Coding a daily bar system is much more simple than taking the same concept and adding it to a higher resolution (Hi-Res) chart. If you use a 100 day moving average and you apply it to a 5-minute chart you get a 100 five minute bar moving average – a big difference.
Why Do I Need To Use Hi-Res Data?
If all you need to do is calculate a single entry or exit on a daily basis and can manually execute the trades, then you can stick with daily bars. Many of the famous Trend-Following systems such as Turtle, Aberration, Aberration Plus, Andromeda, and many others fall into this category. Most CTAs use these types of systems and spend most of their efforts on accurate execution and portfolio management. These systems, until the genesis of the COVID pandemic, have struggled for many years. Some of the biggest and brightest futures fund managers had to shut their doors due to their lagging performance and elevated levels of risk in comparison to the stock market. However, if you need to know the ebb and flow of the intraday market movement to determine accurate trade entry, then intraday data is an absolute necessity. Also, if you want to automate, Hi-Res data will help too! Here is an example of a strategy that would need to know what occurs first in chronological order.
Example of a Simple Algorithm that Needs Intraday Data
If the market closes above the prior day’s close, then buy the open of the next day plus 20% of today’s range andsellShort the open of the next day minus 40% of today’s range. Use a protective stop of $500 and a profit objective of $750. If the market closes below the prior day’s close then sellShort the open of the next day minus 20% of today’s range andbuy the open of the next day plus 40% of todays range. The same trade management of profit and loss is applied as well. From the low resolution of a daily bar the computer cannot determine if the market moves up 20% or down 40% first. So the computer cannot accurately determine if a long or short is established first. And to add insult to injury, if the computer could determine the initial position accurately from a daily bar, it still couldn’t determine if the position is liquidated via a profit or a loss if both conditions could have occurred.
What About “Look Inside Bar”?
There is evidence that if the bar closes near the high and the open near the low of a daily bar, then there is a higher probability that the low was made first. And the opposite is true as well. If the market opens near the middle of the bar, then all bets are off. When real money is in play you can’t count on this type of probability or the lack thereof . TradeStation allows you to use your daily bar scheme and then Look Inside Bar to see the overall ebb and flow of the intraday movement. This function allows you to drill down to one minute bars, if you like. This helps a lot, but it still doesn’t allow you to make intraday decisions, because you are making trading decisions from the close of the prior day.
if c > c[1] then begin buy next day at open of next day + 0.2 * range stop; sellShort next day at open of next day - 0.4 * range stop; end;
setProfitTarget(750); setStopLoss(500);
Next Day Order Placement
Using setProfitTarget and setStopLoss helps increase testing accuracy, but shouldn’t you really test on a 5-minute bar just to be on the safe side.
DayTrading in Most Cases Needs Hi-Res Data
If I say buy tomorrow at open of next day and use a setStopLoss(500), then I don’t need Hi-Res data. I execute the open which is the first time stamp in the chronological order of the day. Getting stopped out will happen later and any adverse move from the open that equates to $500 will liquidate the position or the position will be liquidated at the end of the day.
However, if I say buy the high of the first 30 minutes and use the low of the first 30 minutes as my stop loss and take profits if the position is profitable an hour later or at $750, then intraday data is absolute necessity. Most day trading systems need to react to what the market offers up and only slightly relies on longer term daily bar indicators.
If Intraday Data is So Important then Why ” The Foundation Edition?”
You must learn to crawl before you can walk. And many traders don’t care about the intraday action – all they care about is where the market closed and how much money should be allocated to a given trade or position. Or how an open position needs to be managed. The concepts and constructs of EasyLanguage must be learned first from a daily bar framework before a new EL programmer can understand how to use that knowledge on a five minute bar. You cannot just jump into a five minute bar framework and start programming accurately unless you are a programmer from the start or you have a sound Foundation in EasyLanguage.
Excerpt from Hi-Res Edition
From Tutorial 21 – Put 2 Units on, Take Profit on 1 Unit, Pull Stop to Break Even on 2nd Unit
Here is an example of a simple and very popular day trading scheme. Buy 2 units on a break out and take profits on 1 unit at X dollars. Pull stop on 2nd unit to breakeven to provide a free trade. Take profit on 2nd unit or get out at the end of the day.
Conceptually this is easy to see on the chart and to understand. But programming this is not so easy. The code and video for this algorithm is from Tutorial 21 in the Hi-Res edition.
Here are the results of the algorithm on a 5 minute ES.D chart going back five years. Remember these results are the result of data mining. Make sure you understand the limitations of back-testing. You can read those here.
No Execution Costs Included! Please read backtesting disclaimer.
There are a total of 10 Tutorials and over 5 hours of Video Instruction included. If you want to expand your programming capabilities to include intraday algorithm development, including day trading, then get your copy today.
How important is a day of week analysis? Many pundits would of course state that it is very important, especially when dealing with a day trading algorithm. Others would disagree. With the increase in market efficiency maybe this study is not as important as it once was, but it is another peformance metric that can be used with others.
I am currently working on the second book in the Easing into EasyLanguage trilogy (Hi-Res Edition) and I am including this in one of the tutorials on developing a day trading template. The book, like this post, will focus on intraday data such as 5 or less minute bars. I hope to have the book finalized in late November. If you haven’t purchased the Foundation Edition and like this presentation, I would suggest picking a copy up – especially if you are new to EasyLanguage. The code for this analysis is quite simple, but it is pretty cool and can be re-used.
Day Trading Algorithms Make Things Much More Simple
When you enter and exit on the same day and you don’t need to wrap around a 00:00 (midnight) time stamp, things such as this simple snippet of code are very easy to create. The EasyLanguage built-in functions work as you would expect as well. And obtaining the first bar of the day is ultra simple. The idea here is to have five variables, one for each day of the week, and accumulate the profit that is made on each day, and at the end of the run print out the results. Three things must be known on the first bar of the new trading day to accomplish this task:
were trades taken yesterday?
how much profit was made or lost?
what was yesterday – M, T, W, R, or F?
Two Reserved Words and One Function Are Used: Total Trades, NetProfit and the DayOfWeek function.
The reserved word TotalTrades keeps track of when a trade is closed out. The second reserved word, NetProfit keeps track of total profit everytime a trade is closed out. Along with the DayOfWeek(D[1]) function you can capture all the information you need for this analysis. Here is the code. I will show it first and then explain it afterwards.
if date <> date[1] then begin myBarCount = 0; buysToday = 0;sellsToday = 0; zatr = avgTrueRange(atrLen) of data2; if totalTrades > totTrades then begin Print(d," ",t," trade out ",dayOfWeek(d[1])," ",netProfit); switch(dayOfWeek(date[1])) begin Case 1: MProf = MProf + (netProfit - begDayEquity); Case 2: TProf = TProf + (netProfit - begDayEquity); Case 3: WProf = WProf + (netProfit - begDayEquity); Case 4: RProf = RProf + (netProfit - begDayEquity); Case 5: FProf = FProf + (netProfit - begDayEquity); Default: Value1 = Value1 + 1; end; begDayEquity = netProfit; totTrades = totalTrades; end; end;
Snippet To Handle DofW Analysis on DayTrading Algorithm
Code Explanation – Switch and Case
I have used the Switch – Case construct in some of my prior posts and I can’t emphasize enough how awesome it is, and how you can cut down on the use of if – thens. This snippet only takes place on the first bar of the trading day. Since we are using day sessions we can simply compare today’s date to the prior bar’s date, and if they are different then you know you are sitting on the first intraday bar of the day. After some initial housekeeping, the first if – then checks to see if trade(s) were closed out yesterday. If totalTrades is greater than my user defined totTrades, then something happened yesterday. My totTrades is updated to totalTrades after I am done with my calculations. The switch keys off of the DayOfWeek function. Remember you should account for every possible outcome of the variable inside the switch expression. In the case of the DayOfWeek function when know:
Monday
Tuesday
Wednesday
Thursday
Friday
Notice I am passing Date[1] into the function, because I want to know the day of the week of yesterday. After the Switch and its associated expression you have a Begin statement. Each outcome of the expression is preceded withthe keyword Case followed by a colon (:). Any code associated with each distinct result of the expression is sandwiched between Case keywords. So if the day of week of yesterday is 1 or Monday then MProf accumulates the change in the current NetProfit and the begDayEquity (beginning of the yesterday’s NetProfit) variable. So, if the equity at the beginning of yesterday was $10,000 and there was a closed out trade and the current NetProfit is $10,500 then $500 was made by the end of the day yesterday. This exact calculation is used for each day of the week and stored in the appropriate day of the week variable:
MProf – Monday
TProf – Tuesday
WProf – Wednesday
RProf – Thursday
FProf – Friday
You might ask why RProf for Thursday? Well, we have already used TProf for Tuesday and Thursday contains an “R”. This is just my way of doing it, but you will find this often in code dealing with days of the week. Every Switch should account for every possible outcome of the expression its keying off of. Many times you can’t always know ahead of time all the possible outcomes, so a Default case should be used as an exception. It is not necessary and it will not kick an error message if its not there. However, its just good programming to account for everything. Once the Switch is concluded begDayEquity and totTrades are updated for use the following day.
Here is the code that prints out the results of the DayOfWeek Analysis
if d = 1211027 and t = 1100 then begin print(d," DOW Analysis "); print("Monday : ",MProf); print("Tuesday : ",TProf); print("Wednesday : ",WProf); print("Thursday : ",RProf); print("Friday : ",FProf);
end;
Printing The Results of DofW Analysis
The printout occurs on October 27, 2021 at 11 AM. Here is my analysis of a day trading algorithm I am working on, tested over the last two years on 5 minute bars of the @ES.D
This System Will Be Published in the Hi-Res Edition of Easing into EasyLanguage Trilogy
Looks like it does. These results were derived from one of the Tutorials in The Hi-Res edition of EZ-NG-N2-EZ-LANG trilogy. I should have it availabe at Amazon some time in late November. Of course if you have any questions just email me @ george.p.pruitt@gmail.com.
Before the days of OOEL and more advanced data structures, such as vectors, you had to work with multidimensional arrays.
The problem with arrays is you have to do all the housekeeping whereas with vectors the housekeeping is handled internally. Yes, vectors in many cases would be the most efficient approach, but if you are already using Multi-D arrays, then mixing the two could become confusing. So stick with the arrays for now and progress into vectors at your leisure.
Recreate the CCI indicator with Multi-D Array
This exercise is for demonstration purposes only as the existing CCI function works just fine. However, when you are trying out something new or in this case an application of a different data structure (array) its always great to check your results against a known entity. If your program replicates the known entity, then you know that you are close to a solution. The CCI function accesses data via the globalHigh, Low and Close data streams and then applies a mathematical formula to derive a result. <
Derive Your Function First
Create the function first by prototyping what the function will need in the formal parameter list (funciton header). The first thing the function will need is the data – here is what it will look like.
OHLCArray[1,1] =1210903.00 // DATE
OHLCArray[1,2] = 4420.25 // OPEN
OHLCArray[1,3] = 4490.25 // HIGH
OHLCArray[1,4] = 4410.25 // LOW
OHLCArray[1,5] = 4480.75 // CLOSE
OHLCArray[2,1] =1210904.00 // DATE
OHLCArray[2,2] = 4470.25 // OPEN
OHLCArray[2,3] = 4490.25 // HIGH
OHLCArray[2,4] = 4420.25 // LOW
OHLCArray[2,5] = 4440.75 // CLOSE
Visualize 2-D Array as a Table
Column 1
Column 2
Column 3
Column 4
Column 5
1210903
44202.25
4490.25
4410.25
4480.75
1210904
4470.25
4490.25
4420.25
4440.76
The CCI function is only concerned with H, L, C and that data is in columns 3, 4, 5. If you know the structure of the array before you program the function, then you now which columns or fields you will need to access. If you don’t know the structure beforehand , then that information would need to be passed into the function as well. Let us assume we know the structure. Part of the housekeeping that I mentioned earlier was keeping track of the current row where the latest data is being stored. This “index” plus the length of the CCI indicator is the last two things we will need to know to do a proper calculation.
CCI_2D Function Formal Parameter List
// This function needs data, current data row, and length // Notice how I declare the OHLCArray using the dummy X and Y // Variable - this just tells TradeStation to expect 2-D array // ------------------ // | | // * * inputs: OHLCArray[x,y](numericArray), currentRow(numericSimple), length(numericSimple); // *** // ||| //---------------------------- // Also notice I tell TradeStation that the array is of type numeric // We are not changing the array but if we were, then the type would be // numericArrayRef - the actual location in memory not just a copy
CCI_2D Formal Parameter List
2-D Array Must Run Parallels with Actual Data
The rest of the function expects the data to be just like the H, L, C built-in data – so there cannot be gaps. This is very important when you pack the data and you will see this in the function driver code a.k.a an indicator. The data needs to align with the bars. Now if you are using large arrays this can slow things down a bit. You can also shuffle the array and keep the array size to a minimum and I will post how to do this in a post later this week. The CCI doesn’t care about the order of the H,L,C as long as the last N element is the latest values.
if AvgDev = 0 then CCI_2D = 0 else CCI_2D = ( value1 + value2 + value3 - Mean ) / ( .015 * AvgDev ) ;
CCI-2D Function
This function could be streamlined, but I wanted to show you how to access the different data values with the currentRow variable and columns 3, 4, and 5. I extract these data and store them in Values variables. Notice the highlighted line where I check to make sure there are enough rows to handle the calculation. If you try to access data before row #1, then you will get an out of bounds error and a halt to program execution.
Notice lines 16 and 17 where I am plotting both function results – my CCI_2D and CCI. Also notice how I increment numRows on each bar – this is the housekeeping that keeps that array synched with the chart. In the following graphic I use 14 for CCI_2D and 9 for the built-in CCI.
Two CCI functions with different Lengths
Now the following graphic uses the same length parameters for both functions. Why did just one line show up?
Both CCI Functions with same Lengths – were did second line go to?
Make Your Unique Coding Replicate a Known Entity – If You Can
Here is where your programming is graded. The replication of the CCI using a 2-D Array instead of the built-in H, L, C data streams, if programmed correctly, should create the exact same results and it does, hence the one line. Big Deal right! Why did I go through all this to do something that was already done? Great programming is not supposed to re-invent the wheel. And we just did exactly that. But read between the lines here. We validated code that packed a 2-D array with data and then passed it to a function that then accessed the data correctly and applied a known formula and compared it to a known entity. So now you have re-usable code for passing a 2-D array to a function. All you have to do is use the template and modify the calculations. Re-inventing the wheel is A-Okay if you are using it as a tool for validation.
Hello to All! I just published the first book in this series. It is the Foundation Edition and is designed for the new user of EasyLanguage or for those you would like to have a refresher course. There are 13 total tutorials ranging from creating Strategies to PaintBars. Learn how to create your own functions or apply stops and profit objectives. Ever wanted to know how to find an inside day that is also a Narrow Range 7 (NR7?) Now you can, and the best part is you get over 4 HOURS OF VIDEO INSTRUCTION – one for each tutorial. Each video is created by yours truly and Beau my trustworthy canine companion. I go over every line of code to really bring home the concepts that are laid out in each tutorial. All source code is available too, and if you have TradeStation, so are the workspaces. Plus you can always email George for any questions. george.p.pruitt@gmail.com.
The Cover of my latest book. The first in the series.
If you like the information on my blog, but find the programming code a little daunting, then go back and build a solid foundation with the Foundation Edition. It starts easy but moves up the Learning Curve at comfortable pace. On sale now for $24.95 at Amazon.com. I am planning on having two more advanced books in the series. The second book, specifically designed for intraday trading and day-trading, will be available this winter. And the third book, Advanced Topics, will be available next spring.
Pick up your copy today – e-Book or Paperback format!
Let me know if you buy either format and I will send you a PDF of the source code – just need proof of purchase. With the PDF you can copy and paste the code. After you buy the book come back here to the Easing Into EasyLanguage Page and download the ELD and workspaces.
Why Can’t I Just Test with Daily Bars and Use Look-Inside Bar?
Good question. You can’t because it doesn’t work accurately all of the time. I just default to using 5 minute or less bars whenever I need to. A large portion of short term, including day trade, systems need to know the intra day market movements to know which orders were filled accurately. It would be great if you could just flip a switch and convert a daily bar system to an intraday system and Look Inside Bar(LIB) is theoretically that switch. Here I will prove that switch doesn’t always work.
Daily Bar System
Buy next bar at open of the day plus 20% of the 5 day average range
SellShort next at open of the day minus 20% of the 5 day average range
If long take a profit at one 5 day average range above entryPrice
If short take a profit at one 5 day average range below entryPrice
If long get out at a loss at 1/2 a 5 day average range below entryPrice
If short get out at a loss at 1/2 a 5 day average range above entry price
Simplified Daily Bar DayTrade System using ES.D Daily
Daily Bar Using 5 min Look Inside Bar
Looks great with just the one hiccup: Bot @ 3846.75 and the Shorted @ 3834.75 and then took nearly 30 handles of profit.
Now let’s see what really happened.
What Really Happened – Bot – Shorted – Stopped Out
Intraday Code to Control Entry Time and Number of Longs and Shorts
Not an accurate representation so let’s take this really simple system and apply it to intraday data. Approaching this from a logical perspective with limited knowledge about TradeStation you might come up with this seemingly valid solution. Working on the long side first.
//First Attempt
if d <> d[1] then value1 = .2 * average(Range of data2,5); value2 = value1 * 5; if t > sess1startTime then buy next bar at opend(0) + value1 stop; setProfitTarget(value2*bigPointValue); setStopLoss(value2/2*bigPointValue); setExitOnClose;
First Simple Attempt
This looks very similar to the daily bar system. I cheated a little by using
if d <> d[1] then value1 = .2 * average(Range of data2,5);
Here I am only calculating the average once a day instead of on each 5 minute bar. Makes things quicker. Also I used
if t > sess1StartTime then buy next bar at openD(0) + value1 stop;
I did that because if you did this:
buy next bar at open of next bar + value1 stop;
You would get this:
Cannot Sneak a Peek with Data2
That should do it for the long side, right?
Didn’t work quite right!
So now we have to monitor when we can place a trade and monitor the number of long and short entries.
How does this look!
Correct Execution!
So here is the code. You will notice the added complexity. The important things to know is how to control when an entry is allowed and how to count the number of long and short entries. I use the built-in keyword/function totalTrades to keep track of entries/exits and marketPosition to keep track of the type of entry.
Take a look at the code and you can see how the daily bar system is somewhat embedded in the code. But remember you have to take into account that you are stepping through every 5 minute bar and things change from one bar to the next.
if d <> d[1] then begin curTotTrades = totalTrades; value1 = .2 * average(Range of data2,5); value2 = value1 * 5; buysToday = 0; shortsToday = 0; tradeZoneTime = False; end;
mp = marketPosition;
if totalTrades > curTotTrades then begin if mp <> mp[1] then begin if mp[1] = 1 then buysToday = buysToday + 1; if mp[1] = -1 then shortsToday = shortsToday + 1; end; if mp[1] = -1 then print(d," ",t," ",mp," ",mp[1]," ",shortsToday); curTotTrades = totalTrades; end; if t > sess1StartTime and t < sess1EndTime then tradeZoneTime = True;
if tradeZoneTime and buysToday = 0 and mp <> 1 then buy next bar at opend(0) + value1 stop;
if tradeZoneTime and shortsToday = 0 and mp <> -1 then sellShort next bar at opend(0) - value1 stop;
Proper Code to Replicate the Daily Bar System with Accuracy
Here’s a few trade examples to prove our code works.
Looks Right!
Okay the code worked but did the system?
Uh? NO!
Conclusion
If you need to know what occurred first – a high or a low in a move then you must use intraday data. If you want to have multiple entries then of course your only alternative is intraday data. This little bit of code can get you started converting your daily bar systems to intraday data and can be a framework to develop your own day trading/or swing systems.
Can I Prototype A Short Term System with Daily Data?
You can of course use Daily Bars for fast system prototyping. When the daily bar system was tested with LIB turned on, it came close to the same results as the more accurately programmed intraday system. So you can prototype to determine if a system has a chance. Our core concept buyt a break out, short a break out, take profits and losses and have no overnight exposure sounds good theoretically. And if you only allow 2 entries in opposite directions on a daily bar you can determine if there is something there.
A Dr. Jekyll and Mr. Hyde Scenario
While playing around with this I did some prototyping of a daily bar system and created this equity curve. I mistakenly did not allow any losses – only took profits and re-entered long.
In this post I simply wanted to convert the intraday ratcheting stop mechanism that I previously posted into a daily bar mechanism. Well that got me thinking of how many different values could be used as the amount to ratchet. I came up with three:
I have had requests for the EasyLanguage in an ELD – so here it is – just click on the link and unZip.
So this was going to be a great start to a post, because I was going to incorporate one of my favorite programming constructs : Switch-Case. After doing the program I thought wouldn’t it be really cool to be able to optimize over each scheme the ratchet and trail multiplier as well as the values that might go into each scheme.
In scheme one I wanted to optimize the N days for the ATR calculation. In scheme two I wanted to optimize the $ amount and the scheme three the percentage of a 20 day standard deviation. I could do a stepwise optimization and run three independent optimizations – one for each scheme. Why not just do one global optimization you might ask? You could but it would be a waste of computer time and then you would have to sift through the results. Huh? Why? Here is a typical optimization loop:
Scheme
Ratchet Mult
Trigger Mult
Parameter 1
1 : ATR
1
1
ATR (2)
2 : $ Amt
1
1
ATR (2)
3 : % of Dev. Amt
1
1
ATR (2)
1 : ATR
2
1
ATR (2)
2 : $ Amt
2
1
ATR (2)
Notice when we switch schemes the Parameter 1 doesn’t make sense. When we switch to $ Amt we want to use a $ Value as Parameter 1 and not ATR. So we could do a bunch of optimizations across non sensical values, but that wouldn’t really make a lot of sense. Why not do a conditional optimization? In other words, optimize only across a certain parameter range based on which scheme is currently being used. I knew there wasn’t an overlay available to use using standard EasyLanguage but I thought maybe OOP, and there is an optimization API that is quite powerful. The only problem is that it was very complicated and I don’t know if I could get it to work exactly the way I wanted.
EasyLanguage is almost a full blown programming language. So should I not be able to distill this conditional optimization down to something that I could do with such a powerful programming language? And the answer is yes and its not that complicated. Well at least for me it wasn’t but for beginners probably. But to become a successful programmer you have to step outside your comfort zones, so I am going to not only explain the Switch/Case construct (I have done this in earlier posts) but incorporate some array stuff.
When performing conditional optimization there are really just a few things you have to predefine:
Scheme Based Optimization Parameters
Exact Same Number of Iterations for each Scheme [starting point and increment value]
Complete Search Space
Total Number of Iterations
Staying inside the bounds of your Search Space
Here are the optimization range per scheme:
Scheme #1 – optimize number of days in ATR calculation – starting at 10 days and incrementing by 2 days
Scheme #2 – optimize $ amounts – starting at $250 and incrementing by $100
Scheme #3 – optimize percent of 20 Bar standard deviation – starting at 0,25 and incrementing by 0.25
I also wanted to optimize the ratchet and target multiplier. Here is the base code for the daily bar ratcheting system with three different schemes. Entries are based on penetration of 20 bar highest/lowest close.
if volBase then begin ratchetAmt = avgTrueRange(volCalcLen) * ratchetMult; trailAmt = avgTrueRange(volCalcLen) * trailMult; end; if dollarBase then begin ratchetAmt =dollarAmt/bigPointValue * ratchetMult; trailAmt = dollarAmt/bigPointValue * trailMult; end; if devBase then begin ratchetAmt = stddev(c,20) * devAmt * ratchetMult; trailAmt = stddev(c,20) * devAmt * trailMult; end;
if c crosses over highest(c[1],20) then buy next bar at open; if c crosses under lowest(c[1],20) then sellshort next bar at open;
mp = marketPosition; if mp <> 0 and mp[1] <> mp then begin longMult = 0; shortMult = 0; end;
If mp = 1 then lep = entryPrice; If mp =-1 then sep = entryPrice;
// 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 multiples 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;
Daily Bar Ratchet System
This code is fairly simple. The intriguing inputs are:
volBase[True of False] and volCalcLen [numeric Value]
dollarBase [True of False] and dollarAmt [numeric Value]
devBase [True of False] and devAmt [numeric Value]
If volBase is true then you use the parameters that go along with that scheme. The same goes for the other schemes. So when you run this you would turn one scheme on at a time and set the parameters accordingly. if I wanted to use dollarBase(True) then I would set the dollarAmt to a $ value. The ratcheting mechanism is the same as it was in the prior post so I refer you back to that one for further explanation.
So this was a pretty straightforward strategy. Let us plan out our optimization search space based on the different ranges for each scheme. Since each scheme uses a different calculation we can’t simply optimize across all of the different ranges – one is days, and the other two are dollars and percentages.
Enumerate
We know how to make TradeStation loop based on the range of a value. If you want to optimize from $250 to $1000 in steps of $250, you know this involves [$1000 – $250] / $250 + 1 or 3 + 1 or 4 interations. Four loops will cover this entire search space. Let’s examine the search space for each scheme:
ATR Scheme: start at 10 bars and end at 40 by steps of 2 or [40-10]/2 + 1 = 16
$ Amount Scheme: start at $250 and since we have to have 16 iterations [remember # of iterations have to be the same for each scheme] what can we do to use this information? Well if we start $250 and step by $100 we cover the search space $250, $350, $450, $550…$1,750. $250 + 15 x 250. 15 because $250 is iteration 1.
Percentage StdDev Scheme: start at 0.25 and end at 0.25 + 15 x 0.25 = 4
So we enumerate 16 iterations to a different value. The easiest way to do this is to create a map. I know this seems to be getting hairy but it really isn’t. The map will be defined as an array with 16 elements. The array will be filled with the search space based on which scheme is currently being tested. Take a look at this code where I show how to define an array of 16 elements and introduce my Switch/Case construct.
array: optVals[16](0);
switch(switchMode) begin case 1: startPoint = 10; // vol based increment = 2; case 2: startPoint = 250/bigPointValue; // $ based increment = 100/bigPointValue; case 3: startPoint = 0.25; //standard dev increment = 0.25*minMove/priceScale; default: startPoint = 1; increment = 1; end;
vars: cnt(0),loopCnt(0); once begin for cnt = 1 to 16 begin optVals[cnt] = startPoint + (cnt-1) * increment; end; end
Set Up Complete Search Space for all Three Schemes
This code creates a 16 element array, optVals, and assigns 0 to each element. SwitchMode goes from 1 to 3.
if switchMode is 1: ATR scheme [case: 1] the startPoint is set to 10 and increment is set to 2
if switchMode is 2: $ Amt scheme [case: 2] the startPoint is set to $250 and increment is set to $100
if switchMode is 3: Percentage of StdDev [case: 3] the startPoint is set to 0.25 and the increment is set to 0.25
Once these two values are set the following 15 values can be spawned by the these two. A for loop is great for populating our search space. Notice I wrap this code with ONCE – remember ONCE is only executed at the very beginning of each iteration or run.
once begin for cnt = 1 to 16 begin optVals[cnt] = startPoint + (cnt-1) * increment; end; end
Based on startPoint and increment the entire search space is filled out. Now all you have to do is extract this information stored in the array based on the iteration number.
if c crosses over highest(c[1],20) then buy next bar at open; if c crosses under lowest(c[1],20) then sellshort next bar at open;
mp = marketPosition; if mp <> 0 and mp[1] <> mp then begin longMult = 0; shortMult = 0; end;
If mp = 1 then lep = entryPrice; If mp =-1 then sep = entryPrice;
// 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 multiples 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;
Extract Search Space Values and Rest of Code
Switch(switchMode) Begin Case 1: ratchetAmt = avgTrueRange(optVals[optLoops])ratchetMult; trailAmt = avgTrueRange(optVals[optLoops]) trailMult; Case 2: ratchetAmt =optVals[optLoops] * ratchetMult; trailAmt = optVals[optLoops] * trailMult; Case 3: ratchetAmt =stddev(c,20)optVals[optLoops] ratchetMult; trailAmt = stddev(c,20) * optVals[optLoops] * trailMult;
Notice how the optVals are indexed by optLoops. So the only variable that is optimized is the optLoops and it spans 1 through 16. This is the power of enumerations – each number represents a different thing and this is how you can control which variables are optimized in terms of another optimized variable. Here is my optimization specifications:
Opimization space
And here are the results:
Optimization Results
The best combination was scheme 1 [N-day ATR Calculation] using a 2 Mult Ratchet and 1 Mult Trail Trigger. The best N-day was optVals[2] for this scheme. What in the world is this value? Well you will need to back engineer a little bit here. The starting point for this scheme was 10 and the increment was 2 so if optVals[1] =10 then optVals[2] = 12 or ATR(12). You can also print out a map of the search spaces.
vars: cnt(0),loopCnt(0); once begin loopCnt = loopCnt + 1; // print(switchMode," : ",d," ",startPoint); // print(" ",loopCnt:2:0," --------------------"); for cnt = 1 to 16 begin optVals[cnt] = startPoint + (cnt-1) * increment; // print(cnt," ",optVals[cnt]," ",cnt-1); end; end;
This was a elaborate post so please email me with questions. I wanted to demonstrate that we can accomplish very sophisticated things with just the pure and raw EasyLanguage which is a programming language itself.
What is Better: 30, 60, or 120 Minute Break-Out on ES.D
Here is a simple tutorial you can use as a foundation to build a potentially profitable day trading system. Here we wait N minutes after the open and then buy the high of the day or short the low of the day and apply a protective stop and profit objective. The time increment can be optimized to see what time frame is best to use. You can also optimize the stop loss and profit objective – this system gets out at the end of the day. This system can be applied to any .D data stream in TradeStation or Multicharts.
Logic Description
get open time
get close time
get N time increment
15 – first 15 minute of day
30 – first 30 minute of day
60 – first hour of day
get High and Low of day
place stop orders at high and low of day – no entries late in day
calculate buy and short entries – only allow one each*
apply stop loss
apply profit objective
get out at end of day if not exits have occurred
Optimization Results [From 15 to 120 by 5 minutes] on @ES.D 5 Minute Chart – Over Last Two Years
Optimization of Time: Look How the # Trades Decrease as the Time Increment Increases
Simple Orbo EasyLanguage
I threw this together rather quickly in a response to a reader’s question. Let me know if you see a bug or two. Remember once you gather your stops you must allow the order to be issued on every subsequent bar of the trading day. The trading day is defined to be the time between timeIncrement and endTradeMinB4Close. Notice how I used the EL function calcTime to calculate time using either a +positive or -negative input. I want to sample the high/low of the day at timeIncrement and want to trade up until endTradeMinB4Close time. I use the HighD and LowD functions to extract the high and low of the day up to that point. Since I am using a tight stop relative to today’s volatility you will see more than 1 buy or 1 short occurring. This happens when entry/exit occurs on the same bar and MP is not updated accordingly. Somewhere hidden in this tome of a blog you will see a solution for this. If you don’t want to search I will repost it tomorrow.
//Optimizing Time to determine a simple break out //Only works on .D data streams Inputs: timeIncrement(15),endTradeMinB4Close(-15),stopLoss$(500),profTarg$(1000);
If time = calcStopTime then begin buyStop = HighD(0); shortStop = LowD(0); buysToday = 0; shortsToday = 0; End;
if time >= calcStopTime and time < quitTradeTime then begin if buysToday = 0 then Buy next bar at buyStop stop; if shortsToday = 0 then Sell short next bar at shortStop stop; end;
mp = marketPosition;
If mp = 1 then buysToday = 1; If mp = -1 then shortsToday = 1;
I was recently testing the idea of a short term VBO strategy on the ES utilizing very tight stops. I wanted to see if using a tight ATR stop in concert with the entry day’s low (for buys) would cut down on losses after a break out. In other words, if the break out doesn’t go as anticipated get out and wait for the next signal. With the benefit of hindsight in writing this post, I certainly felt like my exit mechanism was what was going to make or break this system. In turns out that all pre conceived notions should be thrown out when volatility enters the picture.
System Description
If 14 ADX < 20 get ready to trade
Buy 1 ATR above the midPoint of the past 4 closing prices
Place an initial stop at 1 ATR and a Profit Objective of 1 ATR
Trail the stop up to the prior day’s low if it is greater than entryPrice – 1 ATR initially, and then trail if a higher low is established
Wait 3 bars to Re-Enter after going flat – Reversals allowed
That’s it. Basically wait for a trendless period and buy on the bulge and then get it out if it doesn’t materialize. I knew I could improve the system by optimizing the parameters but I felt I was in the ball park. My hypothesis was that the system would fail because of the tight stops. I felt the ADX trigger was OK and the BO level would get in on a short burst. Just from past experience I knew that using the prior day’s price extremes as a stop usually doesn’t fair that well.
Without commission the initial test was a loser: -$1K and -$20K draw down over the past ten years. I thought I would test my hypothesis by optimizing a majority of the parameters:
ADX Len
ADX Trigger Value
ATR Len
ATR BO multiplier
ATR Multiplier for Trade Risk
ATR Multiplier for Profit Objective
Number of bars to trail the stop – used lowest lows for longs
Results
As you can probably figure, I had to use the Genetic Optimizer to get the job done. Over a billion different permutations. In the end here is what the computer pushed out using the best set of parameters.
No Commission or Slippage – Genetic Optimized Parameter Selection
Optimization Report – The Best of the Best
Top Parameters – notice the Wide Stop Initially and the Trailing Stop Look-Back and also the Profit Multiplier – but what really sticks out is the ADX inputs
ADX – Does it Really Matter?
Take a look at the chart – the ADX is mostly in Trigger territory – does it really matter?
A Chart is Worth a 1000 Words
What does this chart tell us?
70% of Profit was made in last 40 trades
Was the parameter selection biased by the heightened level of volatility? The system has performed on the parameter set very well over the past two or three years. But should you use this parameter set going into the future – volatility will eventually settle down.
Now using my experience in trading I would have selected a different parameter set. Here are my biased results going into the initial programming. I would use a wider stop for sure, but I would have used the generic ADX values.
George’s More Common Sense Parameter Selection – wow big difference
I would have used 14 ADX Len with a 20 trigger and risk 1 to make 3 and use a wider trailing stop. With trend neutral break out algorithms, it seems you have to be in the game all of the time. The ADX was supposed to capture zones that predicated break out moves, but the ADX didn’t help out at all. Wider stops helped but it was the ADX values that really changed the complexion of the system. Also the number of bars to wait after going flat had a large impact as well. During low volatility you can be somewhat picky with trades but when volatility increases you gots to be in the game. – no ADX filtering and no delay in re-Entry. Surprise, surprise!
Alogorithm Code
Here is the code – some neat stuff here if you are just learning EL. Notice how I anchor some of the indicator based variables by indexing them by barsSinceEntry. Drop me a note if you see something wrong or want a little further explanation.
If mp <> 1 and adx(adxLen) < adxTrig and BSE > reEntryDelay and open of next bar < BBO then buy next bar at BBO stop; If mp <>-1 and adx(adxLen) < adxTrig AND BSE > reEntryDelay AND open of next bar > SBO then sellshort next bar at SBO stop;
If mp = 1 and mp[1] <> 1 then Begin trailLongStop = entryPrice - tradeRisk; end;
If mp = -1 and mp[1] <> -1 then Begin trailShortStop = entryPrice + tradeRisk; end;
if mp = 1 then sell("L-init-loss") next bar at entryPrice - tradeRisk[barsSinceEntry] stop; if mp = -1 then buyToCover("S-init-loss") next bar at entryPrice + tradeRisk[barsSinceEntry] stop;
if mp = 1 then begin sell("L-ATR-prof") next bar at entryPrice + tradeProf[barsSinceEntry] limit; trailLongStop = maxList(trailLongStop,lowest(l,posMovTrailNumBars)); sell("L-TL-Stop") next bar at trailLongStop stop; end; if mp =-1 then begin buyToCover("S-ATR-prof") next bar at entryPrice -tradeProf[barsSinceEntry] limit; trailShortStop = minList(trailShortStop,highest(h,posMovTrailNumBars)); // print(d, " Short and trailStop is : ",trailShortStop); buyToCover("S-TL-Stop") next bar at trailShortStop stop; end;
EasyLanguage Includes a Powerful String Manipulation Library
I thought I would share this function. I needed to convert a date string (not a number per se) like “20010115” or “2001/01/15” or “01/15/2001” or “2001-01-15” into a date that TradeStation would understand. The function had to be flexible enough to accept the four different formats listed above.
String Functions
Most programming languages have functions that operate strictly on strings and so does EasyLanguage. The most popular are:
Right String (rightStr) – returns N characters from the right side of the string.
Left String (leftStr) – returns N character starting from the left side of the string
Mid String (midStr) – returns the middle portion of a string starting at a specific place in the string and advance N characters
String Length (strLen) – returns the number of characters in the string
String To Number (strToNum) – converts the string to a numeric representation. If the string has a character, this function will return 0
In String (inStr) – returns location of a sub string inside a larger string ( a substring can be just one character long)
Unpack the String
If the format is YYYYMMDD format then all you need to do is remove the dashes or slashes (if there are any) and then convert what is left over to a number. But if the format is MM/DD/YYYY format then we are talking about a different animal. So how can you determine if the date string is in this format? First off you need to find out if the month/day/year separator is a slash or a dash. This is how you do this:
If either is a non zero then you know there is a separator. The next thing to do is locate the first “dash or slash” (the search character or string). If it is located within the first four characters of the date string then you know its not a four digit year. But, lets pretend the format is “12/14/2001” so if the first dash/slash is the 3rd character you can extract the month string by doing this:
So if firstSrchStrLoc = 3 then we want to leftStr the date string and extract the first two characters and store them in mnStr. We then store what’s left of the date string in tempStr by using rightStr:
Here I pass dateString and the strLength-firstSrchStrLoc – so if the dateString is 10 characters long and the firstSrchStrLoc is 3, then we can create a tempstring by taking [10 -3 = 7 ] characters from right side of the string:
“12/14/2001” becomes “14/2001” – once that is done we can pull the first two characters from the tempStr and store those into the dyStr [day string.] I do this by searching for the “/” and storing its location in srchStrLoc. Once I have that location I can use that information and leftStr to get the value I need. All that is left now is to use the srchStrLoc and the rightStr function.
Now convert the strings to numbers and multiply their values accordingly.
DateSTrToYYYMMDD = strToNum(yrStr) X 10000-19000000 + strToNum(mnStr) X 100 + strToNum(dyStr)
To get the date into TS format I have to subtract 19000000 from the year. Remember TS represents the date in YYYMMDD format.
Now what do you do if the date is in the right format but simply includes the dash or slash separators. All you need to do here is loop through the string and copy all non dash or slash characters to a new string and then convert to a number. Here is the loop:
tempStr = ""; iCnt = 1; While iCnt <= strLength Begin If midStr(dateString,iCnt,1) <> srchStr then tempStr += midStr(dateString,iCnt,1); iCnt+=1; end; tempDate = strToNum(tempStr); DateStrToYYYMMDD = tempDate-19000000;
Here I use midStr to step through each character in the string. MidStr requires a string and the starting point and how many characters you want returned from the string. Notice I step through the string with iCnt and only ask for 1 character at a time. If the character is not a dash or slash I concatenate tempStr with the non dash/slash character. At the end of the While loop I simply strToNum the string and subtract 19000000. That’s it! Remember EasyLanguage is basically a full blown programming language with a unique set of functions that relate directly to trading.
Backtesting with [Trade Station,Python,AmiBroker, Excel]. Intended for informational and educational purposes only!
Get All Five Books in the Easing Into EasyLanguage Series - NEW Kindle Pricing!
Announcement: Amazon has updated its pricing policy for Kindle authors, and I’ve updated the Kindle versions of the Easing into EasyLanguage series to match. Get your favorite quant the books they need! Build your knowledge and let AI enhance your work—your AI prompting and strategy architecture can only be improved by knowing the building blocks. The new price range is $9.99 to $12.99.
The Foundation Edition. The first in the series.
This series includes five editions that covers the full spectrum of the EasyLanguage programming language. Fully compliant with TradeStation and mostly compliant with MultiCharts. Start out with the Foundation Edition. It is designed for the new user of EasyLanguage or for those you would like to have a refresher course. There are 13 tutorials ranging from creating Strategies to PaintBars. Learn how to create your own functions or apply stops and profit objectives. Ever wanted to know how to find an inside day that is also a Narrow Range 7 (NR7?) Now you can, and the best part is you get over 4 HOURS OF VIDEO INSTRUCTION – one for each tutorial.
Hi-Res Edition Cover
This book is ideal for those who have completed the Foundation Edition or have some experience with EasyLanguage, especially if you’re ready to take your programming skills to the next level. The Hi-Res Edition is designed for programmers who want to build intraday trading systems, incorporating trade management techniques like profit targets and stop losses. This edition bridges the gap between daily and intraday bar programming, making it easier to handle challenges like tracking the sequence of high and low prices within the trading day. Plus, enjoy 5 hours of video instruction to guide you through each tutorial.
Advanced Topics Cover
The Advanced Topics Edition delves into essential programming concepts within EasyLanguage, offering a focused approach to complex topics. This book covers arrays and fixed-length buffers, including methods for element management, extraction, and sorting. Explore finite state machines using the switch-case construct, text graphic manipulation to retrieve precise X and Y coordinates, and gain insights into seasonality with the Ruggiero/Barna Universal Seasonal and Sheldon Knight Seasonal methods. Additionally, learn to build EasyLanguage projects, integrate fundamental data like Commitment of Traders, and create multi-timeframe indicators for comprehensive analysis.
Get Day Trading Edition Today!
The Day Trading Edition complements the other books in the series, diving into the popular approach of day trading, where overnight risk is avoided (though daytime risk still applies!). Programming on high-resolution data, such as five- or one-minute bars, can be challenging, and this book provides guidance without claiming to be a “Holy Grail.” It’s not for ultra-high-frequency trading but rather for those interested in techniques like volatility-based breakouts, pyramiding, scaling out, and zone-based trading. Ideal for readers of the Foundation and Hi-Res editions or those with EasyLanguage experience, this book offers insights into algorithms that shaped the day trading industry.
Trend Following Cover.
For thirty-one years as the Director of Research at Futures Truth Magazine, I had the privilege of collaborating with renowned experts in technical analysis, including Fitschen, Stuckey, Ruggiero, Fox, and Waite. I gained invaluable insights as I watched their trend-following methods reach impressive peaks, face sharp declines, and ultimately rebound. From late 2014 to early 2020, I witnessed a dramatic downturn across the trend-following industry. Iconic systems like Aberration, CatScan, Andromeda, and Super Turtle—once thriving on robust trends of the 1990s through early 2010s—began to falter long before the pandemic. Since 2020 we have seen the familiar trends return. Get six hours of video instruction with this edition.
Pick up your copies today – e-Book or paperback format – at Amazon.com