PDA

View Full Version : Plot0 Value on FirstTickOfBar


palinuro
10-30-2009, 07:43 AM
On FirstTickOfBar Plot0[0] is reset to Close[0], regardless of prior value. It continues to Plot correctly.

protected override void OnBarUpdate()
{

if(FirstTickOfBar)
{
Print("plot0 value = " + Plot0[0].ToString());
Print("delta value = " + delta.ToString());

}
//Print("plot0 value intrabar = " + Plot0[0].ToString());
delta = 5;

Plot0.Set(delta);
}

NinjaTrader_Josh
10-30-2009, 07:49 AM
palinuro,

When no values are set yet it takes on a default value for place holding purposes which is the Close[0].

palinuro
10-30-2009, 08:34 PM
palinuro,

When no values are set yet it takes on a default value for place holding purposes which is the Close[0].

That seems odd behavior. Values have been set for the previous bars, and I would have expected it to default to the previous bar's value until it changes.

But I can work around it.

aslane
10-31-2009, 06:01 AM
Interesting. I would have thought you used some interesting value to determine the status of DataSeries.ContainsValue().