Jump to content

[instruction] Run EA on offline charts - rangebar, and renko


Recommended Posts

download here

http://www.mediafire.com/?3zd0mw5k3m2

 

Normally eas can not run on offline chart, because there is no tick data coming on the offline chart to trigger the EA to run the start() function. one way is to make the normal ea into a script and force it to check data every 1000 milisecond.

 

Antoher way is using script to force it to send message to window telling there is a tick comming, so that the normal ea can go the start() loop on the offline chart such as range bar and renko bar chart.

 

1) following the Readme-rangebar.txt to produce history data for offline chart, and open a offline range bar

2) enable the expert, and drag the expert to your offline chart

3) drag the script "IncomingTick" and drop it on the offline chart that you are running the ea.

now you see that the ea works and print out comments on your offline chart

 

 

This rangebar script was shared by mod eggzactlly in this forum before, kudos to him. however the rangebar is not optimzed and using 50% CPU. the optimized verison shall be that range bar shall be a indicator and using only 5 to 10% CPU. that is a job for later.

 

For renko bar, you can download it from

http://codebase.mql4.com/6257

This one is optimized one, the way it shall be, to produce offline chart.

Link to comment
Share on other sites

  • 1 month later...

Re: [instruction] Run EA on offline charts - rangebar, and renko

 

I found a big problem when viewing backtest (visual mode) with Renko bars with MT4. This will lead to wrong backtest or optimizing result.

 

If the type of bar (up bar or down bar) of the last 2 bars are not the same type, then the last one will be drawn in wrong direction.

 

For example, bar[1] = up bar. If the next bar is also an up bar, there is no problem. But if the next bar is a down bar, this latest down bar is drawn from tail to head (from bottom to top) which not it suppose to be.

 

I know that this is because the nature of Renko chart (the open of the last bar can jump), but is there a way (an MT4 program/script?) to make the drawing of the last bar is exactly like the same way happens in real live chart?

 

At least the open[0] sits in the initial position until the whole renko is constructed, not sitting at the (after happened) position?

 

This makes a big difference for optimizing / backtesting with Renko charts.

Link to comment
Share on other sites

Re: [instruction] Run EA on offline charts - rangebar, and renko

 

how to backtest

 

1) first get all your M1 data, like eurusdm1.hst data

2) go offline, keep only the eurusdm1.hst and delete your eurusdm5.hst all all other timeframe data for eurusd.

3) now use the script and produce the offline chart, instread of name the offline chart to eurusdm2, you now name offline chart as eurusdm5

4) now the eurusdm5.hst is actually your offline chart, but you now can use the stardard timeframe M5 in the metatrader to do the backtest.

 

how to run ea on offline chart

1) the most reliable way is to convert the ea into a script

 

in the main function, do

int start()
{
while (!IsStopped())
{
  //here you write your main function.
   Sleep(1000);
 }
}

 

so this force the ea to run every 1000 minisecond.

Link to comment
Share on other sites

  • 1 month later...
download here

http://www.mediafire.com/?3zd0mw5k3m2

 

Normally eas can not run on offline chart, because there is no tick data coming on the offline chart to trigger the EA to run the start() function. one way is to make the normal ea into a script and force it to check data every 1000 milisecond.

 

Antoher way is using script to force it to send message to window telling there is a tick comming, so that the normal ea can go the start() loop on the offline chart such as range bar and renko bar chart.

 

1) following the Readme-rangebar.txt to produce history data for offline chart, and open a offline range bar

2) enable the expert, and drag the expert to your offline chart

3) drag the script "IncomingTick" and drop it on the offline chart that you are running the ea.

now you see that the ea works and print out comments on your offline chart

 

 

This rangebar script was shared by mod eggzactlly in this forum before, kudos to him. however the rangebar is not optimzed and using 50% CPU. the optimized verison shall be that range bar shall be a indicator and using only 5 to 10% CPU. that is a job for later.

 

For renko bar, you can download it from

http://codebase.mql4.com/6257

This one is optimized one, the way it shall be, to produce offline chart.

 

I've modified the RenkoLiveChart_v3.2.mq4 so it can be backtested. The problem with Renko backtest is the formation of BarOpen[0]. In real renko it can shift in bar close time, due to renko definition itself.

 

I want to share it, but how can I attach it here?

Edited by lumanauw
wrong spelling
Link to comment
Share on other sites

I've modified the RenkoLiveChart_v3.2.mq4 so it can be backtested. The problem with Renko backtest is the formation of BarOpen[0]. In real renko it can shift in bar close time, due to renko definition itself.

 

I want to share it, but how can I attach it here?

use megaupload.com or mediafire.com :) :-bd

[spoiler=stttttt... hey You .. YES you ... let tell me you A SECRET ... click here ... yeah ... click on this button ] II Vocabulary that you should know:

PLON=it mean someting that really bad ... REEEELY BAD like a BLOOD sucker stuff ...

CEMPLON= the PRODUCER OF SOMETHING THAT CLAIM GOOD but IT IS NOT ... and WASTED all YOUR MONEY!

---- make sure Oxford or Cambridge knows it ...--- K =D>

 

Link to comment
Share on other sites

The problem I see is that, even though we can see price movement more clearly, we are presented with the same exact problems with indicators, except the fact that it occurs more frequently. You can catch more pips in trends, but lose them again in consolidation. I love range bars, but until we can find the best indicator to use, they leave us in the same boat. I guess TradingFX.com has a special MACD for range bars, but aside from subscribing, I'm not sure what they're using. I've been looking for a long time for something useful. Maybe using a timeframe chart or a larger range bar/renko bar chart for trend confirmation (sort of like MTF), and then trade on the smaller chart. I think this might be the key until the holy grail indicator is found.
Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...