Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop loss order rejected

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

    stop loss order rejected

    running a strategy on market replay data, ver 6.0.1000.5, the entry order gets placed and the target order gets placed but the stop order gets rejected for being "below the market". I don't understand this.... The strategy is flat before this code is run. Price is not changing enough before the fill to cause the rejection...

    EnterShort(contracts,"sig10");
    SetStopLoss(CalculationMode.Price,10);
    SetProfitTarget(CalculationMode.Price,30);

    Similar code used for a long entry works as per the documentation...
    Last edited by maxpi; 11-20-2007, 07:45 PM.

    #2
    Right. When you use CalculationMode.Price, the variable you set is the actual price you want to exit at. For instance if your instrument is trading at 100, you may want to set a Profit Target at 110 and to do that you would do SetProfitTarget(CalculationMode.Price, 110).

    From the looks of your numbers it looks like you want to use CalculationMode.Ticks instead.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Ok, i was using the idea that the value i supplied would be offset from the entry price.

      thanks muchly

      Comment


        #4
        You can do something like Position.AvgPrice + somevalue.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          The docs say the following regarding SetProfitTarget:

          "Should you call this method to dynamically change the target price in the strategy OnBarUpdate() method, you should always reset the target price/offset value when your strategy is flat otherwise, the last price/offset value set will be used to generate your profit target order on your next open position "

          what is meant by "reset the target price/offset value"? Do I issue a SetProfitTarget or update the variable used to fill in the target price immediately upon receiving the info that position is flat from TWS?

          Comment


            #6
            See this reference sample

            RayNinjaTrader Customer Service

            Comment


              #7
              The reference sample helped, thanks. What I was wondering is if one has to wait to be flat before changing the stop values, apparently just changing them at the time of the entry order should be fine?

              Comment


                #8
                Changing them whenever will work for updating the next profit target/stop loss orders sent.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Yes, you can change it at the time of entry order submission, just do it prior to submitting an entry order otherwise it is possible that stop/targets will be submitted at the last known stop/target price for your prior trade.
                  RayNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  601 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  347 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  559 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  558 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X