I posted in this forum last week for some help converting the Rob Booker Intraday Pivot indicator from Ctrader to Ninja Trader 8.
With some hard work, I finally managed to get it to print on the chart, but it appears the pivots are not calculated the same as on Trading view.
I want to release this indicator for free on NT8 so that other people can use it in the future, so if you can help me out that would be great!
The code for the NT8 version of the indicator is also attached to this post..
For example, let's take GC1.
Here is the Ninja Trader 8 chart:
And here is the Trading View chart:
Actual code:
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;
#endregion
region NinjaScript generated code. Neither change nor remove.
namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private RobBookerIntradayPivotPoints[] cacheRobBookerIntradayPivotPoints;
public RobBookerIntradayPivotPoints RobBookerIntradayPivotPoints(BarsPeriodType shortTermTimeFrame, int shortTermTimeFramePeriod, Brush shortTermColor, int shortTermThickness, DashStyleHelper shortTermStyle, BarsPeriodType mediumTermTimeFrame, int mediumTermTimeFramePeriod, Brush mediumTermColor, int mediumTermThickness, DashStyleHelper mediumTermStyle, BarsPeriodType longTermTimeFrame, int longTermTimeFramePeriod, Brush longTermColor, int longTermThickness, DashStyleHelper longTermStyle)
{
return RobBookerIntradayPivotPoints(Input, shortTermTimeFrame, shortTermTimeFramePeriod, shortTermColor, shortTermThickness, shortTermStyle, mediumTermTimeFrame, mediumTermTimeFramePeriod, mediumTermColor, mediumTermThickness, mediumTermStyle, longTermTimeFrame, longTermTimeFramePeriod, longTermColor, longTermThickness, longTermStyle);
}
public RobBookerIntradayPivotPoints RobBookerIntradayPivotPoints(ISeries<double> input, BarsPeriodType shortTermTimeFrame, int shortTermTimeFramePeriod, Brush shortTermColor, int shortTermThickness, DashStyleHelper shortTermStyle, BarsPeriodType mediumTermTimeFrame, int mediumTermTimeFramePeriod, Brush mediumTermColor, int mediumTermThickness, DashStyleHelper mediumTermStyle, BarsPeriodType longTermTimeFrame, int longTermTimeFramePeriod, Brush longTermColor, int longTermThickness, DashStyleHelper longTermStyle)
{
if (cacheRobBookerIntradayPivotPoints != null)
for (int idx = 0; idx < cacheRobBookerIntradayPivotPoints.Length; idx++)
if (cacheRobBookerIntradayPivotPoints[idx].ShortTermTimeFrame == shortTermTimeFrame && cacheRobBookerIntradayPivotPoints[idx].ShortTermTimeFramePeriod == shortTermTimeFramePeriod && cacheRobBookerIntradayPivotPoints[idx].ShortTermColor == shortTermColor && cacheRobBookerIntradayPivotPoints[idx].ShortTermThickness == shortTermThickness && cacheRobBookerIntradayPivotPoints[idx].ShortTermStyle == shortTermStyle && cacheRobBookerIntradayPivotPoints[idx].MediumTermTimeFrame == mediumTermTimeFrame && cacheRobBookerIntradayPivotPoints[idx].MediumTermTimeFramePeriod == mediumTermTimeFramePeriod && cacheRobBookerIntradayPivotPoints[idx].MediumTermColor == mediumTermColor && cacheRobBookerIntradayPivotPoints[idx].MediumTermThickness == mediumTermThickness && cacheRobBookerIntradayPivotPoints[idx].MediumTermStyle == mediumTermStyle && cacheRobBookerIntradayPivotPoints[idx].LongTermTimeFrame == longTermTimeFrame && cacheRobBookerIntradayPivotPoints[idx].LongTermTimeFramePeriod == longTermTimeFramePeriod && cacheRobBookerIntradayPivotPoints[idx].LongTermColor == longTermColor && cacheRobBookerIntradayPivotPoints[idx].LongTermThickness == longTermThickness && cacheRobBookerIntradayPivotPoints[idx].LongTermStyle == longTermStyle && cacheRobBookerIntradayPivotPoints[idx].EqualsInput(input))
return cacheRobBookerIntradayPivotPoints[idx];
return CacheIndicator<RobBookerIntradayPivotPoints>(new RobBookerIntradayPivotPoints(){ ShortTermTimeFrame = shortTermTimeFrame, ShortTermTimeFramePeriod = shortTermTimeFramePeriod, ShortTermColor = shortTermColor, ShortTermThickness = shortTermThickness, ShortTermStyle = shortTermStyle, MediumTermTimeFrame = mediumTermTimeFrame, MediumTermTimeFramePeriod = mediumTermTimeFramePeriod, MediumTermColor = mediumTermColor, MediumTermThickness = mediumTermThickness, MediumTermStyle = mediumTermStyle, LongTermTimeFrame = longTermTimeFrame, LongTermTimeFramePeriod = longTermTimeFramePeriod, LongTermColor = longTermColor, LongTermThickness = longTermThickness, LongTermStyle = longTermStyle }, input, ref cacheRobBookerIntradayPivotPoints);
}
}
}
namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.RobBookerIntradayPivotPoints RobBookerIntradayPivotPoints(BarsPeriodType shortTermTimeFrame, int shortTermTimeFramePeriod, Brush shortTermColor, int shortTermThickness, DashStyleHelper shortTermStyle, BarsPeriodType mediumTermTimeFrame, int mediumTermTimeFramePeriod, Brush mediumTermColor, int mediumTermThickness, DashStyleHelper mediumTermStyle, BarsPeriodType longTermTimeFrame, int longTermTimeFramePeriod, Brush longTermColor, int longTermThickness, DashStyleHelper longTermStyle)
{
return indicator.RobBookerIntradayPivotPoints(Input, shortTermTimeFrame, shortTermTimeFramePeriod, shortTermColor, shortTermThickness, shortTermStyle, mediumTermTimeFrame, mediumTermTimeFramePeriod, mediumTermColor, mediumTermThickness, mediumTermStyle, longTermTimeFrame, longTermTimeFramePeriod, longTermColor, longTermThickness, longTermStyle);
}
public Indicators.RobBookerIntradayPivotPoints RobBookerIntradayPivotPoints(ISeries<double> input , BarsPeriodType shortTermTimeFrame, int shortTermTimeFramePeriod, Brush shortTermColor, int shortTermThickness, DashStyleHelper shortTermStyle, BarsPeriodType mediumTermTimeFrame, int mediumTermTimeFramePeriod, Brush mediumTermColor, int mediumTermThickness, DashStyleHelper mediumTermStyle, BarsPeriodType longTermTimeFrame, int longTermTimeFramePeriod, Brush longTermColor, int longTermThickness, DashStyleHelper longTermStyle)
{
return indicator.RobBookerIntradayPivotPoints(input, shortTermTimeFrame, shortTermTimeFramePeriod, shortTermColor, shortTermThickness, shortTermStyle, mediumTermTimeFrame, mediumTermTimeFramePeriod, mediumTermColor, mediumTermThickness, mediumTermStyle, longTermTimeFrame, longTermTimeFramePeriod, longTermColor, longTermThickness, longTermStyle);
}
}
}
namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.RobBookerIntradayPivotPoints RobBookerIntradayPivotPoints(BarsPeriodType shortTermTimeFrame, int shortTermTimeFramePeriod, Brush shortTermColor, int shortTermThickness, DashStyleHelper shortTermStyle, BarsPeriodType mediumTermTimeFrame, int mediumTermTimeFramePeriod, Brush mediumTermColor, int mediumTermThickness, DashStyleHelper mediumTermStyle, BarsPeriodType longTermTimeFrame, int longTermTimeFramePeriod, Brush longTermColor, int longTermThickness, DashStyleHelper longTermStyle)
{
return indicator.RobBookerIntradayPivotPoints(Input, shortTermTimeFrame, shortTermTimeFramePeriod, shortTermColor, shortTermThickness, shortTermStyle, mediumTermTimeFrame, mediumTermTimeFramePeriod, mediumTermColor, mediumTermThickness, mediumTermStyle, longTermTimeFrame, longTermTimeFramePeriod, longTermColor, longTermThickness, longTermStyle);
}
public Indicators.RobBookerIntradayPivotPoints RobBookerIntradayPivotPoints(ISeries<double> input , BarsPeriodType shortTermTimeFrame, int shortTermTimeFramePeriod, Brush shortTermColor, int shortTermThickness, DashStyleHelper shortTermStyle, BarsPeriodType mediumTermTimeFrame, int mediumTermTimeFramePeriod, Brush mediumTermColor, int mediumTermThickness, DashStyleHelper mediumTermStyle, BarsPeriodType longTermTimeFrame, int longTermTimeFramePeriod, Brush longTermColor, int longTermThickness, DashStyleHelper longTermStyle)
{
return indicator.RobBookerIntradayPivotPoints(input, shortTermTimeFrame, shortTermTimeFramePeriod, shortTermColor, shortTermThickness, shortTermStyle, mediumTermTimeFrame, mediumTermTimeFramePeriod, mediumTermColor, mediumTermThickness, mediumTermStyle, longTermTimeFrame, longTermTimeFramePeriod, longTermColor, longTermThickness, longTermStyle);
}
}
}
#endregion

Comment