How to calculate de Annual Open?

Created at 26 Nov 2015, 21:31
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
mDull's avatar

mDull

Joined 17.09.2013

How to calculate de Annual Open?
26 Nov 2015, 21:31


Hi,

I want to calculate the Annual Open and I use this code to draw the brown line:

            var _marketdata = MarketData.GetSeries(TimeFrame);
            int _currentyear = _marketdata.OpenTime[index].Year;
            int _previousyear = _marketdata.OpenTime[index - 1].Year;
            double _openyear;

            if (_currentyear != _previousyear)
                _openyear = _marketdata.Open.LastValue;

But I've inconsistent values, because the data is not charged. See this example in the DAX:

 

Is there any way to charge all the annual data? Or any best way to calculate the annual open?

Thanks and regards

 

 

 


@mDull
Replies

breakermind
27 Nov 2015, 12:37

http://ctdn.com/forum/cbot-support/6963

/forum/cbot-support/6963


@breakermind