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 Ripoz4200, 01-29-2024, 03:21 PM
    6 responses
    2,305 views
    0 likes
    Last Post Lancer
    by Lancer
     
    Started by paulmuldoon, 09-03-2024, 08:24 PM
    5 responses
    55 views
    0 likes
    Last Post Lancer
    by Lancer
     
    Started by markjaffe, Today, 12:57 PM
    0 responses
    6 views
    0 likes
    Last Post markjaffe  
    Started by arbeydario, 09-03-2024, 08:37 PM
    4 responses
    31 views
    0 likes
    Last Post arbeydario  
    Started by Christopher Leggit, Today, 11:13 AM
    0 responses
    10 views
    0 likes
    Last Post Christopher Leggit  
    Working...
    X