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 StealthM93, Today, 10:43 AM
      0 responses
      1 view
      0 likes
      Last Post StealthM93  
      Started by galsermil, Today, 10:21 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by MatthewLesko, Today, 08:42 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by dallasstarsfan, Today, 08:22 AM
      1 response
      27 views
      0 likes
      Last Post dallasstarsfan  
      Started by 309338, Yesterday, 12:06 PM
      0 responses
      30 views
      0 likes
      Last Post 309338
      by 309338
       
      Working...
      X