internal F_TR(FTR eaIn, int FTR_Period, int ALMA_Period) : this() { ea = eaIn; Threshold = (double)10 * 1e-7; FTR_ALMA = new ALMAobj(ALMA_Period, Threshold); FTR = new FTRobj(FTR_Period); //FTRDecycle = new Decycler_obj(FTR_Period, 10, ALMA_Period); FTRDecycle = new Decycler_obj(2, 10, ALMA_Period); }
internal FISHER_X_Obj(FISHER_X eaIn,int period,int hpperiod,int periodSmooth,int periodSmooth_Stoch) : this() { ea = eaIn; IndicatorPeriod = period; HPPeriod = hpperiod; SuperSmootherPeriod = periodSmooth; SuperSmootherPeriod_Stoch = periodSmooth_Stoch; RMSFast_Upper = new RMSobj(period * 2,periodSmooth_Stoch); RMSFast_Lower = new RMSobj(period * 2,periodSmooth_Stoch); RMSFast = new RMSobj(period * 2,periodSmooth_Stoch); SIGNAL = new ALMAobj((200),20); //SaturationLimit = saturationLimit; }
//+------------------------------------------------------------------+"); //| Custom indicator initialization function |"); //| Called by Alveo to initialize the ALMA Indicator at startup. |"); //+------------------------------------------------------------------+"); protected override int Init() { try { // ENTER YOUR CODE HERE IndicatorBuffers(indicator_buffers); // Allocates memory for buffers used for custom indicator calculations. SetIndexBuffer(0, UpTrend); // binds a specified indicator buffer with one-dimensional dynamic array of the type double. SetIndexArrow(0, 159); // Sets an arrow symbol for indicators line of the DRAW_ARROW type. 159=dot. SetIndexBuffer(1, DownTrend); // repeat for each buffer SetIndexArrow(1, 159); SetIndexBuffer(2, Consolidation); SetIndexArrow(2, 159); SetIndexBuffer(3, Upper); SetIndexBuffer(4, Lower); SetIndexStyle(0, DRAW_LINE, STYLE_SOLID); // Sets the shape, style, width and color for the indicator line. SetIndexLabel(0, "T_Channel(" + CutoffPeriod + ").Bull"); SetIndexStyle(1, DRAW_LINE, STYLE_SOLID); // repeat for all 3 buffers SetIndexLabel(1, "T_Channel(" + CutoffPeriod + ").Bear"); SetIndexStyle(2, DRAW_LINE, STYLE_SOLID); SetIndexLabel(2, "T_Channel(" + CutoffPeriod + ").Mixed"); SetIndexStyle(3, DRAW_LINE, STYLE_SOLID); // Sets the shape, style, width and color for the indicator line. SetIndexLabel(3, "T_Channel(" + CutoffPeriod + ").Upper"); SetIndexStyle(4, DRAW_LINE, STYLE_SOLID); // Sets the shape, style, width and color for the indicator line. SetIndexLabel(4, "T_Channel(" + CutoffPeriod + ").Lower"); // Sets the "short" name of a custom indicator to be shown in the DataWindow and in the chart subwindow. IndicatorShortName("T_Channel(" + CutoffPeriod + "," + SlopeThreshold + ")"); priceDecycle = new Decycler_obj(IndPeriod, SlopeThreshold, CutoffPeriod); priceDecycleSmooth = new SUPERSMOOTHER_3Pole_obj(IndPeriod, SlopeThreshold); priceSmooth = new SUPERSMOOTHER_3Pole_obj(IndPeriod, SlopeThreshold); //deviationMean = new SMAobj(CutoffPeriod); deviationMean = new ALMAobj((CutoffPeriod * 5), SlopeThreshold); Print("T_Channel: Started. [" + Chart.Symbol + "] tf=" + Period()); // Print this message to Alveo Log file on startup } catch (Exception ex) { Print("T_Channel: Init: Exception: " + ex.Message); Print("T_Channel: " + ex.StackTrace); } return(0); // done }
//+------------------------------------------------------------------+"); //| Custom indicator initialization function |"); //| Called by Alveo to initialize the ALMA Indicator at startup. |"); //+------------------------------------------------------------------+"); protected override int Init() { try { // ENTER YOUR CODE HERE IndicatorBuffers(indicator_buffers); // Allocates memory for buffers used for custom indicator calculations. SetIndexBuffer(0, UpTrend); // binds a specified indicator buffer with one-dimensional dynamic array of the type double. SetIndexArrow(0, 159); // Sets an arrow symbol for indicators line of the DRAW_ARROW type. 159=dot. SetIndexBuffer(1, DownTrend); // repeat for each buffer SetIndexArrow(1, 159); SetIndexBuffer(2, Consolidation); SetIndexArrow(2, 159); SetIndexStyle(0, DRAW_LINE, STYLE_SOLID); // Sets the shape, style, width and color for the indicator line. //SetIndexLabel(0, "DTEMA(" + IndPeriod + ").Bull"); // Sets description for showing in the DataWindow and in the tooltip on Chart. SetIndexLabel(0, "ALMA(" + IndPeriod + ").Bull"); SetIndexStyle(1, DRAW_LINE, STYLE_SOLID); // repeat for all 3 buffers //SetIndexLabel(1, "DTEMA(" + IndPeriod + ").Bear"); SetIndexLabel(1, "ALMA(" + IndPeriod + ").Bear"); SetIndexStyle(2, DRAW_LINE, STYLE_SOLID); //SetIndexLabel(2, "DTEMA(" + IndPeriod + ").Mixed"); SetIndexLabel(2, "ALMA(" + IndPeriod + ").Mixed"); // Sets the "short" name of a custom indicator to be shown in the DataWindow and in the chart subwindow. //IndicatorShortName("DTEMA v2.0 (" + IndPeriod + "," + SlopeThreshold + ")"); IndicatorShortName("ALMA (" + IndPeriod + "," + SlopeThreshold + ")"); //DTema = new DTEMAobj(IndPeriod, SlopeThreshold); alma = new ALMAobj(IndPeriod, SlopeThreshold, Offset); Print("ALMA: Started. [" + Chart.Symbol + "] tf=" + Period()); // Print this message to Alveo Log file on startup } catch (Exception ex) { Print("ALMA: Init: Exception: " + ex.Message); Print("ALMA: " + ex.StackTrace); } return(0); // done }