Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change SL/TP size in chart and transfer to strategy logic

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

    Change SL/TP size in chart and transfer to strategy logic

    Hi, i would like to change the qty of an order from the chart manual, after it has been placed by a strategy. How can i best read out this new value in the strategy?
    Would that work best in OnOrderUpdate() with store the "quantity" in a variable, or is there another way?

    Click image for larger version

Name:	Screenshot_2.jpg
Views:	331
Size:	18.0 KB
ID:	1129213​​


    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #2
    Hello sidlercom80,

    This would not be able to be done by using a Strategy, that will only see updates it makes to the orders. Any manual changes would not be observed by the script. You could use an indicator with the addon account to do this type of interaction. Watching the account directly would let you observe all order events like manual changes. https://ninjatrader.com/support/help...ount_class.htm

    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello sidlercom80,

      This would not be able to be done by using a Strategy, that will only see updates it makes to the orders. Any manual changes would not be observed by the script. You could use an indicator with the addon account to do this type of interaction. Watching the account directly would let you observe all order events like manual changes. https://ninjatrader.com/support/help...ount_class.htm

      I look forward to being of further assistance.
      Hi _Jesse, I use my own PositionUpdate which is handled by the OnOrderUpdate() method, so I can't access the internal strategy position, or did I get something wrong?

      From another post discussed with _Jim: you do not have to worry about the strategy position stating it is out of sync because the strategy is not following the internal strategy position. It would be following the Position object we created within the strategy, that is updated with OrderUpdate events.

      https://ninjatrader.com/support/foru...kers-api/page2
      sidlercom80
      NinjaTrader Ecosystem Vendor - Sidi Trading

      Comment


        #4
        Hello sidlercom80,

        The comments Jim provided are for a different subject, that relates to how the override is called in relation to how the broker provides that information.

        OnOrderUpdate is not called for manual orders or manual changes, you would need to avoid using a strategy to execute this type of goal. Strategy overrides are based on the changes which the strategy makes and not what you are doing outside of the strategy.

        If you want to make a tool that works with manual changes you could use an indicator for that purpose and the addon account to work with the manual orders/events/changes. Strategies are generally intended to work for you and without your interaction based on its virtual information.

        Please let me know if I may be of additional assistance.




        Comment


          #5
          Hi _Jesse, I only need the changes for already submitted orders and not for a new order. My solution is:
          Code:
          protected override void OnOrderUpdate(...) 
          //OrderState Working
          if (orderState == OrderState.Working)
          {
          targetPrice = limitPrice;
          quantityTP = quantity;
          }
          sidlercom80
          NinjaTrader Ecosystem Vendor - Sidi Trading

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          20 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          119 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          63 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          45 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X