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

Manual modification of a strategy

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

    Manual modification of a strategy

    Hello!

    I have a strategy that places trades automatically.

    I am wondering if once a trade is placed automatically, I can modify manually the profit target or stop loss without having these flipping everytime a bar closes.

    Thanks in davance!

    #2
    Hello Stanfillirenfro,

    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 of Set methods, 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.

    Let us know if we may assist further.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Many thanks Brandon. I will implement it and revert to you in case of problem.

      Many thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ZeroKuhl, Today, 04:31 PM
      0 responses
      13 views
      0 likes
      Last Post ZeroKuhl  
      Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
      54 responses
      5,337 views
      0 likes
      Last Post Gaterz
      by Gaterz
       
      Started by ETFVoyageur, 05-07-2024, 07:05 PM
      11 responses
      76 views
      0 likes
      Last Post -=Edge=-  
      Started by _Zero_, 04-10-2020, 03:21 PM
      145 responses
      7,900 views
      6 likes
      Last Post johng2
      by johng2
       
      Started by TheTradingMantis, 01-19-2023, 02:05 AM
      43 responses
      923 views
      0 likes
      Last Post jmagaia
      by jmagaia
       
      Working...
      X