Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

If positition.. how many lots

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

    If positition.. how many lots

    Hi NT Team,

    How to do return the size of a position (if i have an active) in NinjaScript ?

    Thanks

    #2
    Hello akvevo,

    Thanks for opening the thread.

    You can return the the current position size of a strategy using the Quantity property from Position. For a multi series NinjaScript, you can use Positions, and for the overall account, you can use PositionAccount.

    Position.Quantity - http://ninjatrader.com/support/helpG...n_quantity.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thanks Jim,

      What if I am not using a "strategy" ?

      I just want to apply an "indicator" to a symbol.. that returns the number of lots for an open position if there is one, else return 0.

      Is that possible ?

      My ultimate goal is to add a coloumn to my market analyser (an indiciator coloum) that = number of lots of open positions * margin >> just to tell me how much $$$ iam using for margin for that symbol.

      Comment


        #4
        Hello akvevo,

        Thanks for your reply.

        Position refers to the position of the strategy. This object as well as Positions and PositionAccount are only available in a strategy.

        You could come up with a solution by having a strategy read these values and store them to static variables of an AddOn and then have your Indicator read these values from the AddOn and then plot them.

        Here is an example of how you can share data between NinjaScripts: http://ninjatrader.com/support/forum...104#post457104

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        656 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        371 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        579 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X