Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit all positions based on open P/L

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

    Exit all positions based on open P/L

    I need to be able to enter a script which allows me to exit multiple markets based on open P/L. Thanks for any help in advance.
    Last edited by thomaskrawczyk; 08-01-2014, 07:16 AM.

    #2
    Hello Thomaskrawczyk,

    Thank you for your post.

    You can use the Positions function within NinjaScript to access the other positions that they strategy has. You would then use GetProfitLoss() method to now the PnL
    http://www.ninjatrader.com/support/h...?positions.htm

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

    Comment


      #3
      I looked over the script in the link you sent- if I am manually entering a spread and want to exit if both markets reach a total profit or loss of x does that script still apply? It looks like the script had to enter specific markets/time frame. And I just want to focus on open P/L. Something like =IF open P/L is +200.00, -200.00 exit all positions?

      Comment


        #4
        Thomaskrawczyk,

        The Positions will apply to an active strategy. If you are placing orders manually you would not be able to access these through the script in any supported capacity.

        There is an unsupported method to querying your accounts positions, however we have not tested this for getting PnL nor do we have documentation on the subject.
        The method can be found below -
        http://www.ninjatrader.com/support/f...ad.php?t=55718
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by hazylizard, Today, 08:38 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by geddyisodin, Today, 05:20 AM
        2 responses
        17 views
        0 likes
        Last Post geddyisodin  
        Started by Max238, Today, 01:28 AM
        5 responses
        45 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by giulyko00, Yesterday, 12:03 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by habeebft, Today, 07:27 AM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Working...
        X