Using a custom indicator within a bot but calculate values for a lower timeframe
03 Mar 2023, 15:10
I have created a custom indicator and it works perfectly on the live chart and calculates the values correctly for the current timeframe that I am viewing the indicator on. What I want to do now is use it within my bot but calculate the values for a lower timeframe. So I am using my bot on the hourly timeframe but I want to get the values of my indicator from the 5 minute timeframe.
I have implemented the indicator into my bot but it only seems to calculate the values every hour instead of every 5 minutes?
I am initialising my indicator in my bot in the onstart method via:
_highsAndLows = Indicators.GetIndicator<AP_HighsAndLows>(TimeFrame.Minute5);
Then within my ontick method I am getting the values like so:
double latestLow = _highsAndLows.Lows.LastValue;
double latestHigh = _highsAndLows.Highs.LastValue;
But these values only seem to update every hour and not every 5 minutes.
I am thinking (but could be incorrect) I need to call the calculate method of my indicator but I am not sure how?
Any help would be appreciated.