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

Set trailstop to 0?

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

    Set trailstop to 0?

    Is that valid? My inital trail stop is 12. However, if the order goes against my trade, can I set trailstop to zero? I want out *immediately*, I've tried ExitLong/Short() but I'm not happy with the fill. Right now I set to 1, I tried 0 seems to work, was wondering if that was just by chance.

    #2
    imported post

    Should work, we have not tested though.

    Comment


      #3
      imported post

      However, I would not suggest this approach since at a value of zero, the trail stop running with CalculateOnBarClose = false will trail the last traded price, there is an extremely high chance the trail stop will be modified to an invalid price and rejected by the exchange and possibly terminating your strategy due to an order generated error.

      Ray
      RayNinjaTrader Customer Service

      Comment


        #4
        imported post

        So, what would be the best way out when I want out right at that moment?

        Comment


          #5
          imported post

          There is no choice but to go to Market via ExitLong/Short. Even if you could move the stop to a valid price, you will also get out at market so the exit price should be the same in both cases.
          RayNinjaTrader Customer Service

          Comment


            #6
            imported post

            Yeah, from my tests, ANYTHING but ExitLong/Short() yields a better fill. That shouldn't be I understand. This is with MarketReplay replay'd with the different settings each time.

            Comment


              #7
              imported post

              You could use SetProfitTarget() and modify this order's price below market when long in order to get filled right away. Just have an initial target price far outside since the only purppose for this is to exit the market quick.

              Ray
              RayNinjaTrader Customer Service

              Comment


                #8
                imported post

                Ah! Didn't think of that one. I have a 30 point target(wishful thinking) built-in as it turns out. I'm gonna have-at-it! Thanks.

                Comment


                  #9
                  imported post

                  Why would SetProfitTarget fill better than ExitLong/ExitShort?

                  Would ExitLongLimit/ExitShortLimit work as well as SetProfitTarget?

                  KBJ

                  Comment


                    #10
                    imported post

                    Well, I'm trying this now, 'cause'n the other ain't workin'...could be me, not sure yet.

                    Comment


                      #11
                      imported post

                      Question, what is "fromEntrySignal"?

                      Comment


                        #12
                        imported post

                        ... refers to the entry signal which could be tagged like e.g. "Entry1". fromEntrySignal then could be "Entry1" to exit the position tagged by "Entry1".

                        Comment


                          #13
                          imported post

                          how's that diff. from "signalName"? ie:

                          EnterLongLimit(numContracts, Low[0], "mySignalName");

                          That's how my orders get entered.

                          so, ExitLongLimit(numContracts, Close[0], "mySignalname", ??);

                          where does "fromEntrySignal" get generated?

                          Comment


                            #14
                            imported post



                            Note: signal names are case sensitive: mySignalName!= mySignalname

                            Comment


                              #15
                              imported post

                              That was a typo. My question is, if you look at the help guide under EnterLongLimit() there is no overload that includes "fromEntrySignal", so, hence my question, where does that get assigned?...what am I missing?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by traderqz, Today, 12:06 AM
                              10 responses
                              18 views
                              0 likes
                              Last Post traderqz  
                              Started by algospoke, 04-17-2024, 06:40 PM
                              5 responses
                              46 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by arvidvanstaey, Today, 02:19 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Zachary  
                              Started by mmckinnm, Today, 01:34 PM
                              3 responses
                              5 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by f.saeidi, Today, 01:32 PM
                              2 responses
                              9 views
                              0 likes
                              Last Post f.saeidi  
                              Working...
                              X