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 samir, Today, 07:00 PM
          0 responses
          9 views
          0 likes
          Last Post samir
          by samir
           
          Started by travisloneker, Today, 06:52 PM
          0 responses
          4 views
          0 likes
          Last Post travisloneker  
          Started by InfraredBusa, Today, 05:50 PM
          0 responses
          3 views
          0 likes
          Last Post InfraredBusa  
          Started by White Fork, Today, 04:56 PM
          1 response
          8 views
          0 likes
          Last Post White Fork  
          Started by steveyinyang, Today, 02:48 PM
          3 responses
          20 views
          0 likes
          Last Post steveyinyang  
          Working...
          X