Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position.Close()

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

    Position.Close()

    Is the Position.Close() method supported? I only ask because I don't see it in the documentation. If it is supported, does it do what it sounds like and simply close the underlying position? Thanks.

    Edit: Also, if it is supported and it does work as I guessed above, will it also cancel any SetStopLoss() or SetProfitTarget() orders that might be attached to it?
    Last edited by Radical; 06-20-2012, 07:38 PM.

    #2
    Hi Radical, it would unfortunately not be officially supported as NS method - it's calling the Close algorithm you see for example on your DOM and ChartTrader, this should cancel working exit orders, close the position and disable the strategy.

    Comment


      #3
      Thanks Bertrand, I wasn't expecting it to disable the strategy, but that will still be useful. I have another question that's sort of related, so I guess I'll ask it here. If I use "ExitLong()" like this:

      ExitLong(1, quantityX, "exit", "entry111");

      but the signal name "entry111" doesn't exist, would the above line result in an error, or would it result in nothing happening, and the next line being executed as usual?

      Comment


        #4
        If the tagged to entry name would not exist, it should just ignore the command but would not disable your strategy or impact any further following code lines.

        Comment

        Latest Posts

        Collapse

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