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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        27 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X