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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X