• 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.


No announcement yet.

Partner 728x90


NT8 strategy using auto entry but manual exit of position.

  • Filter
  • Time
  • Show
Clear All
new posts

    NT8 strategy using auto entry but manual exit of position.

    In NT7 with a Strategy running using a 12 tick trailing stop.

    Once trade is entered, I am able to "Manually Move" the stop via Super DOM or Jigsaw DOM...

    Yes, the stop also moves when a New Bar is created but I've been quick enough to adjust it again.

    Is there a way to Code the Manual Movement via "Jigsaw DOM" of a trailing stop or static stop in NT8..

    Thank You!


    Welcome to the forums, greg500!

    I see that you have posted in the NinjaTrader 8 forum and have titled your thread for NT8, so I will provide NinjaTrader 8 resources to answer your inquiry. Although the same approach is valid for NinjaTrader 7 with the exception of some different syntax.

    SetProfitTarget SetStopLoss and SetTrailStop will function with internal rules to update the stop loss to the assigned level after new bar iterations.

    To allow for a stop loss to be modified by user input, you can use the Exit order methods with the isLiveUntilCancelled overload. This way, you can submit the initial stop loss and adjust it as you please within your code, and as long as the Exit method does not get called again, the user may move the stop to any level they desire.

    I've included some sample code demonstrating how this can be done.

    protected override void OnExecutionUpdate(Cbi.Execution execution, string executionId, double price, int quantity, 
    	Cbi.MarketPosition marketPosition, string orderId, DateTime time)
    	if(execution.Name == "MyEntry")
    		ExitLongStopMarket(0, true, 1, Position.AveragePrice - 10 * TickSize, "MyExit", "MyEntry");
    protected override void OnBarUpdate()
    	// Skip Historical Processing
    	if(State == State.Historical)
    	if(Position.MarketPosition == MarketPosition.Flat)
    Publicly available documentation on the items used can be referenced below.

    OnExecutionUpdate() - https://ninjatrader.com/support/help...tionupdate.htm

    ExitLongStopMarket() (see isLiveUntilCancelled overload) - https://ninjatrader.com/support/help...stopmarket.htm

    Please let me know if I can be of further assistance.
    JimNinjaTrader Customer Service


      Hi Jim,

      Thank you so much for responding and please forgive my lack of ninja script understanding.

      I will hire a programmer to write the script in NT8.

      Question... If these conditions are written, can I manually move the Stop in the DOM?

      Sorry to be ignorant.



        Hello Greg,

        Thanks for your reply.

        If the logic is written similar to how my previous post describes, then the stop could be manually adjusted from any part of the platform that can manage orders. This would include Chart Trader, the SuperDOM and likely 3rd party AddOns that allow order manipulation.

        If it interests you, we can have a representative of our EcoSystem reach out with additional information on NinjaScript Consultants that would happy to write this script or any other at your request.

        Please let us know if this is the case.
        JimNinjaTrader Customer Service


          Hi Jim,

          Yes, if you would be so kind to have a script coder "who would know how to do this manually exit from dom",,, email or call me. Thank you for helping!

          Last edited by greg500; 04-04-2018, 01:17 PM.


            Hello Greg500,

            Thank you for your post.

            You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:


            You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

            This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem, LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

            Let me know if I may be of further assistance
            Jared M.NinjaTrader Customer Service


            Latest Posts


            Topics Statistics Last Post
            Started by shodson, 02-11-2020, 07:26 PM
            3 responses
            Last Post shodson
            by shodson
            Started by ksarin, Today, 04:31 PM
            0 responses
            Last Post ksarin
            by ksarin
            Started by ralett, Today, 03:39 PM
            0 responses
            Last Post ralett
            by ralett
            Started by koganam, Today, 03:17 PM
            1 response
            Last Post NinjaTrader_Kate  
            Started by DTSSTS, Today, 02:46 PM
            4 responses
            Last Post DTSSTS
            by DTSSTS