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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X