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

Strategies ability to see Control-Center_Strategies_Acct.position=True or False?

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

    Strategies ability to see Control-Center_Strategies_Acct.position=True or False?

    Hello,

    I want the Strategies (more than 1 per instrument) I have been running to be able to see if Control-Center; Strategies Tab, Acct.position: is True, or False. If the Strategy is in Sync I will allow it to trade if not I will have the Strategy Stop until sync equals True.
    Is there a bit of code that I can reference in my Strategy to see if it is Sync True or False? For instance if I have a Print function, it’s output would either be true .or. false.

    Best regards,
    Geoffrey B.
    Last edited by GTBrooks; 02-24-2019, 09:11 PM.

    #2
    Hello Geoffrey,

    Thank you for your note.

    You can compare the strategy Position with the PositionAccount. If they are not the same MarketPosition and Quantity then they are not in sync.

    Below are links to the help guide.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I have tried calling Account Positioning comparison to Strategy Position, and even when the Account holds a position it Prints 0. i am able to call Strategy position just fine, it prints the correct Strategy Position. I am using the same method to call both Strategy, & Account Position.
      Is there a particular way to get NinjaTrader to print Account Position, for the instrument the Strategy is trading on?

      the work around is appreciated, BUT I read that you can call any Control Center columns. If what I read is true there is a Programatic way to call and see if the Strategy is in Sync or not.
      Last edited by GTBrooks; 02-25-2019, 08:20 AM.

      Comment


        #4
        Hello GTBrooks,

        Can you provide a link to the help guide that states you can call any Control Center columns? I am not aware this is possible.

        Some properties are available such as account items listed in the AccountItems page in the help guide. You can also loop through the orders and executions of an account through the addon approach.
        However, the Strategies listed on the strategies tab, and the items in the Log are not available to NinjaScript.

        I'm not aware of any property that says if a strategy is sync with the account internal in NinjaScript Strategies. This information is provided, however, with the Position and PositionAccount objects.

        Below is a link to a video that demonstrates the PositionAccount is accurate.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you; for the Google dock, I saved it onto my drive. I am using that bit of code in the place of the SYNC logic I had in place and the Strategies are no longer stepping on each other’s feet. Great solution.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by BarzTrading, Today, 07:25 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by EB Worx, 04-04-2023, 02:34 AM
          7 responses
          161 views
          0 likes
          Last Post VFI26
          by VFI26
           
          Started by Mizzouman1, Today, 07:35 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Radano, 06-10-2021, 01:40 AM
          20 responses
          616 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by i019945nj, 12-14-2023, 06:41 AM
          6 responses
          68 views
          0 likes
          Last Post i019945nj  
          Working...
          X