Renko chart in live strategy running

Questions about MultiCharts and user contributed studies.
lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Renko chart in live strategy running

Postby lois77 » 05 Aug 2012

Hi everyone.

I came across an issue using Renko charts and I would like Multicharts support to explain how to resolve this issue. I believe many people already experienced these issues.

First of all, backtesting a strategy using Renko charts results in false entry/exit prices for any strategy.

Second, in live strategy running, in many cases the boxes of the Renko chart are generated before the closing price of the bar or before a new bar is generated for a given time frame. This leads to many more boxes than it should be plotted. Then when I reload all the data (Ctrl+R), some boxes simply disappear. This certainly leads to wrong trades as the price difference at the close may not be exceeding the box size and so there shouldn't be created any box.

So my question is, how can I prevent this to happen?

Kind regards.

Jesh
Posts: 41
Joined: 04 Jan 2011
Has thanked: 12 times
Been thanked: 4 times

Re: Renko chart in live strategy running

Postby Jesh » 06 Aug 2012

I also have the same problem where Renko bars drawn in real time they are replaced when I refresh the chart. This is not expected behavior and I don't see it happening on other platforms.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Renko chart in live strategy running

Postby Henry MultiСharts » 07 Aug 2012

Then when I reload all the data (Ctrl+R), some boxes simply disappear.
I also have the same problem where Renko bars drawn in real time they are replaced when I refresh the chart. This is not expected behavior and I don't see it happening on other platforms.
This issue has been already fixed. In the attachment are the modules with a fix. The modules can be used with MultiCharts 8.0 Release only. They would be also included in MultiCharts 8.1 by default.
Here is how to install it:
1) You need to close MultiCharts and all of its applications.
2) Then go to MultiCharts folder (make a right click on the MC shortcut –> Properties –> "Shortcut" tab –> select "open file location") and rename the file Shaper.dll into old_Shaper.dll
3) Save the file from the attachment corresponding to the version of MultiCharts you have and paste it to the MultiCharts folder.

You can find more information regarding calculation on the Renko chart type at the following pages:
Renko chart type
IOG on non standard chart types
Attachments
Shaper.dll
For 64bit MultiCharts
(2.88 MiB) Downloaded 440 times
Shaper.dll
For 32bit MultiCharts
(1.68 MiB) Downloaded 300 times

shanemcdonald
Posts: 196
Joined: 08 Aug 2012
Has thanked: 41 times
Been thanked: 41 times

Re: Renko chart in live strategy running

Postby shanemcdonald » 08 Aug 2012

do i need to do this for multicharts.net ?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Renko chart in live strategy running

Postby Henry MultiСharts » 08 Aug 2012

do i need to do this for multicharts.net ?
The update is already included in Multicharts .Net 8.0 Release.

shanemcdonald
Posts: 196
Joined: 08 Aug 2012
Has thanked: 41 times
Been thanked: 41 times

Re: Renko chart in live strategy running

Postby shanemcdonald » 08 Aug 2012

ok, thanks !

shane

lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Re: Renko chart in live strategy running

Postby lois77 » 09 Aug 2012

Hi everyone.

Thanks for the reply and the file.

Was this the reason why strategy performance based on history and data playback didn't match?

Kind regards.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Renko chart in live strategy running

Postby Henry MultiСharts » 10 Aug 2012

Hi everyone.
Thanks for the reply and the file.
Was this the reason why strategy performance based on history and data playback didn't match?
Kind regards.
Hello lois77,

The dll is the fix for the following:
Then when I reload all the data (Ctrl+R), some boxes simply disappear.
I also have the same problem where Renko bars drawn in real time they are replaced when I refresh the chart. This is not expected behavior and I don't see it happening on other platforms.
Please describe in details what exact mismatch do you have between history and data playback strategy performance:
1) provide screenshots demonstrating this behavior
2) workspace you are using
3) signal code you are using
4) detailed description and steps for reproducing this behavior.

lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Re: Renko chart in live strategy running

Postby lois77 » 12 Aug 2012

Hi.

I already discovered why strategy performance based on history and data playback doesn't match.
When I run the data playback, all the orders are executed at the close of the next bar. (next bar is the bar where the order should be placed when the current bar generates a signal)
Before I run the data playback, all the orders are executed at the beginning of the next bar, and this is how I pretend.

This must be the reason why I always get a worse performance when I run the data playback.
Why is this happening? Did somebody else experienced this? Is there some option to check in order to get the same results?

Kind regards.

lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Re: Renko chart in live strategy running

Postby lois77 » 12 Aug 2012

Hi again.

There is another issue I came across.
On real time chart, there are cases where the boxes exceed the box size defined on Format Instrument. Then, when a new period starts, the box divides in two, where the first has the box size and the second takes the size value between the close of the first and the current price. This shouldn't happen as Renko charts do not depend on time to plot new boxes and neither should be plotted boxes with a size higher than the preset size.

