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

SetTrailStop in execution context?

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

    SetTrailStop in execution context?

    Having Trouble putting the NT8 SetTrailStop in the execution context and tying it together to the entry signals...any help?

    #2
    Hello rickyblah12,

    SetTrailStop() should be called before the entry order is placed (such as in OnStateChange() in State.Configure, or in OnBarUpdate() occuring before the entry is placed)



    For example:
    Code:
    SetTrailStop("longEntry1", CalculationMode.Ticks, 10, false);
    EnterLong("longEntry1");
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok thank you Chelsea...where it says
      "longEntry1" do I put the signal name or exit name there?

      Comment


        #4
        Hello rickyblah12,

        The fromEntrySignal of the exit order needs to match the signalName of the entry order.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          ok does it matter if theres space in between the strings or no? example a entry name is LongPostion and string name is "Long Position"

          Comment


            #6
            Hello rickyblah12,

            Yes, spaces are allowed in strings.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Its not working

              Comment


                #8
                Hello rickyblah12,

                What is not working?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  what if Im doing a limit order ?

                  Comment


                    #10
                    Hello rickyblah12,

                    Limit orders can also use a signal name and exit orders can use the from entry signal of that limit entry.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by FishTrade, 05-13-2024, 11:11 PM
                    3 responses
                    11 views
                    0 likes
                    Last Post FishTrade  
                    Started by Graci117, Yesterday, 09:02 PM
                    1 response
                    12 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by ETFVoyageur, Yesterday, 07:55 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post ETFVoyageur  
                    Started by janio973, Yesterday, 07:24 PM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by aligator, 01-06-2022, 12:14 PM
                    4 responses
                    250 views
                    0 likes
                    Last Post john_44573  
                    Working...
                    X