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 Balage0922, Today, 07:38 AM
      0 responses
      0 views
      0 likes
      Last Post Balage0922  
      Started by JoMoon2024, Today, 06:56 AM
      0 responses
      6 views
      0 likes
      Last Post JoMoon2024  
      Started by Haiasi, 04-25-2024, 06:53 PM
      2 responses
      19 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      6 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Working...
      X