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

Trading stoploss in Strategy developer

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

    Trading stoploss in Strategy developer

    I have a small support question.

    I have create a double EMA crossover strategy with the builder. It work very well only I can't create a trading stoploss in the strategy builder for this Strategy.
    I want a trading stoploss with a stop 20% percent below the highest end of day price. i tried something to create it but it still dont work.
    Can you set this trading stoploss in my strategy file please. see the attached file.

    Best regards
    Albert
    Attached Files

    #2
    Hello appieh,

    Thank you for your post.

    When you say highest EOD price, do you just mean the high for the day? The highest price in a specific period of days?

    What time frame and instrument types are you using with this strategy?

    You would not be able to use SetStopLoss() with a dynamic value like "20% below the highest end of day price" in the Strategy Builder, unfortunately. This would require unlocking the code and actually writing it out.

    If you provide a bit more information about exactly what you're looking for, I'm happy to give you more details on how to achieve this using code.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3

      Hi Kate,

      thanks for you feedback,

      End of day price is just the last price of the day before the stock exchange closed. Because my strategy is based on end of day data.
      I will use my strategy only for stocks. and check only on the end of the day if there is a signal from the two EMA's.
      When there is a buy signal (short EMA cross above the long EMA) I want to save my profit with a trading stoploss that is set 20% lower then the highest end of day price when I'm in a trade.
      So I have two options for a sell signal. one is when the EMA's crossing again (short EMA crossing down the long EMA). and the second is when my trading stop will activate because the course is more then 20% lower then the highest and of day course of the trade.
      In the Strategy builders I see there is an option to set a trading stop with a percent sign. Only I get it not working.
      so can you create this settings in my emmacross.cs file please.
      See also the picture as example.

      Best regards
      Albert

















      Comment


        #4
        Hello appieh,

        Thank you for your reply.

        In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners. However, I'm happy to provide you more information so that you can add to your strategy yourself.

        You would not be able to achieve this with SetStopLoss(), as even though you can set a stop using a percentage, that stop would be a percentage away from the entry price, not the high of a bar. However, you could use exit orders in the Strategy Builder to achieve a similar affect.

        These two attached examples illustrate how to set either a breakeven stop loss or a trailing stop in the Strategy Builder. You could adapt the logic in these to set a stop loss exit order to be a specific percentage away from the current high.

        Please let us know if we may be of further assistance to you.
        Attached Files
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Hello Kate,

          thanks for the examples. only I can not find out how to create what I want via this examples.
          Attached you see a screenshot of the Strategy builder Tab Stops and targets. when I go to Trading Stops, Value I can select Percent.
          do you have an example of a strategy with this Percent select settings. So I can see how this setting will used in a strategy.

          Best regards
          Albert

          Comment


            #6
            Hello appieh,

            Thank you for your reply.

            Using Percent for your stops and profit targets in the Strategy Builder will place your stop or profit target the specified percentage away from the associated entry.

            I've attached a very basic example strategy that uses percentages (in this case, 0.5% for stop loss and 1% for profit target) to set the stop and target. Please note in percentage calculation mode a value of 1 is equal to 100%, a value of 0.1 is equal to 10%, and a value of 0.01 will be 1%.

            Please let us know if we may be of further assistance to you.

            Attached Files
            Kate W.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Brevo, Today, 01:45 AM
            0 responses
            6 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            3 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            242 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            384 views
            1 like
            Last Post Gavini
            by Gavini
             
            Started by oviejo, Today, 12:28 AM
            0 responses
            6 views
            0 likes
            Last Post oviejo
            by oviejo
             
            Working...
            X