Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

IsAdoptAccountPositionAware

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

    IsAdoptAccountPositionAware

    The doc HERE says
    Only set to true if you have specifically programmed your strategy to be able to adopt account positions.
    Where is the documentation on how to program a strat to do that?
    I have a real time strategy:

    In OnStateChange:

    Code:
    Calculate = Calculate.OnPriceChange;
    In OnBarUpdate....
    Code:
             
    if (State != State.Realtime)
        return;
    I sometimes want my strat to hold a position over a weekend when I usually lose network connection to NT server and must reconnect. In this situation I need my strategy virtual position to assume the existing account position when I start the strategy.

    Is it enough to just put
    IsAdoptAccountPositionAware = true;
    in my OnStateChange and then start the strategy with the "Adopt Account Position" start option?

    The documentation on the Adopt Account Position HEREis confusing to me for 2 reasons.
    1. It talks a lot about orders. In my scenario there would be no orders to consider. Only an existing account position.
    2. The sentence:
    Any remaining active strategy orders that cannot be successfully paired will be submitted live and the strategy will then try to sync your Account Position to your Strategy Position.
    Isn't that backward? Shouldn't it read sync your Strategy Position to your Account Position? Existing wording suggests to me that it's going to change the Account Position to match the Strategy Position. I want the opposite and I think that's what this feature really is but not sure because of that sentence.

    #2
    Hello Brillo,

    Below is a link to the help guide on IsAdoptAccountPositionAware.


    This must be set to true for the Adopt account position option to use on the On-startup behavior.


    When Adopt account position is selected the strategy position will be changed to match the account position meaning the account position will be synced to the strategy position.

    When synchronize account is selected (with wait until flat or immediately submit) the account position will be changed to match the strategy position meaning the strategy position will be synced to the account position.

    Below is a link to a short video that demonstrates the On-startup behavior options.



    Using Adopt account position would cause the strategy to start with the position of the account. This would not cause any protective orders to be submitted to protect that position so the strategy would not be resuming, it would only be adopting the account position.

    Below is a link to a thread that describes how to resume a strategy.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello Brillo,

      Below is a link to the help guide on IsAdoptAccountPositionAware.



      Below is a link to a short video that demonstrates the On-startup behavior options.


      I know this is an old thread, but the video is in SWF format.
      Is it possibly available in a different format that is not expired?

      Comment


        #4
        Hello DavidHP,

        Thanks for your post.

        You could find a video demonstrating startup behaviors on the forum thread linked below.



        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by aa731, Today, 02:54 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by BarzTrading, Today, 07:25 AM
        0 responses
        3 views
        0 likes
        Last Post BarzTrading  
        Started by i019945nj, 12-14-2023, 06:41 AM
        6 responses
        65 views
        0 likes
        Last Post i019945nj  
        Started by ruudawakening, Today, 12:58 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by thread, Yesterday, 11:58 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X