Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set Target always equals to a defined stop (1:1 Risk Reward)

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

    How to set Target always equals to a defined stop (1:1 Risk Reward)

    How to set Target always equals to the stop (1:1 Risk Reward) and Stop is define by an indicator and is not a static value?
    Also want to add a runner which stop will shift to break even after the target gets hit. But have no clue how to add those conditions on the strategy builder wizard.
    I'm new to NT and have no knowledge of coding. I just tried using strategy builder but got stuck here.

    #2
    Hello hijam999, thanks for your post.

    It depends on what kind of value you are getting from the indicator. You can not use the SetStopLoss or SetProfitTarget for this since the stop and target price are dynamic based on an indicator.

    Instead, use the ExitLong orders to submit the stop and target. I attached an example that uses the Bollinger. You must set Order Fill Resolution to High in the strategy settings to get this to work.

    Please let me know if I can assist any further.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Only the Stop is based on an indicator but target will be based on the Stop i.e, Entry price minus Stop price will determine the target price.
      For example: Let us say I'm trading a swing breakout (long side) and I will keep the recent swing low as the stop. So the target will the same value as the stop above the entry.
      Let us say: x = entry price - stop price, then entry price + x will be the target.

      I got stuck here.

      Comment


        #4
        Hi hijam999, thanks for your reply.

        Regrettably, that type of arithmetic must be done with unlocked code. In the builder, you can not do arithmetic between two variables to use in another variable. An example modification of the original example I posted would be written as:

        Code:
        // Set 1
        if (Position.MarketPosition == MarketPosition.Flat)
        {
            EnterLong(Convert.ToInt32(DefaultQuantity), "");
            SetStops = true;
        }
        
        // Set 2
        if (Position.MarketPosition == MarketPosition.Long)
        {
            ExitLongStopMarket(Convert.ToInt32(DefaultQuantity ), Bollinger1.Lower[0], "", "");
            double x = Position.AveragePrice - Bollinger1.Lower[0];
            ExitLongLimit(Convert.ToInt32(DefaultQuantity), Position.AveragePrice + x, "", "");
            SetStops = false;
        }
        Please let me know if I can assist any further.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by b16_aln, Today, 05:15 AM
        0 responses
        1 view
        0 likes
        Last Post b16_aln
        by b16_aln
         
        Started by sidlercom80, Today, 04:57 AM
        0 responses
        4 views
        0 likes
        Last Post sidlercom80  
        Started by patricia70, Today, 03:57 AM
        0 responses
        5 views
        0 likes
        Last Post patricia70  
        Started by pjsmith, Today, 03:25 AM
        0 responses
        7 views
        0 likes
        Last Post pjsmith
        by pjsmith
         
        Started by cincai, Today, 01:04 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Jason  
        Working...
        X