I read on the Help Guide that if I want to reference to the close one bar ago I must write Close[1].
I made a simple Indicator where I print on the output window the last close or the close one bar ago.This is the last portion of my code:
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Print(Close[0].ToString());
}
With the code above I regularly see the last close on the output window.
If, I write the code below instead I don't see anything on the output window:
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Print(Close[1].ToString());
}
Am I missing something?
Thanks for any help.
Comment