Backtesting/Optimization - page 81

 

MT4 EA Backtesting and period question

hi,

I have finally started backtesting an EA in MT4 and now something is puzzling me.... Chart Period parameter on the backtesting screen.

My EA is based on an hour (60m) chart. So when i see that you had to pick the Charting Period, I assumed that it would call my "Start" function once an hour. However it seems to be calling on every tick.

If my understanding is incorrect and the "start" function will be called in every tick that is fine and i can deal with that, but then what is the Chart Period parameter for?

If any body can help me with this i would be most grateful.

FYI, I have followed the guides to achieve 90% modeling quality, by downloading M1 data and then running the period converter script on the offline chart. I am also selecting the "Every Tick" model, which every guide is recommending to use.

Thanks in advance,

Paul

 

hi,

Thanks alot, if you do have the code for detecting a new bar that would be great. Thanks for clarifying that start() fires on each tick... at least i am not going mad! But what does the Chart Period Parameter do then, as i though this would affect when the start function is called, or is this to control when the next Bar is available?

Cheers,

Paul

 

Thanks alot for the code snippet. I think i understand the charting period parameter now, from your code.

Thanks again,

Paul

 
psmithgold:
hi,

I have finally started backtesting an EA in MT4 and now something is puzzling me.... Chart Period parameter on the backtesting screen.

My EA is based on an hour (60m) chart. So when i see that you had to pick the Charting Period, I assumed that it would call my "Start" function once an hour. However it seems to be calling on every tick.

If my understanding is incorrect and the "start" function will be called in every tick that is fine and i can deal with that, but then what is the Chart Period parameter for?

If any body can help me with this i would be most grateful.

FYI, I have followed the guides to achieve 90% modeling quality, by downloading M1 data and then running the period converter script on the offline chart. I am also selecting the "Every Tick" model, which every guide is recommending to use.

Thanks in advance,

Paul

Hi,

Yes strat() is called on every tick. If you want to do EA instruction only one on hour bar you should

bool which is true only when new bar turn up. If you want i can give you code.

About data i recommend you Dukascopy tick data for testing its the best free data i think.

For more details look at this page Tick Data | Birt's EA review.

You now, you traiding on 1h chart but if you have SL or TP its essential to have good data quality.

Cheers,

grzesiek

 
psmithgold:
hi,

Thanks alot, if you do have the code for detecting a new bar that would be great. Thanks for clarifying that start() fires on each tick... at least i am not going mad! But what does the Chart Period Parameter do then, as i though this would affect when the start function is called, or is this to control when the next Bar is available?

Cheers,

Paul

Hi Paul here is simple forula :

bool isNewBar() {

static int prevTime;

bool newBar=false;

if(Time[0]!=prevTime) {

newBar=true;

prevTime=Time[0];

}

return(newBar);

}

I'm not sure if good understand your question about period. If you for example call indicator or use function like iOpen. You need time frame becasue

you have to point out which bar you want to count or form which bar you need Open Close etc..

I know that maybe its not answer to your question, but as i said i dot understand your period problem.

I hope that i could help you.

Cheers,

Grzesiek

 

Forex Technical Scanner

Can anyone point me at a good forex scanner?

I have looked at those I can find on the net, and found them all too expensive (in my view) and overly complicated to use.

I'm looking for a simple scanner that will scan for Macd & Stochastics, and allow my own settings for both.

 
xsuchyx:
Hello,

I will share with you with my choice of backtesting and optimizing EA.

First step is to get 10 years data for currency for example from dukascopy or fxdd install it on your MT4.

If you have ea with multiple indicators and settings you can optimize them, the key to not overoptimize it is doing the optimization from 2000-2008 and than checking how best settings from optimization is working in 2008-2011 if results in past 2 years are still very good you could say you have a good EA. This is not all, to have a perfect EA you will need to do at least 6 months forward test on live account microlots and if it still works you could say " I've done a very good job" otherwise come back to first step. The best way is using vps for forward tests to use multiple EA's.

I hope this is a very valuable information to have it works for me. I did milion tests of EA and few of them became diamonds and are working now and will be working in future.

I think your Backtesting/optimizing Methode sound resonable where do you get 10 years tick data? Dukas only offers until 07, dosnt it? Im using 90% tick data...does that have a serios impact on my results?

I would appriciate a sources for good Tick data feel free to PM me

 

Indicators & Backtesting on MT4

Why does everybody use backtesting and indicators, that are based on historical data (often inaccurate) to predict future movement of the price?

There is no guarantee that the price will ever make the same movement again.

Could that be the reason why 90% of all traders lose money?

I'd like to hear your comments.

 

EA's and backtesting

I am always amazed to see how much weight is given to back testing.

It can be used to determine how an EA might perform on a specific set of historical data. Do not forget the fact that the data is historical.

That means in the past.

But I would like to know is how does this help you in the future.

I suspect that it does not help you at all.

 
N0talent:
I think your Backtesting/optimizing Methode sound resonable where do you get 10 years tick data? Dukas only offers until 07, dosnt it? Im using 90% tick data...does that have a serios impact on my results? I would appriciate a sources for good Tick data feel free to PM me

Some decent data that I've used came from here:

Http://www.histdata.com

Cheers!!

Reason: