• 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 matthewbartlett, Today, 01:22 AM
          2 responses
          12 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by thomaspartyof10, Today, 02:33 AM
          1 response
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by manueldecastro, Yesterday, 12:57 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by ArmKnuckle, Today, 01:59 AM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by seppyr, Today, 01:53 AM
          1 response
          18 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X