- Home
- Forum
- cBots API Help
- Error in MarketSeriesHigh
Error in MarketSeriesHigh
Error in MarketSeriesHigh
Hi
When i try to get the high value of the MarketSeries it returns the close value instead.
This is happening both when i use MarketSeries.High.LastValue and MarketSeries.High[MarketSeries.High.Count()-1]
Could this be fixed or at least could you tell me another way to access the high that works.
Mu servertime is GMT +2
Regards,
Zenner
I have found out:
The High in the Robot is MarketSeries.High[MarketSeries.High.Count()-2] to get the last value but the MarketSeries.High.LastValue does not give you the last value then but the current.
This works like it should in the indicators but not in the Robots.
Use the 1period SMA, set the source to High.
Hello,
MarketSeries.High.LastValue is the same as MarketSeries.High[MarketSeries.High.Count-1].
It referes to the last bar high price. The last bar keeps changing until it becomes the previous to the last bar. Therefore the last value of the high, the low, and the close will keep changing.
Now, it might happen that the close will equal the high if the price is rising.
Hi
Thanks for the answers.
So am I correct when I state that:
Ex. MarketSeries.High.LastValue is referring to High of the current bar which is forming where only the Open is static
So MarketSeries.High[MArketSeries.High.Count-2] is referring to the last finished bar