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 pechtri, 06-22-2023, 02:31 AM
    10 responses
    124 views
    0 likes
    Last Post Leeroy_Jenkins  
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Yesterday, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Yesterday, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Yesterday, 03:01 PM
    2 responses
    22 views
    0 likes
    Last Post helpwanted  
    Working...
    X