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 PaulMohn, Today, 05:00 AM
      0 responses
      8 views
      0 likes
      Last Post PaulMohn  
      Started by ZenCortexAuCost, Today, 04:24 AM
      0 responses
      6 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by ZenCortexAuCost, Today, 04:22 AM
      0 responses
      3 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      17 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      5 views
      0 likes
      Last Post DanielTynera  
      Working...
      X