• 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

NT8 strategy using auto entry but manual exit of position.

Collapse
X
 
  • 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!

    Greg

    #2
    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.

    Code:
    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)
    		return;
    	if(Position.MarketPosition == MarketPosition.Flat)
    		EnterLong("MyEntry");
    }
    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

    Comment


      #3
      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.

      Greg

      Comment


        #4
        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

        Comment


          #5
          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!

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

          Comment


            #6
            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:

            https://ninjatraderecosystem.com/Vendors/Consultants#81

            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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Kelsoner, Today, 11:31 AM
            0 responses
            3 views
            0 likes
            Last Post Kelsoner  
            Started by srbdoc, Today, 10:48 AM
            2 responses
            5 views
            0 likes
            Last Post srbdoc
            by srbdoc
             
            Started by Mttzern, Today, 10:42 AM
            0 responses
            6 views
            0 likes
            Last Post Mttzern
            by Mttzern
             
            Started by markbb10, Today, 06:55 AM
            2 responses
            8 views
            0 likes
            Last Post markbb10  
            Started by sgordet, Today, 09:58 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Working...
            X