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 cmtjoancolmenero, Yesterday, 03:58 PM
    4 responses
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Brevo, Today, 01:45 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by rjbtrade1, 11-30-2023, 04:38 PM
    2 responses
    74 views
    0 likes
    Last Post DavidHP
    by DavidHP
     
    Started by suroot, 04-10-2017, 02:18 AM
    5 responses
    3,021 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Stanfillirenfro, Today, 07:23 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X