- The first part of the code only needs to be done once, on the very first bar on
the chart. Within that part of the code, we make sure that the first day to be
exported is 2,500 days prior to the last day of the chart. - This code also transforms the TradeStation data format to Excel date format.
- The first piece of code that needs to be repeated for every bar makes sure that
all data from all markets are synchronized and will fill in all missing days,
such as holidays, with yesterday’s data. It too transforms the TradeStation
data format to Excel date format. - The code now starts to look for position changes and alters the values of the
variables to be exported, depending on how the position changes from day
to day. - The final daily export starts with another transformation of TradeStation
dates to Excel dates.
342 PART 4 Money Management