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?

        Comment


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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          668 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          377 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X