Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set a stop loss order manually in a RELIABLE way?

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

    How to set a stop loss order manually in a RELIABLE way?

    Hello,

    I now try to set my stop orders manually. This has issues, though. As you may know, orders expire with the bar.

    Here is what happened. It is not funny...

    ...
    20/07/2009 16:08:26 Entered internal PlaceOrder() method at 20/07/2009 16:08:26: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName='' FromEntrySignal='HA L1'
    20/07/2009 16:08:26 Entered internal PlaceOrder() method at 20/07/2009 16:08:26: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName='' FromEntrySignal='HA L2'
    20/07/2009 16:08:26 Entered internal PlaceOrder() method at 20/07/2009 16:08:26: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName='' FromEntrySignal='HA L3'
    ...
    20/07/2009 16:08:27 Entered internal PlaceOrder() method at 20/07/2009 16:08:27: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName='' FromEntrySignal='HA L1'
    20/07/2009 16:08:27 Ignored PlaceOrder() method at 20/07/2009 16:08:27: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName=Sell' FromEntrySignal='HA L1' Reason='Invalid order price, please see log tab'
    20/07/2009 16:08:27 Entered internal PlaceOrder() method at 20/07/2009 16:08:27: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName='' FromEntrySignal='HA L2'
    20/07/2009 16:08:27 Ignored PlaceOrder() method at 20/07/2009 16:08:27: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName=Sell' FromEntrySignal='HA L2' Reason='Invalid order price, please see log tab'
    20/07/2009 16:08:27 Entered internal PlaceOrder() method at 20/07/2009 16:08:27: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName='' FromEntrySignal='HA L3'
    20/07/2009 16:08:27 Ignored PlaceOrder() method at 20/07/2009 16:08:27: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=8757 SignalName=Sell' FromEntrySignal='HA L3' Reason='Invalid order price, please see log tab'

    Basically at the end of the bar the price was very close to the stop, by the time i was moving the order, it was invalid.

    How am I supposed to deal with this? Should I now move into orders that are valid GTC? Will a signal stop order be cancelled if the entry signal position is closed (not documented)? Or should I have to close the stop orders manually?

    #2
    NetTecture, which error do you get exactly in the Log tab as this occurs? Most likely you submit the stop at an incorrect price and this is the reason why it gets 'ignored'.

    If you do not like orders to expire at the end of the bar (default), then please use the liveUntilCancelled option - http://www.ninjatrader-support.com/H...verview36.html

    Comment


      #3
      Well, this is not the issue.

      Problem is:

      * I set stop losses.
      * I sort of assume that when I do so every bar, that will be "valid".
      * Sadly, as the price seems to jump, this error occurs.

      This is sort of a non-nice thing to do (sorry). It means, basically, one has to work with GTC orders, as - the "submit stuff per bar" may not work.

      I would suggest adding a paramter that "fixes the order" (i.e. - if that is a stop submitted, the price went through, sell market).

      My order handling code gets more and more complicated for stuff like that Now I have to move all things to GTC orders, simply because I loose stop orders between bars

      Slowly getting through, though

      Comment


        #4
        I'm not sure what you mean by 'loosing' stop orders, this would most likely depend on the conditions have in place to move the stops, printing out the actual stop value may help to debug this.

        You also should reset your stop losses once flat to some default value as in this sample - http://www.ninjatrader-support2.com/...ead.php?t=3222

        Comment


          #5
          Well, as I said - and it is in the shown logs.

          The problem basically is...

          * Bar closes. Stop is pretty much "at the bar" (1 tick away).
          * By the time my order gets entered, the price has moved - ergo the short is invalid.

          As I dont get any feedback from the method, I am stuck with the price going down and down below my stop level.

          I move my code now to GTC stops...
          ...SADLY this makes the whole API more complicated.

          Why?

          Because non-gtc I can just way "signal name".

          With GTC I have to give MY signal name, the amount to be closed. This is a lot more info

          One overload with just a "gtc boolean" vaiable would be nice.

          Comment


            #6
            Thanks for the suggestion NetTecture, have you tried selecting the GTC tif setting when starting up your strategy? - http://www.ninjatrader-support.com/H...romAChart.html

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X