Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest possible error on Limit entries

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

    Backtest possible error on Limit entries

    Hello!

    I'm developing a strategy but when I've test it with Strategy Analyzer I get what you can see at image attached. Why the limit order enters if the price doesn't touch nor passes over my limit price?

    My code looks like this:

    Code:
    protected override void OnBarUpdate()
    {
     // ....
      this.m_activeOrder = EnterLongLimit(0, false, 1, High[0] + 0.5, "miorden"+CurrentBar);
      SetStopLoss("miorden"+CurrentBar, CalculationMode.Price, Low[0] - 0.5, false);
      SetProfitTarget("miorden"+CurrentBar, CalculationMode.Ticks, 20);
     // ...
    }
    Thank you for your time!
    Attached Files
    Last edited by dazkona; 08-25-2014, 05:58 AM.

    #2
    Hello dazkona,

    Thanks for your post and welcome to the forums!

    To enter a long limit order you must enter it below the current price else it will fill immediately and this is the behavior you have observed.

    Here is a link to investopedia on buy limit orders: http://www.investopedia.com/terms/b/buy-limit-order.asp

    To place a buy limit order above current price, use EnterLongStopLimit. http://www.ninjatrader.com/support/h...gstoplimit.htm

    Here is a link to investopedia on Buy stop limit orders: http://www.investopedia.com/terms/s/stop-limitorder.asp

    Please let me know if you have further questions.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Oh, thanks. :-)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by WHICKED, Today, 12:45 PM
      2 responses
      18 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by GussJ, 03-04-2020, 03:11 PM
      15 responses
      3,276 views
      0 likes
      Last Post xiinteractive  
      Started by Tim-c, Today, 02:10 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      3 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      51 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X