Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing Account values / global stats

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

    Accessing Account values / global stats

    Hi,

    I am running a strategy on a large basket of instruments. I want to open positions in order of signal occurrence up until a fixed percentage of account has been allocated, or until a fixed number of positions have been opened.

    Could you please advise which functions to look at relating to extracting Account balance/details from within a strategy.

    Also is there a way of accessing global stats such as the total number of positions open across all strategies being run?

    Thanks

    #2
    Hello abfc123,

    You can access these items using GetAccountValue()

    There is no cross communication between strategies. You are not able to access position quantity outside of the strategy instance you're working in. You may consider writing this information to a file and tracking from there.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok, thanks.

      Regarding the written file maintaining persistence, is there a recommended 'heartbeat' checking process.
      I was considering using my application that reads a txt file at specified interval and mails/sms's if interval too large between updates.
      From which function would you recommend updating this file? OnBarUpdate would be too regular in the case of a tick based strategy.

      I have also set up a mail alert configuration, I am able to receive the test email but when the strategy is running live I see a log message the it had an invalid HELO. What needs to be done in regard to the SMTP setup?

      Thanks.

      Comment


        #4
        You could update in OnBarUpdate() with CalculateOnBarClose set to false, this will give you intra-bar updates on each tick. I replied already to the SMTP question you sent directly to support.

        Thanks,

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, Yesterday, 01:02 PM
        0 responses
        27 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        18 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        160 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        148 views
        2 likes
        Last Post CaptainJack  
        Working...
        X