#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
using System.IO;
using System.Globalization;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Forms;
#endregion
namespace NinjaTrader.Indicator
{
[Description("NYSE TICK and Advance/Decline Line Market Internals")]
public class a1MarketInternals : Indicator
{
#region Variables
string tkSymbol = "^TICK";
string adSymbol = "^ADD";
int tkMinutes = 1;
int nyseTickHigh = 800;
int nyseTickLow = -800;
bool showADplot = true;
bool showTickPlot = true;
Color adColor = Color.Yellow;
TimeSpan newYorkOpen = new TimeSpan(09, 30, 00);
TimeSpan newYorkClose= new TimeSpan(16, 00, 00);
TimeZoneInfo est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
public enum TickStyle {
CandleStick,
HollowCandles,
HiLoClose,
};
private TickStyle tickStyle = TickStyle.CandleStick;
int scaleMaxPixels = 0;
int verticalOffset = 0;
double tickOpen=0, tickHigh=0, tickLow=0, tickClose=0;
double adClose=0;
int tickBar=0, lastTickBar=0, lastTkPriceBar=0;
int tickHighBreachBar=0, tickLowBreachBar=0;
int adXpix0=0, adYpix0=0, adXpix1=0, adYpix1=0;
string tkStat= "???";
double d=0;
int x=0, y=0;
Font textFont = new Font("Impact", 10, System.Drawing.FontStyle.Regular);
StringFormat FormatLeft = new StringFormat();
private bool ShowOutline = true;
private bool EnhanceHL = true;
private bool ReinitSession = false;
private bool ForceHiLo = true;
private int ForcedHiLoBS = 2;
private int totalvolume = 0, hi, lo;
private DataSeries dsHigh, dsLow, dsClose;
private DataSeries adPlot;
private int startbar = -1;
private int lastBar = -1;
private bool useplot = true;
Pen drawPen = new Pen(Color.Transparent);
Pen adPen = new Pen(Color.Transparent, 4);
Pen linePen = new Pen(Color.Black, 5);
SolidBrush drawBrush = new SolidBrush(Color.Transparent);
int hiTkBar=0, loTkBar=0;
#endregion
protected override void Initialize() {
Overlay = false;
PriceTypeSupported = false;
CalculateOnBarClose = false;
DrawOnPricePanel = true;
Add("^TICK",PeriodType.Minute, 1);
Add("^ADD", PeriodType.Minute, 1);
}
protected override void OnStartUp() {
dsHigh = new DataSeries(this, MaximumBarsLookBack.Infinite);
dsLow = new DataSeries(this, MaximumBarsLookBack.Infinite);
dsClose = new DataSeries(this, MaximumBarsLookBack.Infinite);
adPen.Color = adColor;
adPlot = new DataSeries(this, MaximumBarsLookBack.Infinite);
}
Thanks in advance for any help--
Comment