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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      77 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X