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.

    Comment


      #3
      Oh, thanks. :-)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      58 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      39 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      19 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      21 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      51 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X