Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

'Fibonacci pivots' error.

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

    'Fibonacci pivots' error.

    'Fibonacci pivots' tried to load additional data. All data must first be loaded by the hosting NijaScript in its confiture state. Attempted to load ... Default: Daily

    Where am I going wrong here? If I remove these two lines of code from my script, it works.

    Code:
    private FibonacciPivots _weelyPivots;
    
    else if (State == State.Configure)
    {[INDENT]AddDataSeries(Data.BarsPeriodType.Day, 1);[/INDENT]
     }
    else if (State == State.DataLoaded)
    {[INDENT]_weelyPivots = FibonacciPivots(PivotRange.Weekly, HLCCalculationMode.DailyBars, 0, 0, 0, 1);[/INDENT]
     }

    #2
    Hello Herrwolf1,

    Thanks for your post.

    It appears you have everything added as needed. Could you confirm that you have recompiled the script and have also removed and re-added the script to ensure that it properly goes through its lifecycle?

    You can test the snippet below, which is working on my end.

    Code:
    private FibonacciPivots FibonacciPivots1;
    
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Indicator here.";
                    Name                                        = "FibPivotTest";
                    Calculate                                    = Calculate.OnBarClose;
                    IsOverlay                                    = false;
                    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;
                }
                else if (State == State.Configure)
                {
                    AddDataSeries(Data.BarsPeriodType.Day, 1);
                }
                else if (State == State.DataLoaded)
                {                
                    FibonacciPivots1                = FibonacciPivots(Close, PivotRange.Weekly, HLCCalculationMode.DailyBars, 0, 0, 0, 20);
                }
            }
    I look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by adeelshahzad, Today, 03:54 AM
    5 responses
    31 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by stafe, 04-15-2024, 08:34 PM
    7 responses
    31 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by merzo, 06-25-2023, 02:19 AM
    10 responses
    823 views
    1 like
    Last Post NinjaTrader_ChristopherJ  
    Started by frankthearm, Today, 09:08 AM
    5 responses
    18 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    43 views
    0 likes
    Last Post jeronymite  
    Working...
    X