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?

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

    Trailing stop?

    I am trying to place a trailing stop in the strategy wizard. I have a 6 tick profit target but once the current price moves 5 ticks above(for Long) entry or 5 ticks below (for short) entry, move the the stop up to 4 ticks above entry price . Heres how I have it in the wizard. BUT... its not working...any ideas what I have wrong? Thanks

    SetProfitTarget("",CalculationMode,Ticks,6)
    SetTrailStop("4",CalculationMode,Ticks,5,False)

    #2
    sdt929, your trailing stop is not picked up as the FromEntrySignal name field contains the incorrect entry 4 - here you would either put the name of your entry signal in or just leave empty like you did it for the ProfitTarget above.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Both?

      So, would I set it in the wizard to have a hard stop (5 ticks) and a trailing stop (4 ticks above entry)? If market moves in my direction I just want to at least lock in 4 ticks profit.

      Comment


        #4
        Hello sdt929,

        You can't combine both SetStopLoss() with SetTrailStop(). It will use the stop loss only.

        Trail stop in a NinjaScript strategy does not work the same as an ATM strategy. There is no field for profit trigger like an ATM.

        Trailstop places a stop order at the last traded price +/- the specified tick or percent. Mode price does not make sense in trail stop context.

        Example:
        Long Position enters at 1000
        Trail stop defined at 10 ticks is placed initially at 990.
        If market raises to 1010, stop loss is moved to 1000.

        Adjustments to the price are made either on every tick or on bar close depending on CalculateOnBarClose setting. It will not retreat in other direction - in example above, it stays at 1000 if trading goes from 1010 to 1000.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by techgetgame, Today, 11:42 PM
        0 responses
        6 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Today, 11:36 PM
        0 responses
        1 view
        0 likes
        Last Post sephichapdson  
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,612 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Working...
        X