One metric that seems to be missing from TradeStation is a Day Of Week analysis. It would be nice, but I don’t know how helpful, to know the $P/L breakdown on a weekday basis; does your system make all of its money on Mondays and Fridays? I created the code that will print out to the print log using an EasyLanguage method. A method is a subroutine that can be included in the main code (strategy, indicator, etc.,.) The global parameters to the main program can be seen inside the method. You can localize variable scope to the method by declaring the variable within the method’s body. A method is a great way to modularize your programming, but it is not the best way to reuse software; the method is accessible only to the main program. This EasyLanguage also utilizes an array and shows a neat piece of code to access the array elements and align them with the day of the week. The dayOfWeek() function returns [1..5] depending on what day of the week the trading day falls on. Monday = 1 and Friday = 5. The array has five elements and each element accumulates the $P/L for each of the five days based on when the trade was initiated.
Here is an example of the print out created by running this simple EasyLanguage strategy. Maybe don’t trade on Monday? Or is that curve fitting. This is an interesting tool and might carry more weight if applied to day trade algorithm. Maybe!
- Monday -8612.50
- Tuesday 6350.00
- Wednesday 2612.50
- Thursday -937.50
- Friday -1987.50