I am trying to build a multi-time frame strategy (weekly/daily) that will print daily values into a txt file.
I have my strategy programmed and have added the streamwriter code. If I use only one time frame, it will print the daily values (even if am running the strategy on weekly) AND the weekly prints (so there are double prints for Fridays).
How can I change the code in the streamwriter to only print the daily values. I am receiving this error message
{
// If file at 'path' doesn't exist it will create the file. If it does exist it will append the file.
if (CurrentBar == 0 && BarsInProgress == 1)
sw = File.AppendText(path);
// This is the output of all lines.
sw.WriteLine(Time + ";" + Instrument.FullName + ";Exp;" );
}
I have researched the forum but could not find an answer. How would I call the streamwriter on the daily update bar (=bars in Progress ==1) (weekly is BarsInProgress==0).
Thank you for your help
wtmnn

Comment