• 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

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.
    https://ninjatrader.com/support/help...s/position.htm
    https://ninjatrader.com/support/help...ionaccount.htm
    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.
        https://drive.google.com/file/d/14Ao...w?usp=drivesdk
        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 alextrd, Today, 01:51 PM
          0 responses
          6 views
          0 likes
          Last Post alextrd
          by alextrd
           
          Started by Boonfly8, Today, 12:10 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by NinjaTrader_PaulH, Today, 11:24 AM
          0 responses
          4 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by catulopc, Today, 10:58 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_SergeyS  
          Started by swcooke, Today, 09:20 AM
          7 responses
          22 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X