Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss Strategy

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

    SetStopLoss Strategy

    Hello, I wanted to ask if there is a strategy template available for me to build a stop loss that trails off the previous closed range bar, as I am not too familur with building strategies. thank you

    #2
    Welcome to our forums here Mark, unfortunately we would not have a sample exactly for this case, however a more general approach to show how trailing stops would be setup using SetStopLoss() is seen here - http://www.ninjatrader.com/support/f...ead.php?t=3222
    BertrandNinjaTrader Customer Service

    Comment


      #3
      That shows as an indicator. My utility is saying a new version exists on my PC. I don't show it in the indicator list though? Is it enabled via the indicator or ATM strategy?

      Comment


        #4
        The used indicators for the NinjaScript strategy would always export with the strategy, if you already have them you would not need to import them again.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Stop as % of previous range

          hi
          I'm new to NT as well, working my way through automation. Im trying to build a strategy that sets a profit target as a percentage (100%) of the previous bar with previous bar being difference between high -low.

          If the candle that has just closed is 50 pips, I would enter say +5 pips above, then add 50 pips to that price for profit target - and conversely set a stop loss as just under the low of previous bar (50 pips below).

          Any hints?

          Thanks
          Michael

          Comment


            #6
            Welcome to our forums Michael, I think we already discussed it this morning via email, correct?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              I did send you a reply, thanks. I am not sure how to record range of previous bar as a variable, which I can then use to set stops & profit targets. Can this be done in the strategy builder rather than actual coding?

              Michael

              Comment


                #8
                Ok, will check your reply in a sec - you could record values into user variables in the wizard and then use them in your conditions - http://www.ninjatrader-support.com/H...nedInputs.html
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Sorry don't understand how this relates to Range indicator.

                  Comment


                    #10
                    Just replied to your reply sent to support - you could also store the previous bar's range in user variable with this approach.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Here's what I've done.

                      Ive set Variable0 to low of the bar, ticks, offset -50
                      Variable1 to high of the bar, percent offset1

                      As we're on the trigger bar, I have barsago set to 0, as this is the range of the bar I want to measure. I now want to place a stop @ 100% of the range between the high and low, and the stop @ 5 pips under the low.

                      Using the variables above I have tried to set the profit target and stop loss strategy but nothing happens on the chart.

                      Where to from here?

                      Thx

                      Comment


                        #12
                        Please either reply here or via the email, as otherwise the communication of the issue would not be very efficient for us - I already replied to your email request - thanks.
                        BertrandNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by DJ888, 04-16-2024, 06:09 PM
                        6 responses
                        18 views
                        0 likes
                        Last Post DJ888
                        by DJ888
                         
                        Started by Jon17, Today, 04:33 PM
                        0 responses
                        1 view
                        0 likes
                        Last Post Jon17
                        by Jon17
                         
                        Started by Javierw.ok, Today, 04:12 PM
                        0 responses
                        6 views
                        0 likes
                        Last Post Javierw.ok  
                        Started by timmbbo, Today, 08:59 AM
                        2 responses
                        10 views
                        0 likes
                        Last Post bltdavid  
                        Started by alifarahani, Today, 09:40 AM
                        6 responses
                        41 views
                        0 likes
                        Last Post alifarahani  
                        Working...
                        X