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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        666 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        377 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X