Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by algospoke, Yesterday, 06:40 PM
      2 responses
      22 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      45 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      21 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      181 views
      0 likes
      Last Post jeronymite  
      Working...
      X