0% found this document useful (0 votes)
89 views

Inside Day

This document defines an InsideDay indicator class in C# for use in the NinjaTrader trading platform. The InsideDay indicator checks if the current bar's high-low range is within the previous day's range, and returns true or false. It also includes generated code to register the indicator for use across different parts of the platform.

Uploaded by

freetrading
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views

Inside Day

This document defines an InsideDay indicator class in C# for use in the NinjaTrader trading platform. The InsideDay indicator checks if the current bar's high-low range is within the previous day's range, and returns true or false. It also includes generated code to register the indicator for use across different parts of the platform.

Uploaded by

freetrading
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#region Using declarations

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.DrawingTools;
#endregion

//This namespace holds Indicators in this folder and is required. Do not change it.

namespace NinjaTrader.NinjaScript.Indicators
{
public class InsideDay : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description
= @"Inside day where the current day�s range is within the previous day�s
high-low range.";
Name
= "InsideDay";
Calculate
= Calculate.OnBarClose;
IsOverlay
= true;
DisplayInDataBox =
true;
DrawOnPricePanel =
false;
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;
}
else if (State == State.Configure)
{
}
}

protected override void OnBarUpdate()


{
if (CurrentBar < 2) return;

if(High[0] < High[1] && Low[0] > Low[1])


BarBrush = Brushes.AntiqueWhite;
else BarBrush = null;
}
}
}

#region NinjaScript generated code. Neither change nor remove.

namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator :
NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private InsideDay[] cacheInsideDay;
public InsideDay InsideDay()
{
return InsideDay(Input);
}

public InsideDay InsideDay(ISeries<double> input)


{
if (cacheInsideDay != null)
for (int idx = 0; idx < cacheInsideDay.Length; idx++)
if (cacheInsideDay[idx] != null &&
cacheInsideDay[idx].EqualsInput(input))
return cacheInsideDay[idx];
return CacheIndicator<InsideDay>(new InsideDay(), input, ref
cacheInsideDay);
}
}
}

namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.InsideDay InsideDay()
{
return indicator.InsideDay(Input);
}

public Indicators.InsideDay InsideDay(ISeries<double> input )


{
return indicator.InsideDay(input);
}
}
}
namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy :
NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.InsideDay InsideDay()
{
return indicator.InsideDay(Input);
}

public Indicators.InsideDay InsideDay(ISeries<double> input )


{
return indicator.InsideDay(input);
}
}
}

#endregion

You might also like