Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to allow users to be able to move/update stops that strategy has submitted.

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

    Trying to allow users to be able to move/update stops that strategy has submitted.

    Hi, I have been working on a strategy and one of the things I would like to be able to do is once a position is established and the stop and pt is in place, I want to be able to drag the stop around and change the value it sits at. However my strategy (calculates on bar complete) repositions the stop at the complete of each bar back to where it determines it should be. I thought I could simply stop the strategy from doing this, but it appears to be Ninja doing the order management not the code in the strategy. My second attempt was to have the strategy listen to changes to the stop that occur when the user moves the stop and the order is updated and then submit those changes as its own. I seem to have issues with that approach as well. The documentation says to overide OnOrderUpdate, but when I do, with the code from the nt8 documentation I get this error:

    'NinjaTrader.NinjaScript.Strategies.mystrat.OnOrde rUpdate(NinjaTrader.NinjaScript.Strateg ies.mystrat.Order, double, double, int, int, double, NinjaTrader.Cbi.OrderState, System.DateTime, NinjaTrader.Cbi.ErrorCode, string)': no suitable method found to override

    Any help on this error or alternate approaches for allowing the user to influence the stop price of a strategy place stoploss would be much appreciated.

    #2
    Hello gkulick,

    Thanks for your post.

    When using Set methods, orders will move back based on the strategy's Calculate mode. For example, if you use a Calculate mode of OnBarClose, the Set methods would move back to their original position on the close of a bar.

    Instead, you would need to use Exit methods such as ExitLongStopLimit with the isLiveUntilCanceled property set to true and ensure that your logic is only calling the Exit methods once so that the order does not reset.

    When the isLiveUntilCanceled property is set to true the order will NOT expire at the end of a bar but instead remain live until the CancelOrder() method is called or its time in force is reached.

    Please refer to the help guide link below regarding Exit methods and the isLiveUntilCanceled property.

    https://ninjatrader.com/support/help...gstoplimit.htm

    Also, please refer to the attached example strategy demonstrating how this could be accomplished.​
    Attached Files
    <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


      #3
      Thanks this has been really helpful

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X