public iHMA(int pPeriods) { periods = pPeriods; longWMA = new iWMA(periods); shortWMA = new iWMA(periods / 2); outerWMA = new iWMA((int)Math.Sqrt(periods)); }
// constructor, called only once, setup multiple tick variables public oIndicatorDump(int pPeriods) { iPeriods = pPeriods; ATR = new iATR(pPeriods); BB = new iBollingerBands(iPeriods, -1); CCI = new iCCI(iPeriods); Derivatives = new iDerivatives(); EMA = new iEMA(iPeriods); FMA = new iFMA(iPeriods); HMA = new iHMA(iPeriods); MACD = new iMACD(12, 26, 9); Momemtum = new iMomemtum(iPeriods); RSI = new iRSI(iPeriods); Renko = new iRenko(iPeriods); SMA = new iSMA(iPeriods); STARCBands = new iSTARCBands(iPeriods, 2); STDDEV = new iSTDDEV(iPeriods); Slope = new iSlope(); StochRSI = new iStochRSI(iPeriods); Stochastics = new iStochastics(3, 2, 1); Stub = new iStub(iPeriods); Trend = new iTrend(iPeriods); TrueRange = new iTrueRange(); WMA = new iWMA(iPeriods); }
public static void TestWMA() { iWMA WMA = new iWMA(5); WMA.ReceiveTick(16); WMA.ReceiveTick(17); WMA.ReceiveTick(17); WMA.ReceiveTick(10); WMA.ReceiveTick(17); double v = WMA.Value(); // should be 15.066 if (Math.Abs(15.066 - v) < 0.001) { Framework.Logger(2, "FMA Returns correct value: 15.06"); } }