I am porting an indicator to NT8 that relies upon a range of OHLC data (5 min, 240 min, daily) and uses this data to incorporate into a machine learning algo.
What I have now:
public double GetDiff() { previous = (PriorDayOHLC().PriorOpen[0] + PriorDayOHLC().PriorHigh[0] + PriorDayOHLC().PriorLow[0] + PriorDayOHLC().PriorClose[0])/4; now = (CurrentDayOHL().CurrentOpen[0] + CurrentDayOHL().CurrentHigh[0] + CurrentDayOHL().CurrentLow[0] + PriorDayOHLC().PriorClose[0])/4; change = (now - previous); percentage = Math.Tanh(change / previous); return percentage; }
if(useMTF) { AddDataSeries((Data.BarsPeriodType)barType, barPeriod); }
Any thoughts?
Comment