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

stoploss setup problem

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

    stoploss setup problem

    Speed = 100;
    SL = 25;
    TP = 125;
    }
    else if (State == State.Configure)
    {
    }
    else if (State == State.DataLoaded)
    {
    SMA1 = SMA(Close, Convert.ToInt32(Speed));
    SetStopLoss("", CalculationMode.Ticks, SL, false);
    SetProfitTarget("", CalculationMode.Ticks, TP);
    }
    }


    When strategy opens a position, stoploss is trying to be set not at 25 ticks away from entry, but at fixed price and its often not in market, so the strategy always get errors with that
    Attached Files
    Last edited by timur; 10-18-2019, 07:56 AM.

    #2
    Hello timur,

    Thank you for your reply.

    I've made a quick example strategy that enters long if the price goes above a 100 period SMA. The strategy will place the profit target at 125 ticks and the stop loss at 25 ticks. I'm not seeing any rejected stop loss orders with this. Please test on your Sim101 Account - do you get the same behavior from the attached example?

    Do you try to set a Stop anywhere else in your code, either to adjust an existing stop or place a different one? Would you be able to provide an example of your code where your strategy enters a position?

    Thanks in advance; I look forward to assisting you further.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hello timur,

      Thank you for your patience.

      Just following up to see if you'd had a chance to review my questions in my previous post.

      Thanks in advance; I look forward to assisting you further.
      Kate W.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by trilliantrader, 04-18-2024, 08:16 AM
      7 responses
      27 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by samish18, 04-17-2024, 08:57 AM
      17 responses
      64 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by rocketman7, Today, 02:12 AM
      2 responses
      19 views
      0 likes
      Last Post rocketman7  
      Started by briansaul, Today, 05:31 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by PaulMohn, Today, 03:49 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X