I'm trying to classify the ADX in Journal Weekly and separately and I put the TimeFrame put in Graphic let me see well drawn.
#region Variables // Wizard generated variables // User defined variables (add any user defined variables below) #endregion /// <summary> /// This method is used to configure the indicator and is called once before any bar data is loaded. /// </summary> protected override void Initialize() { Add(new Plot(new Pen(Color.FromKnownColor(KnownColor.Black),3), PlotStyle.Bar,"Plot0")); Add(new Line(Color.FromKnownColor(KnownColor.Black), 0, "Center0")); Overlay = false; Add(PeriodType.Week, 1); //BarsArray[1] Add(PeriodType.Day, 1); //BarsArray[2] CalculateOnBarClose = false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { Plot0.Set(1); if(ADX(BarsArray[1],11)[0] > ADX(BarsArray[1],11)[1]) { if((DM(BarsArray[1],11).DiPlus[0] > DM(BarsArray[1],11).DiMinus[0])) //ALCISTA { PlotColors[0][0] = Color.Green; if(ADX(BarsArray[2],11)[0] > ADX(BarsArray[2],11)[1]) { if((DM(BarsArray[2],11).DiPlus[0] > DM(BarsArray[2],11).DiMinus[0])) //ALCISTA { PlotColors[0][0] = Color.Lime; } } } if((DM(BarsArray[1],11).DiMinus[0] > DM(BarsArray[1],11).DiPlus[0])) //BAJISTA { PlotColors[0][0] = Color.Red; if(ADX(BarsArray[2],11)[0] > ADX(BarsArray[2],11)[1]) { if((DM(BarsArray[2],11).DiMinus[0] > DM(BarsArray[2],11).DiPlus[0])) //BAJISTA { PlotColors[0][0] = Color.Fuchsia; } } } } else{PlotColors[0][0] = Color.Gray;} } #region Properties [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries Plot0 { get { return Values[0]; } } #endregion
The result when inserted in the graph is an indicator window empty with nothing to show.
This code is made to only work on a time frame and does work. What if someone wants to associate it as help.
#region Variables private DireccionTendencia direction = DireccionTendencia.HighProbabilityVolum; #endregion protected override void Initialize() { //PRIMEROS Add(new Plot(new Pen(Color.FromKnownColor(KnownColor.Black),3), PlotStyle.Bar, "Plot0")); Add(new Line(Color.FromKnownColor(KnownColor.Black), 0, "Center0")); Overlay = false; CalculateOnBarClose = false; }
protected override void OnBarUpdate() { Plot0.Set(1*VOL()[0]); if(Stochastics(2,50,2).K[0]>70) //&& ADX(11)[0]>20) { PlotColors[0][0] = Color.Green; if(Stochastics(3,50,3).K[0] > Stochastics(3,50,3).D[0]) { PlotColors[0][0] = Color.Lime; } } else if (Stochastics(2,50,2).K[0]<30)// && ADX(11)[0]>20) { PlotColors[0][0] = Color.Fuchsia; if(Stochastics(3,50,3).K[0] < Stochastics(3,50,3).D[0]) { PlotColors[0][0] = Color.DarkRed; } } else { PlotColors[0][0] = Color.Gray; } }
#region Properties [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries Plot0 { get { return Values[0]; } } #endregion
Comment