Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulated Stop Loss

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

    Simulated Stop Loss

    Hello,

    I'm trying to use simulated stop loss in my strategy. If you could please help with a couple questions that would be great.

    1. Simulated stop loss is basically a stop market order handled through ninja trader correct? i.e. when the stop price is hit, ninja trader execute a market order?

    2. Here is my code:

    SetStopLoss("GetOut", CalculationMode.Price, StopPrice, true);

    What is the "GetOut" parameter? I just put that there not knowing what it is.

    3. Where can I see the Stop order in the front end of Ninja trader? It's not showing up in the "Orders" tab but that could be because my code is broken.

    Thanks,

    Evan

    #2
    Hello evanp90,

    Welcome to the NinjaTrader support forums.

    You are correct, a Simulated stop is a locally held order which is converted to a market order, you can read about this concept here: https://ninjatrader.com/support/help...tsub=simulated

    The GetOut would be a FromEntrySignalName, if you are unsure what a overload is or the parameters between the ( and ), you can see this listed in the help guide:

    Code:
    SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool isSimulatedStop)
    https://ninjatrader.com/support/help...ub=setstoploss

    A from entry signal name links the stop with the entry signal you provide with an entry.

    You can see the orders your strategy is placing on a chart by opening the ChartTrader to the same account. if you are trading the Sim101, first open a chart trader to Sim101 then enable the strategy. In realtime you can see the orders on the chart if they are a type which can be displayed such as a stop order. If your order is not showing up at all, it may have been ignored or just was not placed. If you entered "GetOut" randomly, that might be it, that needs to be your entry signal name.



    I look forward to being of further assistance.

    Comment


      #3
      This worked just fine!! Now my code looks like this

      EnterLong(Convert.ToInt32(OrderAmount), "Long1");
      double StopPrice = (Position.AveragePrice) - (Position.AveragePrice * StopPercentage);
      SetStopLoss("Long1", CalculationMode.Price, StopPrice, true);


      Everything works fine in real time for the strategy, but I can't get the backtest to use the stop loss. Any ideas on this?

      Comment


        #4
        Hello evanp90,

        Thank you for the reply.

        When you say you cant get the backtest to use this, do you mean you don't see any filled stoploss orders? What specifically is happening in the backtest when you use the stoploss? Is there one entry or do you have other logic in the script controlling exits?

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        60 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        39 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        21 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        23 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        51 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X