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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X