However, once the strategy is clearly added to my chart, the next call to my Initialize() method still has erroneous data. The Instrument name comes back correctly, but the Bar Type and the Bar Value remain set to their default value (“Minute” and “1”). It is not until I click the Strategy button again and exit out that the values are then correct.
I am doing all of this in the Initialize() method. This behavior can be duplicated with this code:
[FONT=Calibri][SIZE=3]Print(Instrument.FullName.ToString());[/SIZE][/FONT] [FONT=Calibri][SIZE=3]Print(BarsPeriod.Id.ToString());[/SIZE][/FONT] [FONT=Calibri][SIZE=3]Print(BarsPeriod.Value.ToString());[/SIZE][/FONT]
I need to initialize variables based on how the chart is set up. Right now the only way I can do that is to remember to add the strategy to the chart then go back into the strategy selection dialog and exit out again. I’m assuming this is a bug, but maybe I am missing something?
Thanks,
-Scott
Comment