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 moving stop and target order

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

    Manually moving stop and target order

    i'm using managed order to place my stop and target.
    SetStopLoss("LE1", CalculationMode.Ticks, OrderStopTicks_1, false);
    SetProfitTarget("LE1", CalculationMode.Ticks, OrderTargetTicks_1);

    Once i enter the long position it places the stop and target order properly , and when i try to move my stop or target order manyally strategy brings it back to same price. is there a way to handle this. i do want to use SetStopLoss & SetStopLoss concept. ​

    #2
    Hello pwtrades,

    Thanks for your post and welcome to the NinjaTrader Forums!

    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.



    Also, please refer to the attached example strategy demonstrating how this could be accomplished.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      thanks Brandon, i am aware about ExitLongStopLimit and isLiveUntilCanceled as possible approach and have used it few times it past, however it becomes complicated when dealing with multi positions and have to account for partial fills scenarios as well & dependencies on Rithimic API order update issues does not help as well.

      I like setStoploss approach and knowing that NT handles the entire order handling my job is to set and let NT handle it. the only part missing is at times i want to move my target *manually*.

      Comment


        #4
        Hello pwtrades,

        Thanks for your notes.

        Unfortunately, if you are using Set methods then when OnBarUpdate() triggers the stops/targets that you manually moved will be moved back to their original position. There would be no means available for preventing this behavior from occurring when using Set methods.

        To be able to manually modify stops/targets on the chart you would have to use Exit methods with isLiveUntilCancelled set to true as noted in post # 2.

        If you are using Rithmic, you could take a look at the RithmicIBFriendlExamples reference samples on this forum thread: https://forum.ninjatrader.com/forum/...72#post1206372
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        92 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        6 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        7 views
        0 likes
        Last Post Belfortbucks  
        Started by zstheorist, Yesterday, 07:52 PM
        0 responses
        7 views
        0 likes
        Last Post zstheorist  
        Working...
        X