using NinjaTrader.Data;
using NinjaTrader.Gui.Design;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Xml.Serialization;
namespace NinjaTrader.Indicator
{
[Description("MWaveUp - This plots the current and historical UP wave structure on the price chart. It allows for an Anchor Date/Time if desired.")]
public class MWaveUp : NinjaTrader.Indicator.Indicator
{
private DateTime anchorDate = new DateTime(0x7d0, 1, 1, 12, 0, 0);
private TimeSpan anchorTime = new TimeSpan(6, 30, 0);
private double atr;
private bool FirstTime;
private int neww1;
private int neww3;
private int neww4;
private bool origin;
private Color plotColor = Color.Blue;
private double plotSpacing = 1.0;
private int plotThickness = 14;
private DateTime RealDate;
private TimeSpan RealTime;
private double spc;
private string TextRemove = "";
private DataSeries TimeCondition;
private int w0end;
private double w0Lo;
private int w0LoBar;
private int w0Number;
private int w1end;
private double w1Hi;
private int w1HiBar;
private int w1Number;
private bool w1start;
private int w2end;
private double w2Lo;
private int w2LoBar;
private int w2Number;
private bool w2start;
private int w3end;
private double w3Hi;
private int w3HiBar;
private int w3Number;
private bool w3start;
private int w4end;
private double w4Lo;
private int w4LoBar;
private int w4Number;
private bool w4start;
private int w5end;
private double w5Hi;
private int w5HiBar;
private int w5Number;
private bool w5start;
private int wAend;
private double wALo;
private int wALoBar;
private int wANumber;
private bool wAstart;
private double Wave;
private int wBend;
private double wBHi;
private int wBHiBar;
private int wBNumber;
private bool wBstart;
private int wCend;
private double wCLo;
private int wCLoBar;
private int wCNumber;
private bool wCstart;
private int x;
internal DataSeries signal;
protected override void Initialize()
{
base.Overlay = true;
this.TimeCondition = new DataSeries(this);
base.ClearOutputWindow();
signal = new DataSeries(this, Data.MaximumBarsLookBack.Infinite);
}
protected override void OnBarUpdate()
{
signal.Set(0);
if (base.CurrentBar >= 0x16)
{
this.atr = base.ATR(this.plotThickness)[0];
this.spc = (0.5 * this.plotSpacing) * this.atr;
DateTime time = base.Time[0];
this.RealDate = time.Date;
DateTime time2 = base.Time[0];
this.RealTime = time2.TimeOfDay;
if ((this.RealDate == this.anchorDate) && (this.RealTime >= this.anchorTime))
{
this.TimeCondition[0] = 1.0;
}
if (this.RealDate > this.anchorDate)
{
this.TimeCondition[0] = 1.0;
}
if (this.TimeCondition[0] > this.TimeCondition[1])
{
base.DrawText("TimeCondition", false, "Start", 0, base.Low[0] - (2.0 * this.spc), 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Black, Color.White, 0);
base.DrawDot("TimeCond", false, 0, base.Close[0], this.plotColor);
}
if (this.TimeCondition[0] == 1.0)
{
if ((((!this.origin && !this.w1start) && (!this.w2start && !this.w3start)) && ((!this.w4start && !this.w5start) && (!this.wAstart && !this.wBstart))) && (base.LowestBar(base.Close, 0x15) == 0))
{
this.origin = true;
this.w0Lo = base.Close[0];
this.Wave = 0.0;
}
if ((((this.origin && !this.w1start) && (!this.w2start && !this.w3start)) && ((!this.w4start && !this.w5start) && (!this.wAstart && !this.wBstart))) && (!this.wCstart && (base.HighestBar(base.Close, 13) == 0)))
{
this.w1start = true;
this.w1HiBar = -1;
this.w1Hi = base.Close[0];
this.w0end = base.LowestBar(base.Close, 14);
this.w0Lo = base.Close[this.w0end];
this.w0Number = base.CurrentBar - this.w0end;
base.DrawText("w1Text" + base.CurrentBar.ToString(), false, "W1", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(1);
this.w1Number = base.CurrentBar;
this.Wave = 1.0;
}
if (((this.w1start && !this.w2start) && (!this.w3start && !this.w4start)) && ((!this.w5start && !this.wAstart) && (!this.wBstart && !this.wCstart)))
{
this.w1HiBar++;
if (base.Close[0] > this.w1Hi)
{
this.TextRemove = "w1Text" + this.w1Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w1Number, 0);
base.DrawText("w1Text" + base.CurrentBar.ToString(), false, "W1", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(1);
this.w1Number = base.CurrentBar;
this.w1Hi = base.Close[0];
this.w1HiBar = 0;
}
if ((base.LowestBar(base.Close, 8) == 0) && (this.w1HiBar >= 8))
{
this.w2Lo = base.Close[0];
this.w2start = true;
this.w1end = base.HighestBar(base.Close, this.w1HiBar + 2);
this.w1Hi = base.Close[this.w1end];
base.DrawText("w2Text" + base.CurrentBar.ToString(), false, "W2", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(2);
this.w2Number = base.CurrentBar;
this.Wave = 2.0;
}
}
if (((this.w2start && !this.w3start) && (!this.w4start && !this.w5start)) && ((!this.wAstart && !this.wBstart) && !this.wCstart))
{
this.w2LoBar++;
if (base.Close[0] < this.w2Lo)
{
this.x = this.w2Number;
this.TextRemove = "w2Text" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("w2Text" + base.CurrentBar.ToString(), false, "W2", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(2);
this.w2Number = base.CurrentBar;
this.w2Lo = base.Close[0];
this.w2LoBar = 0;
}
if (base.HighestBar(base.Close, 0x15) == 0)
{
this.w2end = base.LowestBar(base.Close, this.w2LoBar + 1);
if (base.Close[0] > this.w1Hi)
{
this.w3start = true;
this.w3Hi = base.Close[0];
this.w3HiBar = -1;
base.DrawText("w3Text" + base.CurrentBar.ToString(), false, "W3", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(3);
this.w3Number = base.CurrentBar;
this.Wave = 3.0;
}
}
if (this.w2Lo < this.w0Lo)
{
this.TextRemove = "w2Text" + this.w2Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w2Number, 0);
this.TextRemove = "w1Text" + this.w1Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w1Number, 0);
this.w1start = false;
this.w2start = false;
this.w3start = false;
this.w0LoBar = 0;
this.w0Lo = base.Close[0];
this.w1Hi = 0.0;
this.w2Lo = 999999.0;
this.w1HiBar = 0;
this.w2LoBar = 0;
this.w0Number = base.CurrentBar;
this.Wave = 0.2;
}
}
if (((this.w3start && !this.w4start) && (!this.w5start && !this.wAstart)) && (!this.wBstart && !this.wCstart))
{
this.w3HiBar++;
if (base.Close[0] > this.w3Hi)
{
this.x = this.w3Number;
this.TextRemove = "w3Text" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("w3Text" + base.CurrentBar.ToString(), false, "W3", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(3);
this.w3Number = base.CurrentBar;
this.w3Hi = base.Close[0];
this.w3HiBar = 0;
}
if ((base.LowestBar(base.Close, 13) == 0) && (this.w3HiBar >= 13))
{
this.w4start = true;
this.w4LoBar = -1;
this.w4Lo = base.Close[0];
this.w3end = base.HighestBar(base.Close, this.w3HiBar + 1);
base.DrawText("w4Text" + base.CurrentBar.ToString(), false, "W4", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(4);
this.w4Number = base.CurrentBar;
this.Wave = 4.0;
}
}
if (((this.w4start && !this.w5start) && (!this.wAstart && !this.wBstart)) && !this.wCstart)
{
this.w4LoBar++;
if (base.Close[0] < this.w4Lo)
{
this.x = this.w4Number;
this.TextRemove = "w4Text" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("w4Text" + base.CurrentBar.ToString(), false, "W4", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(4);
this.w4Number = base.CurrentBar;
this.w4Lo = base.Close[0];
this.w4LoBar = 0;
}
if (base.HighestBar(base.Close, 0x22) == 0)
{
this.w4end = base.LowestBar(base.Close, this.w4LoBar + 2);
if (base.Close[0] > this.w3Hi)
{
this.w5start = true;
this.w5Hi = base.Close[0];
this.w5HiBar = -1;
base.DrawText("w5Text" + base.CurrentBar.ToString(), false, "W5", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(5);
this.w5Number = base.CurrentBar;
this.Wave = 5.0;
}
}
if (this.w4Lo < this.w2Lo)
{
this.w2LoBar = 0;
this.w3start = false;
this.w4start = false;
this.neww1 = base.HighestBar(base.Close, base.CurrentBar - this.w0Number);
this.TextRemove = "w4Text" + this.w4Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w4Number, 0);
this.TextRemove = "w2Text" + this.w2Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w2Number, 0);
base.DrawText("w2Text" + base.CurrentBar.ToString(), false, "W2", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(2);
this.w2Number = base.CurrentBar;
this.TextRemove = "w1Text" + this.w1Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w1Number, 0);
this.TextRemove = "w3Text" + this.w3Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w3Number, 0);
this.neww1 = base.HighestBar(base.Close, base.CurrentBar - this.w0Number);
base.DrawText("w1Text" + this.w3Number.ToString(), false, "W1", this.neww1, base.High[this.neww1] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(this.neww1, 1);
this.w1Number = this.w3Number;
this.w1Hi = base.Close[this.neww1];
this.w2end = base.CurrentBar;
this.w2Lo = base.Close[0];
this.w3Hi = 0.0;
this.w4Lo = 999999.0;
this.w3HiBar = 0;
this.w4LoBar = 0;
this.Wave = 2.4;
}
}
if ((this.w5start && !this.wAstart) && (!this.wBstart && !this.wCstart))
{
this.w5HiBar++;
if (base.Close[0] > this.w5Hi)
{
this.x = this.w5Number;
this.TextRemove = "w5Text" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("w5Text" + base.CurrentBar.ToString(), false, "W5", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(5);
this.w5Number = base.CurrentBar;
this.w5Hi = base.Close[0];
this.w5HiBar = 0;
}
if (base.LowestBar(base.Close, 13) == 0)
{
this.wAstart = true;
this.wALo = base.Close[0];
this.wALoBar = -1;
this.w5end = base.HighestBar(base.Close, this.w5HiBar + 1);
base.DrawText("wAText" + base.CurrentBar.ToString(), false, "W-A", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(-1);
this.wANumber = base.CurrentBar;
this.Wave = 6.0;
}
}
if ((this.wAstart && !this.wBstart) && !this.wCstart)
{
this.wALoBar++;
if (base.Close[0] < this.wALo)
{
this.x = this.wANumber;
this.TextRemove = "wAText" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("wAText" + base.CurrentBar.ToString(), false, "W-A", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(-1);
this.wANumber = base.CurrentBar;
this.wALo = base.Close[0];
this.wALoBar = 0;
}
if (base.HighestBar(base.Close, 8) == 0)
{
this.wBstart = true;
this.wBHi = base.Close[0];
this.wBHiBar = -1;
this.wAend = base.LowestBar(base.Close, this.wALoBar + 1);
base.DrawText("wBText" + base.CurrentBar.ToString(), false, "W-B", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(-2);
this.wBNumber = base.CurrentBar;
this.Wave = 7.0;
}
if (this.wALo < this.w2Lo)
{
this.w2LoBar = 0;
this.w3start = false;
this.w4start = false;
this.w5start = false;
this.wAstart = false;
this.TextRemove = "w1Text" + this.w1Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w1Number, 0);
this.TextRemove = "w2Text" + this.w2Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w2Number, 0);
this.TextRemove = "w3Text" + this.w3Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w3Number, 0);
this.TextRemove = "w4Text" + this.w4Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w4Number, 0);
this.TextRemove = "w5Text" + this.w5Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w5Number, 0);
this.TextRemove = "wAText" + this.wANumber.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.wANumber, 0);
base.DrawText("w2Text" + base.CurrentBar.ToString(), false, "W2", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(2);
this.w2Number = base.CurrentBar;
this.neww1 = base.HighestBar(base.Close, base.CurrentBar - this.w0Number);
this.w1Number = base.CurrentBar - this.neww1;
base.DrawText("w1Text" + this.w3Number.ToString(), false, "W1", this.neww1, base.High[this.neww1] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(this.neww1, 1);
this.w1Hi = base.Close[this.neww1];
this.w1HiBar = this.neww1;
this.w2end = base.CurrentBar;
this.w2Lo = base.Close[0];
this.w3Hi = 0.0;
this.w3HiBar = 0;
this.w4Lo = 999999.0;
this.w4LoBar = 0;
this.w5Hi = 0.0;
this.w5HiBar = 0;
this.wALo = 999999.0;
this.wALoBar = 0;
this.Wave = 2.7;
}
if ((this.wALo < this.w4Lo) && this.w3start)
{
this.w4LoBar = 0;
this.w5start = false;
this.wAstart = false;
this.TextRemove = "w3Text" + this.w3Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w3Number, 0);
this.TextRemove = "w4Text" + this.w4Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w4Number, 0);
this.TextRemove = "w5Text" + this.w5Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w5Number, 0);
this.TextRemove = "wAText" + this.wANumber.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.wANumber, 0);
base.DrawText("w4Text" + base.CurrentBar.ToString(), false, "W4", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(4);
this.w4Number = base.CurrentBar;
this.neww3 = base.HighestBar(base.Close, base.CurrentBar - this.w2Number);
this.w3Number = base.CurrentBar - this.neww3;
base.DrawText("w3Text" + this.w3Number.ToString(), false, "W3", this.neww3, base.High[this.neww3] + this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(this.neww3, 3);
this.w3Hi = base.Close[this.neww3];
this.w4end = base.CurrentBar;
this.w4Lo = base.Close[0];
this.w3HiBar = this.neww3;
this.w5Hi = 0.0;
this.w5HiBar = 0;
this.wALo = 999999.0;
this.wALoBar = 0;
this.Wave = 4.7;
}
if (base.Close[0] < this.w0Lo)
{
this.origin = false;
this.w1start = false;
this.w2start = false;
this.w3start = false;
this.w4start = false;
this.w5start = false;
this.wAstart = false;
base.RemoveDrawObject("w1text" + this.w1Number.ToString());
signal.Set(CurrentBar - this.w1Number, 0);
base.RemoveDrawObject("w2text" + this.w2Number.ToString());
signal.Set(CurrentBar - this.w2Number, 0);
base.RemoveDrawObject("w3text" + this.w3Number.ToString());
signal.Set(CurrentBar - this.w3Number, 0);
base.RemoveDrawObject("w4text" + this.w4Number.ToString());
signal.Set(CurrentBar - this.w4Number, 0);
base.RemoveDrawObject("w5text" + this.w5Number.ToString());
signal.Set(CurrentBar - this.w5Number, 0);
base.RemoveDrawObject("wAtext" + this.wANumber.ToString());
signal.Set(CurrentBar - this.wANumber, 0);
this.Wave = -0.7;
}
}
if (this.wBstart && !this.wCstart)
{
this.wBHiBar++;
if (base.Close[0] > this.wBHi)
{
this.x = this.wBNumber;
this.TextRemove = "wBText" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("wBText" + base.CurrentBar.ToString(), false, "W-B", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(-2);
this.wBNumber = base.CurrentBar;
this.wBHi = base.Close[0];
this.wBHiBar = 0;
}
if (base.LowestBar(base.Close, 0x15) == 0)
{
this.wBend = base.HighestBar(base.Close, this.wBHiBar);
this.wCstart = true;
this.wCLo = base.Close[0];
this.wCLoBar = -1;
base.DrawText("wCText" + base.CurrentBar.ToString(), false, "W-C", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float) this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(-3);
this.wCNumber = base.CurrentBar;
this.Wave = 8.0;
}
if (this.wBHi > this.w5Hi)
{
this.w5Hi = this.wBHi;
this.w5HiBar = 0;
this.TextRemove = "w5Text" + this.w5Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w5Number, 0);
base.DrawText("w5Text" + base.CurrentBar.ToString(), false, "W5", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(5);
this.w5Number = base.CurrentBar;
this.TextRemove = "wAText" + this.wANumber.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.wANumber, 0);
this.TextRemove = "wBText" + this.wBNumber.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.wBNumber, 0);
this.wAstart = false;
this.wBstart = false;
this.w5start = true;
this.wBHi = 0.0;
this.wBHiBar = 0;
this.wALo = 999999.0;
this.wALoBar = 0;
this.Wave = 5.7;
}
}
if (this.wCstart)
{
this.wCLoBar++;
if (base.Close[0] < this.wCLo)
{
this.x = this.wCNumber;
this.TextRemove = "wCText" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("wCText" + base.CurrentBar.ToString(), false, "W-C", 0, base.Low[0] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(-3);
this.wCNumber = base.CurrentBar;
this.wCLo = base.Close[0];
this.wCLoBar = 0;
}
if (base.Close[0] > this.w5Hi)
{
this.wAstart = false;
this.wBstart = false;
this.wCstart = false;
base.RemoveDrawObject("wAtext" + this.wANumber.ToString());
signal.Set(CurrentBar - this.wANumber, 0);
base.RemoveDrawObject("wBtext" + this.wBNumber.ToString());
signal.Set(CurrentBar - this.wBNumber, 0);
base.RemoveDrawObject("wCtext" + this.wCNumber.ToString());
signal.Set(CurrentBar - this.wCNumber, 0);
this.w5Hi = base.Close[0];
this.TextRemove = "w5Text" + this.w5Number.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.w5Number, 0);
base.DrawText("w5Text" + base.CurrentBar.ToString(), false, "W5", 0, base.High[0] + this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set(5);
this.w5Number = base.CurrentBar;
this.wALo = 999999.0;
this.wALoBar = 0;
this.wBHi = 0.0;
this.wBHiBar = 0;
this.wCLo = 999999.0;
this.wCLoBar = 0;
this.Wave = 5.8;
}
if ((this.wCLo < this.wALo) && (base.HighestBar(base.Close, 13) == 0))
{
this.origin = false;
this.w1start = false;
this.w2start = false;
this.w3start = false;
this.w4start = false;
this.w5start = false;
this.wAstart = false;
this.wBstart = false;
this.wCstart = false;
this.wCend = base.LowestBar(base.Close, 13);
this.x = this.wCNumber;
this.TextRemove = "wCText" + this.x.ToString();
base.RemoveDrawObject(this.TextRemove);
signal.Set(CurrentBar - this.x, 0);
base.DrawText("wCText" + base.CurrentBar.ToString(), false, "W-C", (int)(base.CurrentBar - this.wCNumber), base.Low[this.wCend] - this.spc, 0, this.plotColor, new Font("Arial", (float)this.plotThickness), StringAlignment.Center, Color.Transparent, Color.White, 0);
signal.Set((int)(base.CurrentBar - this.wCNumber), -3);
this.wCNumber = base.CurrentBar;
if (this.wCend == base.LowestBar(base.Close, 0x15 + this.wCend))
{
this.origin = true;
}
this.Wave = -1.0;
}
}
}
}
}
[NinjaTrader.Gui.Design.DisplayName("Anchor Date"), Description("First Time"), GridCategory("Parameters")]
public DateTime AnchorDate
{
get
{
return this.anchorDate;
}
set
{
this.anchorDate = value;
}
}
[NinjaTrader.Gui.Design.DisplayName("Anchor Time"), Description("First Time"), GridCategory("Parameters")]
public TimeSpan AnchorTime
{
get
{
return this.anchorTime;
}
set
{
this.anchorTime = value;
}
}
[GridCategory("Parameters"), XmlIgnore, Description("Color input Plot"), NinjaTrader.Gui.Design.DisplayName("\t\t\t\tPlot Color")]
public Color PlotColor
{
get
{
return this.plotColor;
}
set
{
this.plotColor = value;
}
}
[Browsable(false)]
public string PlotColorSerialize
{
get
{
return SerializableColor.ToString(this.plotColor);
}
set
{
this.plotColor = SerializableColor.FromString(value);
}
}
[NinjaTrader.Gui.Design.DisplayName("\t\t\t\tPlot Spacing"), GridCategory("Parameters")]
public double PlotSpacing
{
get
{
return this.plotSpacing;
}
set
{
this.plotSpacing = value;
}
}
[GridCategory("Parameters"), NinjaTrader.Gui.Design.DisplayName("\t\t\t\tPlot Thickness")]
public int PlotThickness
{
get
{
return this.plotThickness;
}
set
{
this.plotThickness = value;
}
}
[Browsable(false), XmlIgnore]
public DataSeries wave
{
get
{
return base.Values[0];
}
}
}
}
#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
public partial class Indicator : IndicatorBase
{
private MWaveUp[] cacheMWaveUp = null;
private static MWaveUp checkMWaveUp = new MWaveUp();
///
/// MWaveUp - This plots the current and historical UP wave structure on the price chart. It allows for an Anchor Date/Time if desired.
///
///
public MWaveUp MWaveUp()
{
return MWaveUp(Input);
}
///
/// MWaveUp - This plots the current and historical UP wave structure on the price chart. It allows for an Anchor Date/Time if desired.
///
///
public MWaveUp MWaveUp(Data.IDataSeries input)
{
if (cacheMWaveUp != null)
for (int idx = 0; idx < cacheMWaveUp.Length; idx++)
if (cacheMWaveUp[idx].EqualsInput(input))
return cacheMWaveUp[idx];
lock (checkMWaveUp)
{
if (cacheMWaveUp != null)
for (int idx = 0; idx < cacheMWaveUp.Length; idx++)
if (cacheMWaveUp[idx].EqualsInput(input))
return cacheMWaveUp[idx];
MWaveUp indicator = new MWaveUp();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
Indicators.Add(indicator);
indicator.SetUp();
MWaveUp[] tmp = new MWaveUp[cacheMWaveUp == null ? 1 : cacheMWaveUp.Length + 1];
if (cacheMWaveUp != null)
cacheMWaveUp.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheMWaveUp = tmp;
return indicator;
}
}
}
}
// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
///
/// MWaveUp - This plots the current and historical UP wave structure on the price chart. It allows for an Anchor Date/Time if desired.
///
///
[Gui.Design.WizardCondition("Indicator")]
public Indicator.MWaveUp MWaveUp()
{
return _indicator.MWaveUp(Input);
}
///
/// MWaveUp - This plots the current and historical UP wave structure on the price chart. It allows for an Anchor Date/Time if desired.
///
///
public Indicator.MWaveUp MWaveUp(Data.IDataSeries input)
{
return _indicator.MWaveUp(input);
}
}
}
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
///
/// MWaveUp - This plots the current and historical UP wave structure on the price chart. It allows for an Anchor Date/Time if desired.
///
///
[Gui.Design.WizardCondition("Indicator")]
public Indicator.MWaveUp MWaveUp()
{
return _indicator.MWaveUp(Input);
}
///
/// MWaveUp - This plots the current and historical UP wave structure on the price chart. It allows for an Anchor Date/Time if desired.
///
///
public Indicator.MWaveUp MWaveUp(Data.IDataSeries input)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
return _indicator.MWaveUp(input);
}
}
}
#endregion