Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to set stop loss

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

    Unable to set stop loss

    Hi

    I had a strategy which worked fine - opening a poistion and set a stop loss using managed orders.
    however after i set an invalid value to the SL the strategy stoped working correctly. it would just open an order wand will not set SL (although i changed the value to a valid value).
    i am using market replay.
    i hink restarting the computer worked once but the problem happened and it stop helping.

    Code:
    OutputMessage("sl= " + sl.ToString());
    SetStopLoss(CalculationMode.Price, sl);
    Print("a");

    Output:
    8/28/2012 11:16:00 sl= 1.2486
    a

    Screen shot is also attached

    please help
    Attached Files

    #2
    kiss,

    Do you perhaps have your strategy, and could you attach it to this thread so we can see it?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I attached a simple version which also doesn't work. A position is opened but stop loss is not set.

      The output is:
      =============
      8/28/2012 3:48:00 OnRealStartUp 1.2491
      8/28/2012 3:48:00 sl= 1.2481
      **NT** Disabling NinjaScript strategy 'Main002/14d6bd77c73f4396bb65037595c0e32a'

      I just tried it online (demo) and it's working. I dont think it's something with the code. i think there are some old open or corrupted orders (or something like that) which prevent from setting the SL.
      Attached Files
      Last edited by kiss987; 09-09-2012, 03:13 PM.

      Comment


        #4
        I just find a solution. I created a new strategy with a different name, and copy paste my code into it (without changing anything) and it worked (at least online, i didn't check replay data).
        Weird.
        Thanks for the support

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        61 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X