Hi
Me + a friend are trying to plot a simple line that follows the close price. But we cant get it working.
I know that the function is already available. But this is an exercise to learn Ninjascript. So... what are we doing wrong?
/thanks
{
public class PlotCurrentPrice : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "PlotCurrentPrice";
Calculate = Calculate.OnPriceChange;
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;
Price = 1;
AddPlot(Brushes.White, "PriceLine");
}
else if (State == State.Configure)
{
}
}
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
}
protected override void OnBarUpdate()
{
Value[0] = Input[CurrentBar];
}

Comment