Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

mixed bar calculation mode

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

    mixed bar calculation mode

    Hi

    My strategy needs mostly to be calculated on any upcoming tick, but there is s piece of it which is related with exits that needs to be calculated just on bar close.

    My question is what the best way to code this requirement for a non programmer as me?


    Thanks

    #2
    Hello zerosum666,
    You can calculate your exit login in the FirstTickOfBar. This way it will be calculated only once.

    Please refer to this sample code which demonstrates it


    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Joydeep,

      If you don't mind, another related topic is how should I address the orders to enter and exit the trades in the context of running the code on incoming tick.

      Say, I use the EnterLongLimit (GetCurrentBid()) function. But given that the code is executed on each incoming tick, it looks like NT will start to fire cancel and replacement orders at high speeds, which could lead to many problems such as overfills, sync halts, etc.

      I want to know whether you believe is feasible to have the EnterLongLimit() running on incoming tick or if, alternatively, you'd recommend a different order management approach for such processor intensive strategy.

      Thanks

      Comment


        #4
        Hello zerosum666,
        Unfortunately, if you modify your order with each incoming tick then overfills etc can be an reality and there is now workaround.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X