Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Positions

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

    Positions

    Hi,

    When I ask in a script for Position.Quantity I get the current position held by the current script strategy. Let's say I have two strategies attached to the same chart: Is there a way to get from any of the strategies the whole Position.Quantity of all attached scripts to that same chart ?

    Thanks

    #2
    Hello Agenor,

    Thank you for your note.

    This is correct. The Position will get the running instance of the strategies position.

    To get all the positions open you will need to query the account positions.
    Note that this is unsupported programming.

    Below is a sample on how to do this -
    http://www.ninjatrader.com/support/f...ad.php?t=55718

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Ok, thanks for that, but not exactly what need. I think that the solution will be to put all stragies in the same script...This code works only in real-time, so won't be possible to backtest it...

      Another question: Is there a way to know through script the current result $ of an account in the current session ? Also is it possible to know the current risk of an account ?

      Comment


        #4
        Agenor,

        The strategies performance can be found through TradeCollection and TradePerformance -
        TradeCollection
        TradePerformanceValues
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        60 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X