I'm very new to programming and I'm trying to modify the existing NT7 Pivots indicators to include the following changes.
- New calculations
- Add Levels S4, S5, R4, R5
- Plot historical Pivots
I've added the necessary Variables and new plots...
protected override void Initialize() { Add(new Plot(Color.Yellow, "PP")); Add(new Plot(Color.Blue, "R1")); Add(new Plot(Color.Red, "S1")); Add(new Plot(Color.Blue, "R2")); Add(new Plot(Color.Red, "S2")); Add(new Plot(Color.Blue, "R3")); Add(new Plot(Color.Red, "S3")); Add(new Plot(Color.Blue, "R4")); Add(new Plot(Color.Red, "S4")); Add(new Plot(Color.Blue, "R5")); Add(new Plot(Color.Red, "S5")); AutoScale = false; Overlay = true; stringFormatFar.Alignment = StringAlignment.Far; }
...as well as the modified the formulas...
pp = (currentHigh + currentLow + currentClose) / 3; s1 = 2 * pp - currentHigh; r1 = 2 * pp - currentLow; s2 = pp - (currentHigh - currentLow); r2 = pp + (currentHigh - currentLow); s3 = s1 - (currentHigh - currentLow); r3 = r1 + (currentHigh - currentLow); s4 = s2 - (currentHigh - currentLow); r4 = r2 + (currentHigh - currentLow); s5 = s3 - (currentHigh - currentLow); r5 = r3 + (currentHigh - currentLow);
... and these changes below...
/// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries PP { get { return Values[0]; } } /// <summary> /// </summary> [Description("Approach for calculation the prior day HLC values.")] [GridCategory("Parameters")] public Data.HLCCalculationMode PriorDayHLC { get { return priorDayHLC; } set { priorDayHLC = value; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries R1 { get { return Values[1]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries R2 { get { return Values[3]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries R3 { get { return Values[5]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries R4 { get { return Values[7]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries R5 { get { return Values[9]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries S1 { get { return Values[2]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries S2 { get { return Values[4]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries S3 { get { return Values[6]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries S4 { get { return Values[8]; } } /// <summary> /// </summary> [Browsable(false)] [XmlIgnore] public DataSeries S5 { get { return Values[10]; } }
Everything compiles correctly and the indicator shows up then vanishes when prices update.
Any suggestions?
Thanks in advanced.
Comment