• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set OnOrderUpdate to allow manual adjustment to ProfitTarget Order

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

    How to set OnOrderUpdate to allow manual adjustment to ProfitTarget Order

    I am having the same issue needing to Manually adjust the stop loss and profit target orders once in a trade. I read something about OnOrderUpdate() which seems to imply that an updated order (which manually moving would be OrderUpdate but I need some help figuring our how to include in strategy.

    #2
    Hello DTSSTS,

    You would need to use Exit methods and you would not be able to use Set methods. (Set methods continuously update and will undue any manual changes to the order)

    Then be sure that the order is only submitted once and the script does not update the price of the order at a later time.

    A good place to do this would be from OnExecutionUpdate() or OnOrderUpdate() when the entry order's OrderState is OrderState.Filled.
    https://ninjatrader.com/support/help...tionupdate.htm
    https://ninjatrader.com/support/help...rderupdate.htm

    An example of placing orders in OnOrderUpdate can be found here. However, you would not want to include the logic that causes the trailing / chasing behavior in OnBarUpdate().
    https://ninjatrader.com/support/foru...269#post802269
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      THOUGHT this could possibly be the answer

      https://gyazo.com/0eb8ca34e40b6830d6de5aaea887f346
      not sure how to impliment

      I will read the links you posted, Thanks

      Comment


        #4
        what do i do with these ? import into ninja


        https://gyazo.com/c765ed81d6752fac3dea7bd266c450fc

        Comment


          #5
          Hello DTSSTS,

          The examples you can import and view the code and use this as working example when designing your own scripts.

          To import a NinjaScript into NinjaTrader 8 do the following:
          1. Download the script to your desktop, keep it in the compressed .zip file.
          2. From the Control Center window select Tools -> Import -> NinjaScript...
          3. Click the Desktop icon on the left to navigate to the desktop
          4. Select the downloaded .zip file -> then click Open
          5. NinjaTrader will then confirm if the import has been successful.
          Critical *Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.



          You can place orders using Atm Strategy methods with AtmStrategyCreate() using an Atm Strategy template (setup on the SuperDOM or ChartTrader) and then once the stop is working change the price of the stop with AtmStrategyChangeStopTarget().

          As a heads up, orders placed with Atm Strategy methods are basically the same as manually placed orders and do not affect the strategy position and do not trigger order methods such as OnOrderUpdate(), OnExecutionUpdate(), or OnPositionUpdate().

          Included with NinjaTrader is the SampleAtmStrategy script that demonstrates how to place orders using Atm Strategy methods.

          Below are links to the help guide on Atm Strategy Methods, AtmStrategyCreate(), GetAtmStrategyStopTargetOrderStatus(), and AtmStrategyChangeStopTarget().
          https://ninjatrader.com/support/help...gy_methods.htm
          https://ninjatrader.com/support/help...rgetorders.htm
          https://ninjatrader.com/support/help...stoptarget.htm

          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by TazoTodua, Today, 02:02 AM
          0 responses
          2 views
          0 likes
          Last Post TazoTodua  
          Started by rehema, Today, 01:29 AM
          0 responses
          5 views
          0 likes
          Last Post rehema
          by rehema
           
          Started by Papercut110, Yesterday, 11:25 PM
          0 responses
          3 views
          0 likes
          Last Post Papercut110  
          Started by cgjecv, Yesterday, 09:42 PM
          0 responses
          4 views
          0 likes
          Last Post cgjecv
          by cgjecv
           
          Started by fxRichard, Yesterday, 08:34 PM
          0 responses
          3 views
          0 likes
          Last Post fxRichard  
          Working...
          X