• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 never call OnBarUpdate

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

    NT8 never call OnBarUpdate

    Hi,
    i got some issues with scripting for NT8. It doesn't matter if i take Claculate each tick or on bar close, NT never run into my OnBarUpdate(). I even tried to create a new strategy with the wizzard to evade a wrong configure but the output screen stays empty. So can someone pls tell me what's the issue or whats wrong ?

    Code:
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                            = @"Enter the description for your new custom Strategy here.";
                    Name                                = "Tageshoch";
                    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                    = 5;
                }
                else if (State == State.Configure)
                {
                    AddDataSeries("YM 03-16", Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Last);
                }
            }
    
            protected override void OnBarUpdate()
            {
                //Add your custom strategy logic here.
                Print("test succseed");
            }

    #2
    What is your main instrument?

    Do you have live data?

    Comment


      #3
      Hi sledge,

      i'm working with the data from Ninjatrader Continuum (14days Trial), and just using Ninjatrader 8 64 bit.

      Comment


        #4
        Hello NovaPrime,

        Thanks for your post and welcome to the forums.

        I replicated your code and it produces the print message.

        Can you verify that you have checked the "enabled" check box on the strategy?
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks, i must have overlooked this checkbox. Now everything is working

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by tgn55, Today, 07:22 AM
          0 responses
          2 views
          0 likes
          Last Post tgn55
          by tgn55
           
          Started by U0000999, Today, 05:17 AM
          0 responses
          4 views
          0 likes
          Last Post U0000999  
          Started by Prataturry89, Today, 03:40 AM
          0 responses
          5 views
          0 likes
          Last Post Prataturry89  
          Started by UltraFastKetoBoost28, Today, 02:43 AM
          0 responses
          6 views
          0 likes
          Last Post UltraFastKetoBoost28  
          Started by kojakojids, Today, 02:04 AM
          0 responses
          5 views
          0 likes
          Last Post kojakojids  
          Working...
          X