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 stop attachment

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

    Trailing stop attachment

    I created a indicator that follows the open price trend tick by tick and want go automatically have a trail follow the indicator until trend change. Is this an option using strategy builder?

    #2
    Hi Teebone21, thanks for your question.

    I have an example here on a break even in the strategy builder. You can take this same concept and update the stop loss to a value that changes over time instead of the average entry price.

    Please let me know if I can assist any further.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chris

      Comment


        #4
        Hello Chris,
        please could you explain:
        when StopLossMode == 0 is likely expected a stop loss set on the next tab of the SB?
        I remember a similar sample using state/ bool, is there a specific reason this sample now uses a StopLossMode/ integer ? What is the advantage?
        How would it be possible to add another exit condition working together with the breakeven when StopLossMode==1, for example exit when current price crosses low[1] ?
        thank you.

        Comment


          #5
          Hello guidoisot,

          Thanks for your post.

          When there are two condition states you can use a bool or you can use a numerical value, either way makes no difference as it is up to you as the programmer to know if you are using a bool or a numerical value.

          Yes, you can add another exit condition when the variable StopLossMode is equal to 1. You would basically copy set 4 and add the cross condition and change the exit to an ExitLong.

          Paul H.NinjaTrader Customer Service

          Comment


            #6
            thank you.
            I have added a third exit but it does not work.
            At time 16:00 there is also a trade that does not breakeven.

            Please can you help to find out why?

            BREAKEVENstrategyMANUAL02.cs

            Click image for larger version  Name:	NQ 06-20 (10 Minute) 2020_04_29 (14_50_15).png Views:	0 Size:	129.0 KB ID:	1097203
            Last edited by guidoisot; 04-29-2020, 06:54 AM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by arvidvanstaey, Yesterday, 02:19 PM
            5 responses
            14 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Started by Rapine Heihei, Yesterday, 08:25 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Mongo, Yesterday, 11:05 AM
            6 responses
            27 views
            0 likes
            Last Post Mongo
            by Mongo
             
            Started by ct, 05-07-2023, 12:31 PM
            7 responses
            206 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by wzgy0920, Yesterday, 09:53 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X