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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Jonafare, 12-06-2012, 03:48 PM
        5 responses
        3,986 views
        0 likes
        Last Post rene69851  
        Started by Fitspressorest, Today, 01:38 PM
        0 responses
        2 views
        0 likes
        Last Post Fitspressorest  
        Started by Jonker, Today, 01:19 PM
        0 responses
        2 views
        0 likes
        Last Post Jonker
        by Jonker
         
        Started by futtrader, Today, 01:16 PM
        0 responses
        8 views
        0 likes
        Last Post futtrader  
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,792 views
        0 likes
        Last Post aligator  
        Working...
        X