• 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

Issue with immediately submit

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

    Issue with immediately submit

    Hello!!

    I will try to explain my problem through an example.

    If I make a long position ("2L") and I disconnect the strategy, I let some time pass. During that time historical trades open and close. But when I connect the strategy using immediately submit, the last position is long but with a different quantity ("5L"). The strategy will seek to sell the 5L. but I don't have that amount in my account and I don't want it to go short.

    How should I operate so that my strategy knows how much to sell? I have other strategies operating on that instrument so I cannot use adopt account position.

    Thanks!

    #2
    Hello 7robert,

    Lets break this down a bit.

    We know we're using immediately submit, but are we using the synchronize account?
    https://ninjatrader.com/support/foru...541#post811541

    With immediately submit without account sync ninjatrader isn't going to send any orders to the account and the strategy position assumes you know what you are doing with the account. The strategy position and account position can be out of sync.
    https://ninjatrader.com/support/foru...660#post792660
    https://ninjatrader.com/support/help...ediatelySubmit

    Is intra-bar granularity added to the script (with TickReplay for any indicators)?
    https://ninjatrader.com/support/foru...182#post783182
    https://ninjatrader.com/support/foru...377#post773377


    So you are long 2. Is this from a previous run of the strategy or manual orders placed? (i.e. does ninjatrader recognize the orders and resume the orders?)

    The strategy is enabled and it calculates long 5.

    At this point the account is still long 2? Without the sync this stays the case.

    Last, you mention there would be sells. This wouldn't take place. The account is long 2, the strategy calculates long 5.
    If the sync is on, then an order is sent to buy 3. This increase the long position of the account from long 2 to long 5 with a synchronization order.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi again Chelsea

      If the last historical trade was 5L and my account is in 2L I don't want to buy 3L, I just want to sell my 2L.

      Comment


        #4
        Hello 7robert,

        To confirm, you would like custom logic where if the account does not match the strategy, you would like an order to flatten the account and leave the strategy in its calculated position where the two will not be in sync, is this correct?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Let me explain myself better, if the last historical trade was 5L and my account is in 2L I don't want to buy 3L, I just want the strategy sell my 2L instead of 5L. Leaving my account and strategy in flat.

          Comment


            #6
            Hello 7robert,

            If the account and strategy are not in sync then the accounts would need to put back to flat separately using different approaches.

            You could choose to always start the strategy flat and use the synchronize account so the account also always starts flat using the tip from the forum link in post #2.


            Alternatively, you could check the PositionAccount.MarketPosition and compare this to the strategy's Position.MarketPosition on the last historical bar and decide to place a historical order in the strategy and use the account sync.
            https://ninjatrader.com/support/help...etposition.htm

            Or without using the account you could separately send an order using the addon approach to the account outside of the strategy to flatten the account, and also send an internal historical order to the strategy to flatten the strategy position.
            https://ninjatrader.com/support/help...reateorder.htm
            https://ninjatrader.com/support/help...-us/submit.htm
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ct_fx, Today, 05:14 AM
            0 responses
            5 views
            0 likes
            Last Post ct_fx
            by ct_fx
             
            Started by Beauregard, Today, 04:36 AM
            0 responses
            5 views
            0 likes
            Last Post Beauregard  
            Started by fx.practic, Today, 04:34 AM
            0 responses
            5 views
            0 likes
            Last Post fx.practic  
            Started by thomaspartyof10, Today, 02:33 AM
            0 responses
            8 views
            0 likes
            Last Post thomaspartyof10  
            Started by ArmKnuckle, Today, 01:59 AM
            0 responses
            13 views
            0 likes
            Last Post ArmKnuckle  
            Working...
            X