Beispiel #1
0
 //+------------------------------------------------------------------+");
 //| Custom indicator initialization function                         |");
 //+------------------------------------------------------------------+");
 protected override int Init()
 {
     try  // to catch and handle Exceptions that might occur in this code block
     {
         IndicatorBuffers(indicator_buffers);
         SetIndexBuffer(0, UpTrend);
         SetIndexArrow(0, 159);
         SetIndexBuffer(1, DownTrend);
         SetIndexArrow(1, 159);
         SetIndexBuffer(2, Consolidation);
         SetIndexArrow(2, 159);
         SetIndexStyle(0, DRAW_LINE, STYLE_SOLID);
         SetIndexLabel(0, "HMA3(" + period + ").Bull");
         SetIndexStyle(1, DRAW_LINE, STYLE_SOLID);
         SetIndexLabel(1, "Bear");
         SetIndexStyle(2, DRAW_LINE, STYLE_SOLID);
         SetIndexLabel(2, "Mixed");
         IndicatorShortName("Hull Moving Average(" + period + ")");
         hma     = new HMAobj(this, period, SlopeThreshold);
         b       = null;
         prevBar = null;
     }
     catch (Exception ex)    // catch and Print any exceptions that may have happened
     {
         Print("HMA3: Start: Exception: " + ex.Message);
         Print("HMA3: " + ex.StackTrace);
     }
     return(0);
 }
Beispiel #2
0
 public HMA3()
 {
     // Basic indicator initialization. Don't use this constructor to calculate values
     period = 21;
     indicator_chart_window = true;
     indicator_buffers      = 3;
     indicator_width1       = 2;
     indicator_width2       = 2;
     indicator_width3       = 2;
     indicator_color1       = Colors.Blue;
     indicator_color2       = Colors.Red;
     indicator_color3       = Colors.LimeGreen;
     UpTrend       = new Array <double>();
     DownTrend     = new Array <double>();
     Consolidation = new Array <double>();
     copyright     = "(C)2018 Entity3 LLC";
     link          = "";
     hma           = null;
 }