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 fernandobr, Today, 09:11 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by timmbbo, Today, 08:59 AM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by KennyK, 05-29-2017, 02:02 AM
    2 responses
    1,281 views
    0 likes
    Last Post marcus2300  
    Started by itrader46, Today, 09:04 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by bmartz, 03-12-2024, 06:12 AM
    5 responses
    33 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Working...
    X