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 Haiasi, Today, 06:53 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by ScottWalsh, Today, 06:52 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by ScottW, Today, 06:09 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by ftsc2022, 10-25-2022, 12:03 PM
            5 responses
            256 views
            0 likes
            Last Post KeyonMatthews  
            Started by Board game geek, 10-29-2023, 12:00 PM
            14 responses
            244 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Working...
            X