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 AveryFlynn, Today, 04:57 AM
          0 responses
          4 views
          0 likes
          Last Post AveryFlynn  
          Started by RubenCazorla, 08-30-2022, 06:36 AM
          3 responses
          78 views
          0 likes
          Last Post PaulMohn  
          Started by f.saeidi, Yesterday, 12:14 PM
          9 responses
          23 views
          0 likes
          Last Post f.saeidi  
          Started by Tim-c, Today, 03:54 AM
          0 responses
          3 views
          0 likes
          Last Post Tim-c
          by Tim-c
           
          Started by FrancisMorro, Today, 03:24 AM
          0 responses
          5 views
          0 likes
          Last Post FrancisMorro  
          Working...
          X