Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detecting stop order execution

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

    Detecting stop order execution

    I'm working on a strategy and I need a way to know if my short position has hit its stop and been stopped out. I then want to start looking at the price to see if going short again is the thing to do or not.

    Thanks for responding

    Also, I once heard there is a programming class that NT offers, is that still offered ?
    Last edited by Joe Average; 08-16-2014, 06:18 PM.

    #2
    Hello Joe Average,

    Thank you for your post.

    To track the fill of an order, such as the stop order, you can use IOrder objects. You can find information on IOrder objects at the following link: http://www.ninjatrader.com/support/h...nt7/iorder.htm

    There is a programming class that will soon be available to our users for free. This will be updated on out Platform site on the education page when it becomes available: http://www.ninjatrader.com/Education.php

    Please let me know if I may be of further assistance.

    Comment


      #3
      So, if I want to know if the strategy just got stopped out ...

      private IOrder entryOrder = null;

      if (entryOrder == entryOrder.OrderType.Stop)
      Print("Stop");

      This would output the word 'Stop' if a stop was hit, correct ?
      Last edited by Joe Average; 08-20-2014, 08:50 PM.

      Comment


        #4
        Hello Joe Average,

        Thank you for your post.

        Actually you would want to use the following:
        Code:
        if(entryOrder != null && entryOrder.OrderState == OrderState.Filled)

        Comment


          #5
          How would you know then if the order hit its profit target or if the order hit its stop target ?

          Comment


            #6
            Hello Joe Average,

            Thank you for your response.

            You could add the Print() statement then as well. Or even use a drawing object or the Alert() method: http://www.ninjatrader.com/support/h.../nt7/alert.htm

            Comment


              #7
              Well, what I'm after is for the strategy to know what the status of the order is so after losing twice or three times in a row the stragety can pull in the target levels, to shift to a different level of expectation. In other words, the market is out of phase with my stragety, the strategy thinks the markets going up and the markets is on the verge of going down then vise versa. So, I'm trying to find I way to break this.

              Comment


                #8
                Hello Joe Average,

                Thank you for your response.

                You could use the TradeCollection LosingTrades instead to track the losing trades: http://www.ninjatrader.com/support/h...singtrades.htm

                An example of using performance to stop the strategy can be found at the following link: http://www.ninjatrader.com/support/f...ead.php?t=4804
                This will help in understanding how to change the logic base on performance.

                Comment


                  #9
                  Thank you very much. This is helpful.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by AaronKoRn, Yesterday, 09:49 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post AaronKoRn  
                  Started by carnitron, Yesterday, 08:42 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post carnitron  
                  Started by strategist007, Yesterday, 07:51 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post strategist007  
                  Started by StockTrader88, 03-06-2021, 08:58 AM
                  44 responses
                  3,981 views
                  3 likes
                  Last Post jhudas88  
                  Started by rbeckmann05, Yesterday, 06:48 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post rbeckmann05  
                  Working...
                  X