Does anyone experienced the same problem? What should I do to prevent this?

Kind regards.

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: Renko chart in live strategy running

Postby Katrin Yanenko » 14 Aug 2012

Dear lois77,
Please describe in details what exact mismatch do you have between history and data playback strategy performance:
1) provide screenshots demonstrating this behavior
2) workspace you are using
3) signal code you are using
4) detailed description and steps for reproducing this behavior.
We still need this information and the screenshots for further investigation.
Please answer the questions in a step-by-step way.
Hi again.

There is another issue I came across.
On real time chart, there are cases where the boxes exceed the box size defined on Format Instrument. Then, when a new period starts, the box divides in two, where the first has the box size and the second takes the size value between the close of the first and the current price. This shouldn't happen as Renko charts do not depend on time to plot new boxes and neither should be plotted boxes with a size higher than the preset size.

Does anyone experienced the same problem? What should I do to prevent this?

Kind regards.
This behavior can be reproduced on more than 1 tick resolution charts, real time bars are plotted at the close of the bar of the main data series.

Best Regards,
Katrin Yanenko

lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Re: Renko chart in live strategy running

Postby lois77 » 14 Aug 2012

1)
Before running data playback and after running data playback images.
Note the connecting lines of the trades.

2)
I am using a new workspace with only one chart.

3)
I am using this code to entry/exit long positions:

Code: Select all

if condition1 and condition2 and not(condition3) and not(condition4) then
var0 = var0 + 1
else
var0 = 0 ;

if condition1 and condition2 and not(condition3) and not(condition4) and CurrentBar > ConfirmBars and var0 = ConfirmBars then
Buy next bar market ;

if (condition7 and condition8) or (condition8 and condition9) then
Sell next bar market ;
I am using this code to entry/exit short positions:

Code: Select all

if condition1 and condition2 and condition3 and not(condition4) then
var0 = var0 + 1
else
var0 = 0 ;

if condition1 and condition2 and condition3 and not(condition4) and CurrentBar > ConfirmBars and var0 = ConfirmBars then
Sellshort next bar market ;

if not(condition2) and not(condition3) then
Buytocover next bar market ;
4) Well, after changing the code of my strategy, I check the strategy performance and get some results. Then, if I run the data playback and check again the strategy performance, the results are always different. And are always worse.
If you need more feedback, let me know.

Kind regards.
Attachments
After_data_playback.png
(50.18 KiB) Downloaded 1957 times
Before_data_playback.png
(51.37 KiB) Downloaded 1958 times

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: Renko chart in live strategy running

Postby Katrin Yanenko » 16 Aug 2012

Dear lois77,

We were asking you for a workspace because it would show us whether you use IOG or not.
If this option is enabled then this situation is likely to happen. Let me explain why.

Let’s say you have IOG on then the strategy is calculated 4 times on each historical bar during backtesting.

Data Playback is the emulation of real time. The calculation is made on the received Close of the second data series during the Playback.

Only As is mode of Data Playback is available for non-standard chart types, such as Renko. The strategy will not be calculated 4 times each bar as on backtesting, it’s calculated on the Close of the bar of the second data series.

This is the current implementation. You may want to submit a feature request for developing this As is mode of Data Playback to the Project Management of our web site so other users can vote for it: https://www.multicharts.com/pm/.

Best Regards,
Katrin Yanenko

lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Re: Renko chart in live strategy running

Postby lois77 » 18 Aug 2012

Hi Katrin.

If IOG enabled means "Enable Intra-bar Order Generation" checked, so I must say I didn't enable IOG.

I tried everything and I can't see where is the problem.

Kind regards.

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: Renko chart in live strategy running

Postby Katrin Yanenko » 20 Aug 2012

Hi lois77,


Please come to our Live Chat http://messenger.providesupport.com/mes ... pport.html tomorrow from 6:30 am till 1 pm EST in order we could connect to your machine remotely and investigate this issue with the specialist in this area.

Best Regards,

Katrin Yanenko

StefanoSF
Posts: 116
Joined: 19 Aug 2012
Location: San Francisco
Has thanked: 23 times
Been thanked: 30 times
Contact:

Re: Renko chart in live strategy running

Postby StefanoSF » 20 Aug 2012

There is definitely something inconstant with Back Testing vs Data Playback results on Renko Charts.

The Back Testing shows buy/sell as next bar open while Playback shows buy/sell next bar at close.

I have attached workspace and screen shots as well as sent you a work space.

- Stefano
Attachments
Playback Screen.png
Play Back Screen
(36.25 KiB) Downloaded 1945 times
Backtest Screen.png
Back Test Screen
(39.68 KiB) Downloaded 1948 times


Return to “MultiCharts”