Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rob Booker Pivots Indicator - Calculation Help Request

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Rob Booker Pivots Indicator - Calculation Help Request

    Hello,

    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: ​Click image for larger version

Name:	image.png
Views:	257
Size:	4.6 KB
ID:	1299557

    ​And here is the Trading View chart:Click image for larger version

Name:	image.png
Views:	193
Size:	19.2 KB
ID:	1299559

    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​​
    Attached Files

    #2
    Hello AaronKTradingForum,

    Thanks for your post.

    Since the script is a Ctrader script and not created by NinjaTrader, we do not know what might be different between the external indicator script's logic and the logic in the NinjaScript you created. Further, only the Using declarations and generated NinjaScript code is visible in the .cs file you shared and not the entire logic of the script.

    To understand exactly how the logic in the script is behaving, debugging prints should be added to the script that prints out all the values being used for calculating the value being assigned to the plot along with labels and comparison operators being used.

    See this NinjaTrader Support article detailing Debugging using Prints(): https://support.ninjatrader.com/s/ar...nd-TraceOrders

    This forum thread will be open for other community members to share their insights also.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    656 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    371 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X