I have this little test"script" with COBC=true; in an ES-chart
protected override void OnBarUpdate()
{
if(Historical) return;
{
if (SMA(20)[0] > SMA(40)[0]
&& Close[0]>Open[0])
{
EnterLong(DefaultQuantity, "");
}
}
}
When enabling the script all is OK and "waiting" untill condition is true.
But when I do in Initialize Add("^VIX", PeriodType.Range,2);
(there is no condition with VIX yet, its only to test when adding it)
then there is an entry immediately when script is enabled (even when condition is not true). Sounds not logically? I agree, and cant find the reason for this behavior.
Thank you
Tony
Comment