Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Manually scaling out of a position that was put on by a strategy

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

    Manually scaling out of a position that was put on by a strategy

    I'm currently attempting to use OnPositionUpdate() to update the quantity of a stop using ExitLongStopMarket() and ExitShortStopmarket() but it seems as though this event does not trigger when I manually scale out of the position.

    In the past I've used WPF buttons for the scale but it would be really nice if I could just do that from chart trader.

    Is there a way to do this?

    #2
    One thing that seems to be working is I loop through draw objects for lines labeled TP1-3 and use those to place limit orders to exit. I can drag and drop them to the current price and that scales out.

    Comment


      #3
      Hello WalterSkinner,

      Thanks for your post.

      OnPositionUpdate() is called when there is a change in the strategy's position, not the Account position. Strategy positions are separate from actual Account positions.

      Strategy vs. Account Position: https://ninjatrader.com/support/help..._account_p.htm

      Note that strategies are only able to see orders that are placed by that specific instance of that strategy. Strategies cannot see orders that are manually placed.

      If you want to access the actual Account position, you could use <Account>.PositionUpdate.

      See this help guide page for information about <Account>.PositionUpdate and sample code: https://ninjatrader.com/support/help...tionupdate.htm

      Let us know if we may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      172 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      88 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      129 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      208 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      185 views
      0 likes
      Last Post CarlTrading  
      Working...
      X