ERROR: OCHL values the same value.
ERROR: OCHL values the same value.
31 Jan 2014, 01:38
Hi,
I was testing my robot on calgo and noticed that the OCHL values are the same value on each bar. Can you look into this please.
I created a new basic robot with just the print commands for Market series data to confirm and I got the same results. Also this error is happening on all Pairs.
Thank You for a great product, I am really enjoying using it.
Code Below:
protected override void OnBar()
{
// Put your core logic here
//getCandleStickPattern(0);
var close = MarketSeries.Close.LastValue;
var high = MarketSeries.High.LastValue;
var low = MarketSeries.Low.LastValue;
Print("Current close {0}, high {1}, low {2}", close, high, low);
}
Spotware
31 Jan 2014, 09:02
OnBar event happens when new bar is opened. At that moment MarketSeries collection already contains tick from new bar. It means that last bar is not formed and in general cases open = high = low = close. If you want to access to last formed bar you need take previous one.
You need to change your code:
@Spotware