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

Simple Multi Instrument strategy error "A hosted indicator ..."

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

    Simple Multi Instrument strategy error "A hosted indicator ..."

    Hello, I'm having an issue with a strategy. The below simple test which I generated using the NT8 strategy wizard demonstrates the issue I am having. On my NT 8.0.15, loading this strategy onto a 5-minute NQ chart and activating it generates the error: "A hosted indicator tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state." The strategy does not do anything except add a daily dataseries of VX futures.

    Is anyone able to reproduce this error, and if so, any clues?

    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;
    using NinjaTrader.NinjaScript.Indicators;
    using NinjaTrader.NinjaScript.DrawingTools;
    #endregion
    
    //This namespace holds Strategies in this folder and is required. Do not change it. 
    namespace NinjaTrader.NinjaScript.Strategies
    {
        public class MultiInstrumentTest : Strategy
        {
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Strategy here.";
                    Name                                        = "MultiInstrumentTest";
                    Calculate                                    = Calculate.OnBarClose;
                    EntriesPerDirection                            = 1;
                    EntryHandling                                = EntryHandling.AllEntries;
                    IsExitOnSessionCloseStrategy                = true;
                    ExitOnSessionCloseSeconds                    = 30;
                    IsFillLimitOnTouch                            = false;
                    MaximumBarsLookBack                            = MaximumBarsLookBack.TwoHundredFiftySix;
                    OrderFillResolution                            = OrderFillResolution.Standard;
                    Slippage                                    = 0;
                    StartBehavior                                = StartBehavior.WaitUntilFlat;
                    TimeInForce                                    = TimeInForce.Gtc;
                    TraceOrders                                    = false;
                    RealtimeErrorHandling                        = RealtimeErrorHandling.StopCancelClose;
                    StopTargetHandling                            = StopTargetHandling.PerEntryExecution;
                    BarsRequiredToTrade                            = 20;
                    // Disable this property for performance gains in Strategy Analyzer optimizations
                    // See the Help Guide for additional information
                    IsInstantiatedOnEachOptimizationIteration    = true;
                }
                else if (State == State.Configure)
                {
                    AddDataSeries("VX 12-18", Data.BarsPeriodType.Day, 1, Data.MarketDataType.Last);
                }
            }
    
            protected override void OnBarUpdate()
            {
                //Add your custom strategy logic here.
            }
        }
    }

    #2
    Hello NT Support,

    Bumping this question. I'm looking for some assistance determining if this issue can be replicated.

    Thank you.

    Comment


      #3
      Hello greagrea,

      Thanks for your post.

      We apologize for not responding sooner.

      I suspect the initial post was missed in the recent transition/upgrade of the forum and we appreciate you bumping for a response.

      I've tested with the current release 8.0.15.1 and the latest unreleased version and do not see any errors when loading the strategy that is a copy of what you have posted.

      Please make sure you are loading the strategy onto a clean chart with no other indicators as it is possible the error may be generated by some other source.

      For a reference of the error, please see the warning notes in https://ninjatrader.com/support/help...dataseries.htm

      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Thanks, Paul. I'll try this out on a clean install to remove any other variables. I already tried loading the strategy directly into the strategies tab, rather than onto a chart, with the same result. Maybe some custom code elsewhere causing an issue.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by timko, Today, 06:45 AM
        2 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by habeebft, Today, 07:27 AM
        0 responses
        4 views
        0 likes
        Last Post habeebft  
        Started by Tim-c, Today, 03:54 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by rocketman7, Today, 01:00 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by wzgy0920, 04-23-2024, 09:53 PM
        3 responses
        76 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X