Exemplo n.º 1
0
 public WilliamsPctR()
 {
     // Basic indicator initialization. Don't use this constructor to calculate values
     copyright = "(C)2019 Entity3 LLC";
     link      = "";
     Period    = 14;
     PriceType = 0;
     indicator_chart_window = false;
     indicator_buffers      = 3;
     PctR      = new Array <double>();
     UpperLine = new Array <double>();
     LowerLine = new Array <double>();
     pctR      = null;
     IndicatorBuffers(indicator_buffers);
     SetIndexBuffer(0, PctR);
     SetIndexArrow(0, 159);
     SetIndexBuffer(1, UpperLine);
     SetIndexArrow(1, 159);
     SetIndexBuffer(2, LowerLine);
     SetIndexArrow(2, 159);
     SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, clr: Colors.Red);
     SetIndexStyle(1, DRAW_LINE, STYLE_SOLID);
     SetIndexLabel(1, "Upper");
     SetIndexStyle(2, DRAW_LINE, STYLE_SOLID);
     SetIndexLabel(2, "Lower");
     SetIndexStyle(3, DRAW_ARROW, STYLE_SOLID, clr: Colors.Orange);
     indicator_width1 = 2;
     indicator_width2 = 2;
     indicator_width3 = 2;
     indicator_color1 = Colors.Red;
     indicator_color2 = Colors.White;
     indicator_color3 = Colors.White;
     IndicatorBuffers(indicator_buffers);
 }
Exemplo n.º 2
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);
         IndicatorShortName("Willams %R(" + Period + ")");
         SetIndexLabel(0, "Willams Pct R(" + Period + ")");
         SetIndexBuffer(0, PctR);
         SetIndexArrow(0, 159);
         SetIndexBuffer(1, UpperLine);
         SetIndexArrow(1, 159);
         SetIndexBuffer(2, LowerLine);
         SetIndexArrow(2, 159);
         pctR    = new WillamsPctRobj(this, Period);
         b       = null;
         prevBar = null;
     }
     catch (Exception ex)    // catch and Print any exceptions that may have happened
     {
         Print("WilliamsPctR: Start: Exception: " + ex.Message);
         Print("WilliamsPctR: " + ex.StackTrace);
     }
     return(0);
 }