[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing to a file from an ela



PureBytes Links

Trading Reference Links

I thought I had a terrific idea for creating a "poor mans"
portfolio analyizer.  BUT, fate stepped in the way.  Here's
the problem I am trying to solve....

I created a workspace with 12 different commodity charts.
I wrote one system, and applied it to all of these charts.  Of
course, if I want to optimize a parameter to see its impact,
I have to do this separately on each chart, and tally up the
results manually.

Another way is to change the parameters by hard-coding
them in EasyLanguage, re-verify the system, and let it run in 
all 12 charts.   Of course, this isn't an optimization, but it 
does allow me to see the effect of a change of input (or of 
logic) across all of the commodities I am testing.  The problem 
again is that I need to add up the results manually to see if 
the change represents an improvement.

My bright idea was to have the system write its results to a
file upon completion of the final bar, with a statement like: 

  If LastBarOnChart then Print(File("c:\directory\filenam.xls"),
     @NetProfit, @NumWinTrades, @TotalTrades);

If this could create a file with multiple rows, one for each
commodity analyized, I could import it into Excel, and simply
add the columns to get a total Net and % winners (of course,
I could write other stuff, and get other statistics as well).

The problem is that TradeStation overwrites the file each
time the system runs on the next chart.  It doesn't keep 
adding rows - as it does when a system/indicator writes to 
the print log.  So, I was left with a file that just had one row
- which just contained data for the last chart run.

Does anyone know a way around this (yea, I know - buy
Portfolio Analyizer)  For example, is there a way I can
write a "new line" command, so when the file is re-opened
the next time around, the system/indicator  will begin to
write at record number N + 1 ?

thanks

Jay Mackro