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

Moving stop loss below the current price when short

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

    Moving stop loss below the current price when short

    Hi,

    I'm trying to add a rule where the open position reaches the negative tolerance level, then I want to move my stop loss to break even (in case price goes back to to level again). I added this piece below into my strategy, but as soon as the criteria is met, it closes the position. So now I'm guessing I can't move my stop loss below the current price when I'm short. Is there a way around this?


    if (Position.MarketPosition == MarketPosition.Short && Close[0] >= Position.AveragePrice + TheTolerance * TickSize)
    {
    SetStopLoss("sell", CalculationMode.Price, Position.AveragePrice, false);
    }

    thanks
    M

    #2
    Hello mntemel,

    If the position is short, would you not be expecting the price to fall instead of rise?

    Your logic is looking for the close price to be greater than the entry price plus whatever TheTolerance multiplied by TickSize is.

    That sounds like if the price has risen instead of fallen you want to move the stop loss to breakeven which would be on the wrong side of the market if the price has risen (meaning you have lost profit in that trade).

    Can you clarify what you are trying to accomplish?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    3 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X