Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close all

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

    Close all

    Hello all,
    I have 4 Questions,
    I use this code to exit all 3 minutes before the close
    ExitOnClose =
    true;
    ExitOnCloseSeconds =
    180;
    When I run Market reply and reach the end of the day I still see unrelized PL = 324 for example , and positions = 1L , which means the position not closed when market close , how to solve that,
    2nd Q

    I noticed that when I use SetStopLoss ,SetProfitTarget ,SetTrailStop ,
    I get more positions ( I want only to have one opened position i.e one contract ) but I get many contracts short or long .

    3rd
    How to check how many opened positons I have and if they are hort or long

    4th
    How to exit all positions at once , You have ExitShort(); and
    ExitLong(); but I want something like
    ExitAll();

    Thanks
    Last edited by rad70; 04-21-2009, 04:39 PM.

    #2
    Hi rad70, to check your positions use the Positions tab in the Control Center, if you want to exit all use the 'Flatten everything' command from the File menu in the Control Conter, unfortunately there's no flatten all from NinjaScript command.

    For the positions mismatch you report, please make sure run your strategies properly synched - more on this topic can be found under this link - http://www.ninjatrader-support.com/H...tPosition.html

    Comment


      #3

      How to check how many opened positons I have and if they are short or long and the unrelized P&L for each opend position using NT script

      Comment


        #4
        You for a single instrument strategy you can work with Position.MarketPosition - http://www.ninjatrader-support.com/H...tPosition.html

        and Position.GetProfitLoss - http://www.ninjatrader-support.com/H...rofitLoss.html

        For a Multi Instrument strategy, please use Postions - http://www.ninjatrader-support.com/H...Positions.html

        Comment

        Latest Posts

        Collapse

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