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

Stop loss in automated strategy

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

    Stop loss in automated strategy

    Hi all. My strategy is working well only last night I realized a glitch in my setup. I have two ways to exit a trade- the first is a 16 tick stop loss and then if price crosses a MA it exits the position. The idea is that often when a trade opportunity arises it is close to the MA exit line. I watched the trade progress and it stopped out at 9 ticks when it crossed the MA but would have gone on to be a highly profitable trade if it had kept the 16 tick stop loss.
    Is there a way of setting it so that the MA exit is not triggered to exit in the initial stages?
    Thanks
    raycam

    #2
    raycam, I think you can work with the 'Unrealized (Open) PnL' for this, just use the MA trail only when profit is higher than amount X
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks mate- I will give it a go!
      raycam

      Comment


        #4
        Having trouble with this.
        In my set 3 of conditions and actions I have the following...
        "Position.MarketPosition==MarketPosition.Short
        CrossAbove(Close,SMA(32),1)"

        When I click add and select "Unrealized PnL" Currency >= Numeric value of 100
        I end up with this...
        "Position.GetProfitLoss(Close(0), PerformanceUnitCurrency)>=100"

        Is that how it is supposed to look so that when a trade is entered it will rely on my set stop loss until profitable to $100- at which point the SMA comes into play.

        Hope this makes sense.
        My head spins when I venture away from the wizard.
        And even in the wizard things are blurry.
        THX
        raycam

        Comment


          #5
          That is the correct listing for Unrealized PnL.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by _Zero_, 04-10-2020, 03:21 PM
          145 responses
          7,897 views
          6 likes
          Last Post johng2
          by johng2
           
          Started by TheTradingMantis, 01-19-2023, 02:05 AM
          43 responses
          916 views
          0 likes
          Last Post jmagaia
          by jmagaia
           
          Started by sevansounds, 06-25-2020, 10:40 PM
          5 responses
          1,554 views
          1 like
          Last Post johng2
          by johng2
           
          Started by ETFVoyageur, 05-07-2024, 07:05 PM
          10 responses
          71 views
          0 likes
          Last Post ETFVoyageur  
          Started by Zeezee, Today, 12:45 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Working...
          X