Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exiting entire position

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

    Exiting entire position

    If my strategy calls for numerous "buys" and then calls for closing the entire position because of a certain indicator event, how can you program it to know how many lots you have, and to close all of them at once?

    ExitLong("", "Exit Long on 30 Cross Above 5")

    only exits the default quantity.

    #2
    No, if you do not specify a quantity it will exit your whole position to bring you to a flat position. The code you specified uses the ExitLong(string signalName, string fromEntrySignal) syntax. This means you will only be exiting whatever entry position you had labeled "Exit Long on 30 Cross Above 5".


    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    65 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    23 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    26 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    52 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X