Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Renko backtesting strategy errors

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

    Renko backtesting strategy errors

    Hello,

    I'm actually backtesting a strategy on GBPUSD using a Renko based charts.
    Unfortunately I'm having some issue concerning exact opening/closing price position.

    For exemple my long strategy is simply based on a direction change between two following

    Renko bars, here's my script :
    if (Open[0] < Close[0])
    && (Open[1] > Close[1])
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), @"Long");
    }

    Here's a snapshot for illustration in attachment.


    On renko #1 we notice a open > close, and on renko #2 a open < close, so my entry

    condition is triggered as soon as renko #2 is closed.
    The issue remain here : opening position price is the open of renko #3 (red triangle)

    instead of closing of renko #2 (green triangle).
    Hence my strategy tester remain on false price entry.

    NB : obviously this issue ain't encountered on candlestick chart, as close from previous

    bar equals open of following. But renko chart are constructed totally different.

    How NinjaTrader could to manage this error ? Is there some code to implement in the

    strategy script to solve it ?

    Thanks for your help
    Attached Files

    #2
    Hello Zananas,

    Thank you for your note.

    Some bar types are not an accurate representation of price action, the candles are modified like you've mentioned.

    You should add a secondary tick series to your script and submit orders to that series. This will give you more accurate backtest results. You could see the following example,
    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Zananas View Post
      Hello,

      Renko bars, here's my script :
      if (Open[0] < Close[0])
      && (Open[1] > Close[1])
      {
      EnterLong(Convert.ToInt32(DefaultQuantity), @"Long");
      }



      Thanks for your help
      Did you activate in the Strategy Optimizer/Tester "Per tick"?
      Attached Files
      Last edited by SBMT17; 09-10-2018, 02:32 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Brevo, Today, 01:45 AM
      0 responses
      3 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      239 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      6 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Working...
      X