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

Trailing Buy Market order?

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

    Trailing Buy Market order?

    Is there a method to submit a trailing buy order for back-testing? manual or otherwise....

    or maybe to manipulate a MIT into a trail for the same purpose?

    #2
    Hello HaveGunsWillTravel,

    The SetTrailStop() method submits a trail stop.


    Note, this will update on bar close unless the order is submitted to a 1-tick series for intra-bar granularity (with TickReplay).


    This can also be controlled with logic with exit orders or an MIT order.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you, could you add a feature request ID# for 'Enter Long Position with Trail...' into strategy builder? Thank you.

      Comment


        #4
        Hello HaveGunsWillTravel,

        I'm not certain I am understanding. How would this be different than the SetTrailStop added on the Stops and Targets page of the Strategy Builder?

        Are you wanting to move the page this is on?

        Below is a link to the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video if you are unfamiliar with the Strategy Builder.
        NinjaTrader's Strategy Builder empowers traders of all levels with point-and-click automated trading strategy development. Create your own advanced automated...
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I do not want to exit with a stop (as with stops and targets), but I want to test entering with a trailing buy... and be able to back test it. Entering with a trail is not an option right now.

          Example:
          signal happens:
          place a trail just above price, to buy, so that I can test buying into a retrace.

          Am I making sense? As far as I understand, using trails in the 'stops and targets' section will not facilitate this as of now, it only offers "Exit XYZ trail..."

          Comment


            #6
            EnterLongLimit(DefaultQuantity, (GetCurrentBid(Default input) -5), "");
            It wouldnt be a "trailing buy" it would be a limit buy on the bid (cheaper) minus whatever distance you want in ticks, pips, percent, etc...

            Comment


              #7
              Originally posted by ezrollin View Post
              EnterLongLimit(DefaultQuantity, (GetCurrentBid(Default input) -5), "");
              It wouldnt be a "trailing buy" it would be a limit buy on the bid (cheaper) minus whatever distance you want in ticks, pips, percent, etc...
              That would simply be a limit order... Still need the part that 'trails' or changes the order price as the price moves. I should have been more specific, I thought that part was implied.

              https://www.interactivebrokers.com/e...et-touched.php

              Comment


                #8
                Hello HaveGunsWillTravel,

                A "tailing order" would be an order that updates and gets closer to the current market price.

                ezrollin is stating that if you call EnterLongLimit a Buy limit order will be placed at that price. As the market moves, GetCurrentBid will return new values, and the but limit order will always stay 5 points from this price.

                If EnterLongLimit is called with the same entry signal name, and the order is active, the order will be updated. This is how you can make a "trailing entry" or an entry that chases after the current market price.

                So, you could consider implementing your own trailing/chasing behaviors using Conditions and Actions to check...

                > If the current market price increased X ticks from the last price the stop was updated

                and do the following actions...

                > Update a variable that represents the last price the entry was moved
                > Update a variable that represents the price that the entry order should lie.

                Then you can have another condition set check if you are Flat, and then call EnterLongLimit with the desired limit price.

                Then you can have another condition set that checks if you are Long and then resets the temporary variables.

                Market Position comparisons - https://ninjatrader.com/support/help...ionComparisons

                Variables can be created in Inputs and Variables page of the Strategy Builder, and can be read in Conditions and set in Actions.

                We look forward to assisting.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Jim View Post
                  ezrollin is stating that if you call EnterLongLimit a Buy limit order will be placed at that price. As the market moves, GetCurrentBid will return new values, and the but limit order will always stay 5 points from this price.

                  If EnterLongLimit is called with the same entry signal name, and the order is active, the order will be updated. This is how you can make a "trailing entry" or an entry that chases after the current market price.
                  Thats exactly what I meant. You can have your limit buy order stay away from the current bid price and flirt with staying away and trying to buy it at the bottom and it'll only fill if huge orders come in to smack the price down into that cheaper price. Then you've bought into the low of the wick. thanks

                  Comment


                    #10
                    Originally posted by ezrollin View Post
                    Thats exactly what I meant. You can have your limit buy order stay away from the current bid price and flirt with staying away and trying to buy it at the bottom and it'll only fill if huge orders come in to smack the price down into that cheaper price. Then you've bought into the low of the wick. thanks
                    Ok, I was under the impression getting the bid as the variable would move the order back up also if the bid increased?...I will play with it to see how it works because I am still not completely understanding what prevents the limit from moving back up by reading this. Since the 'getbid' would be on each bar update right? then update the limit to be '5' above? Thanks for the help.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by algospoke, Yesterday, 06:40 PM
                    2 responses
                    20 views
                    0 likes
                    Last Post algospoke  
                    Started by ghoul, Today, 06:02 PM
                    3 responses
                    14 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    45 views
                    0 likes
                    Last Post jeronymite  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    7 responses
                    21 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by AttiM, 02-14-2024, 05:20 PM
                    10 responses
                    181 views
                    0 likes
                    Last Post jeronymite  
                    Working...
                    X