protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description             = @"Enter the description for your new custom Indicator here.";
                Name                    = "OrderFlow Momentum";
                Calculate               = Calculate.OnEachTick;
                IsOverlay               = false;
                DisplayInDataBox        = true;
                DrawOnPricePanel        = false;
                DrawHorizontalGridLines = false;
                DrawVerticalGridLines   = false;
                PaintPriceMarkers       = true;
                ScaleJustification      = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                //Disable this property if your indicator requires custom values that cumulate with each new market data event.
                //See Help Guide for additional information.
                IsSuspendedWhileInactive = true;

                AddPlot(new Stroke(Brushes.LawnGreen, 3), PlotStyle.Bar, "Momo");
                //AddPlot(new Stroke(Brushes.Red, 3), PlotStyle.Bar, "DownMomo");
                AddPlot(Brushes.Transparent, "DeltaMomo");
            }
            else if (State == State.Configure)
            {
                AddDataSeries(Data.BarsPeriodType.Tick, 1);
                ClearOutputWindow();
            }
            else if (State == State.DataLoaded)
            {
                // Instantiate the indicator
                cumulativeDelta = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0);
            }
        }
Пример #2
0
 protected override void OnStateChange()
 {
     if (State == State.SetDefaults)
     {
         Description             = @"Enter the description for your new custom Indicator here.";
         Name                    = "Output Delta";
         Calculate               = Calculate.OnEachTick;
         IsOverlay               = true;
         DisplayInDataBox        = true;
         DrawOnPricePanel        = false;
         DrawHorizontalGridLines = false;
         DrawVerticalGridLines   = false;
         PaintPriceMarkers       = true;
         ScaleJustification      = NinjaTrader.Gui.Chart.ScaleJustification.Right;
         //Disable this property if your indicator requires custom values that cumulate with each new market data event.
         //See Help Guide for additional information.
         IsSuspendedWhileInactive = true;
         Opening   = DateTime.Parse("09:30", System.Globalization.CultureInfo.InvariantCulture);
         SampleEnd = DateTime.Parse("09:40", System.Globalization.CultureInfo.InvariantCulture);
     }
     else if (State == State.Configure)
     {
         AddDataSeries(Data.BarsPeriodType.Tick, 1);
         ClearOutputWindow();
     }
     else if (State == State.DataLoaded)
     {
         // Instantiate the indicator
         cumulativeDelta = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0);
     }
 }
        //private string message = "no message";
        /// [X] Audio alerts -- download sounds
        /// [X] Stats 7 - 9 am  if low
        /// [X] Avg Daily Gain?
        /// [X] Daily Gain Limit of 16T? Hurts Performance
        /// [X] Daily Loss Limit of 16T?
        /// [ ] Combine stats window
        /// [ ] Auto generate a chart
        /// [ ] Genetic optimize params

        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description             = @"Enter the description for your new custom Indicator here.";
                Name                    = "LT Vol Swing Cum Delta";
                Calculate               = Calculate.OnBarClose;
                IsOverlay               = true;
                DisplayInDataBox        = true;
                DrawOnPricePanel        = true;
                DrawHorizontalGridLines = true;
                DrawVerticalGridLines   = true;
                PaintPriceMarkers       = true;
                ScaleJustification      = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                //Disable this property if your indicator requires custom values that cumulate with each new market data event.
                //See Help Guide for additional information.
                IsSuspendedWhileInactive = true;
                AddPlot(Brushes.Orange, "TrendDir");
                AddPlot(Brushes.Orange, "CumSma");
                UpColor           = Brushes.DodgerBlue;
                DnColor           = Brushes.Red;
                ColorBars         = true;
                SetUpBars         = true;
                AudioAlerts       = true;
                StartTime         = DateTime.Parse("07:00", System.Globalization.CultureInfo.InvariantCulture);
                EndTime           = DateTime.Parse("09:00", System.Globalization.CultureInfo.InvariantCulture);
                StopTicks         = 12;
                TargetTicks       = 12;
                CalcStats         = true;
                BackgroundOpacity = 90;
                NoteLocation      = TextPosition.TopLeft;
                BackgroundColor   = Brushes.DimGray;
                FontColor         = Brushes.WhiteSmoke;
                OutlineColor      = Brushes.DimGray;
                NoteFont          = new SimpleFont("Arial", 12);
                MaxLoss           = 16;
                MaxGain           = 60;
                fastSeries        = new Series <double>(this, MaximumBarsLookBack.Infinite);
            }
            else if (State == State.Configure)
            {
                ClearOutputWindow();
                AddDataSeries(Data.BarsPeriodType.Tick, 1);
            }
            else if (State == State.DataLoaded)
            {
                LT_Swing_Trend1    = LT_Swing_Trend(Close, ltSwingTrendDeviationType.ATR, false, false, 72, 3, 5, 0.15);
                cumulativeDelta    = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0);
                cumulativeDeltaRth = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0);
                amaDSSBressert1    = amaDSSBressert(Close, 10, 3, 7, 80, 20);
            }
        }