I thought this would be exactly what I was looking for, but it does not seem to be working for me when testing in Market Replay. I have a Strategy using daily bars with COBC = true. When I try adding the code in the link, it still does not reload. I have tried with COBC = false, and that does not work either. I am using a multiple bars script, so I don't know if that matters. A couple questions:
1) Does this only work during RT data and not during Replay?
2) If it sends an F5 key command to reload, do you still then have to select YES in the window for it to actually reload? When I manually do it, a window pops up asking to verify you want to stop running and reload the script. I don't know if the SendKeys command automatically chooses yes for this so that it would be truly automated.
My code looks like this:
#region Variables
private bool boolAlreadyRefreshed = false;
protected override void OnBarUpdate ()
{
if(BarsInProgress != 0) return;
if (!this.boolAlreadyRefreshed && !Historical && FirstTickOfBar)
{
this.boolAlreadyRefreshed = true;
System.Windows.Forms.SendKeys.Send("{F5}");
}
Code XXX....
}
I know that NT does not support this (maybe NT 8?). But considering a multitude of other issues I am having, this seems like the simplest solution to achieve the goal of consistent results. Any insight or recommendations is appreciated, as well as suggestions on other options.
Thanks,
Lee
Comment