SA
Array RSI
31 Jul 2020, 05:07
Please, how can I use an indicator array for a bot. For example, an array with several RSI contained. I am trying and not succeeding, if anyone can help I will be grateful
firemyst
03 Aug 2020, 06:35
RE:
samuel.jus.cornelio said:
Here's a very simple example using MovingAverages instead:
//class declaration MovingAverage[] _maArray; //In OnStart (cBot) or Initialize (indicator) if (_maArray != null) { //Clear out old data everytime we start so GC can collect Array.Clear(_maArray, 0, _maArray.Length); _maArray = null; } _maArray = new MovingAverage[theNumberOfMAObjectsYouWantToHave]; for (int x=0; x < _maArray.Length; x++) { _maArray[x] = Indicators.MovingAverage(Bars.ClosePrices, thePeriodToUse, theMATypeToUse); }
@firemyst