Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Submit order immediately, not on bar close

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

    Submit order immediately, not on bar close

    Hello,
    (how) is it possible to submit an order for some secondary instrument immediately within the primary instrument's OnBarUpdate, ie. not waiting for the current bar of the secondary instrument to finish ?

    So I search for a method like EnterLong(barsInProgess=2, waitForBarClose=false).

    Could "AtmStrategyCreate" be used for this ? But can you create it for a different instrument than the current one ? Then I would change the trailing stop in the secondary OnBarUpdate via AtmStrategyChangeStopTarget.

    Or maybe Account.Submit(order) , where order was created with the name of a ATMStrategy?

    #2
    Yep, use EnterLong,

    EnterLong(int barsInProgressIndex, int quantity, string signalName)

    It's there, study the helpguide carefully.

    Comment


      #3
      Hello Derjan,

      The Calculate setting controls when OnBarUpdate() is updated. This can be .OnPriceChange or .OnEachTick to trigger updates intra-bar.


      TickReplay is necessary for this to work in Historical; 1-tick intra-bar granularity is necessary for orders to fill intra-bar in Historical.


      AtmStrategy methods can be used in real-time only, but would still need the calculate setting to run intra-bar.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        hi, i hade the same problem:
        Hello, first my english is far from perfect. On testing my Strategy i found a behavior which is not clear for me. I wrote an example which produce this behavior. CancelOrderSample.cs In the Case, the First order is fill, i will cancel the second order. But this second Order is still alive until end of the bar, and will be

        Comment


          #5
          Hello SpikeLGWG,

          Looks like you are getting help with NinjaTrader_Kate in another thread. I'll ping her to let her know you have another post and will offer any insight I may to assist.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello,
            my Problem was solved, it was for derjan or bltdavid as solution.

            Kate helps me to get this solution.

            Thanks.

            Comment


              #7
              Thanks. I could also solve my problem. Actually I was wrong in thinking that if I execute EnterLong() from a high frequency primary series for another lower frequency (eg 5 minute bars) instrument, that NT would wait until the 5 minute bar is finsihed. But it seems that if I call EnterLong from whatever Dataseries , it should always be executed in that moment and is independant from the timeframe that is associated with the target instrument

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              90 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              152 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              80 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              53 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              63 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X