NexusFi: Find Your Edge


Home Menu

 





Renko Bar Backtesting Order Entry/Exit


Discussion in TradeStation

Updated
    1. trending_up 3,910 views
    2. thumb_up 10 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Renko Bar Backtesting Order Entry/Exit

  #1 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157

Hello, I have created a few Renko Bar strategies and I wanted to share what works for me for backtesting purposes. I use Mean Renko(+) bars as defined by Tradestation and the low of the next bar is immediately half of the last bar, so if you have a market fill order in your strategy it will automatically place the order at the low of that bar even though that point may not of even hit with real price activity. This will skew your backtesting results greatly giving you WAY more profits than you would actually realize, and under live testing, stops would be higher or longer than you would realize. Also make sure to add some slippage into your strategy as the next bar ask is already higher than the close of the previous bar. Anyway, I hope it helps your backtesting results. Feedback welcome!

inputs:
Backtesting(True);

If ConditionToEnter = True Then begin
if Backtesting = false then
buy("LE") ContractsTraded contracts next bar at Market
else if Backtesting = true Then
buy("LEB") ContractsTraded contracts next bar at close stop;
end;

//If you use Setprofittarget() or Setstoploss() you don’t need this but if you have an exit condition that closes on a down or up bar it will fill artificially high or low.

if ConditionToClose = True Then Begin
if Backtesting = false then
sell("LX") ContractsTraded contract next bar at Market
else if Backtesting = true Then
sell("LXB") ContractsTraded contract next bar at close stop;
end;

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
Quantum physics & Trading dynamics
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #2 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


jeffc1000 View Post
Hello, I have created a few Renko Bar strategies and I wanted to share what works for me for backtesting purposes. I use Mean Renko(+) bars as defined by Tradestation and the low of the next bar is immediately half of the last bar, so if you have a market fill order in your strategy it will automatically place the order at the low of that bar even though that point may not of even hit with real price activity. This will skew your backtesting results greatly giving you WAY more profits than you would actually realize, and under live testing, stops would be higher or longer than you would realize. Also make sure to add some slippage into your strategy as the next bar ask is already higher than the close of the previous bar. Anyway, I hope it helps your backtesting results. Feedback welcome!

inputs:
Backtesting(True);

If ConditionToEnter = True Then begin
if Backtesting = false then
buy("LE") ContractsTraded contracts next bar at Market
else if Backtesting = true Then
buy("LEB") ContractsTraded contracts next bar at close stop;
end;

//If you use Setprofittarget() or Setstoploss() you don’t need this but if you have an exit condition that closes on a down or up bar it will fill artificially high or low.

if ConditionToClose = True Then Begin
if Backtesting = false then
sell("LX") ContractsTraded contract next bar at Market
else if Backtesting = true Then
sell("LXB") ContractsTraded contract next bar at close stop;
end;

I don't want to throw water on your parade, but your idea will probably not produce the results you expect, if your goal is to have an accurate backtest that will also reflect real world results (sim or live). I know from loads of experience with this chart type, as I have used very similar code as you have shared and have had variances of >50% when comparing the strategy performance report (what should have been) to the Trade Manager reports (actual trades).

My feedback is this: search for Renko Backtest here on FIO and you will find plenty of commentary on Renko backtesting. The bottom line: it is practically impossible to accurately backtest strategies in TradeStation for a number of reasons. I strongly recommend reading the posts, especially what @Big Mike has written. It may not be what you want to read

The only two 'advanced' bar types in TradeStation that even come close to accurate backtesting are Kase bars and Momentum bars, as they both have 'true open' and wicks. I will typically take a strategy designed for Renko and backtest it in MultiCharts, which has options for 'show wicks', 'true open' and 'phantom bars', and backtest in MultiCharts. This is the only way I have been able to get close to accurate backtest results.

I hope this helps.

~vmodus

Enjoy everything!
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157


Thank you for the feedback. I have been using Mean Renko(+) bars and they do show the wicks. You do not get real opens but the trick I posted allows for order entries to be backtested with relative accuracy. The only thing I have to note here is you have to add a few ticks of slippage. I trade ES and I add 1 tick slippage for entry and exit. I actually get about 95% fill accuracy based on backtesting. I know normal Renko bars on TradeStation have their flaws but the Mean Renko(+) bars and this bit of code provide decent accuracy (plus slippage).

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853


jeffc1000 View Post
Thank you for the feedback. I have been using Mean Renko(+) bars and they do show the wicks. You do not get real opens but the trick I posted allows for order entries to be backtested with relative accuracy. The only thing I have to note here is you have to add a few ticks of slippage. I trade ES and I add 1 tick slippage for entry and exit. I actually get about 95% fill accuracy based on backtesting. I know normal Renko bars on TradeStation have their flaws but the Mean Renko(+) bars and this bit of code provide decent accuracy (plus slippage).

I have not had success backtesting or using Mean Renko, but I will have to give it another attempt. I've been known to be wrong (more often than right P.

When working with Renko, my goal was 90%+ fill accuracy, so this is good information you have provided. I will have to give it some more consideration with what you have provided here.

Thanks for your feedback!

~vmodus

Enjoy everything!
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
 
phantomtrader's Avatar
 phantomtrader 
Reno, Nevada
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Trading: ZN, ZB, CL
Frequency: Daily
Duration: Minutes
Posts: 588 since May 2011
Thanks Given: 217
Thanks Received: 990

I suggest you read this LINK thoroughly. (You'll have to login to your account)

You need to use "this bar on close" for advanced bars. The "open" of the next bar is anyone's guess on renko bars.

"For strategy back-testing results to most closely predict live trading results:
* Use this bar on close type strategy orders. This is not required for Range bars, which can use "at next bar at market" orders.
* Use a 1-tick underlying interval to construct the bars: Avoid using next bar at market orders, as these can have unrealistic fills because the next bar to form may not be contiguous in price with the current bar ( the next bar's open may be far from the current bar's close ). Note that next bar at market orders may also not fill until the close of the next bar."

Also, the best way to test strategies using Renko bars on TradeStation is to collect data in REAL TIME. In other words, let your strategy run every day in sim (DON'T LET IT REFRESH) and collect the data at the end of the day. The fills will be more accurate than backtesting. You should, however, compare backtesting results with your real time results in sim. Chances are there will be a difference - how different will depend on the strategy itself and whether you can live with that difference.

Remember there is no LIBB (look inside bar backtesting) for advanced bars. That essentially means the fill/exit prices will be arbitrary.

Reply With Quote
Thanked by:
  #6 (permalink)
 
phantomtrader's Avatar
 phantomtrader 
Reno, Nevada
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Trading: ZN, ZB, CL
Frequency: Daily
Duration: Minutes
Posts: 588 since May 2011
Thanks Given: 217
Thanks Received: 990

There's also a specialty app that can be used with Custom Renko bars which is supposed to support backtesting. I haven't tried it, but might be useful.
LINK

Reply With Quote
Thanked by:




Last Updated on November 28, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts