Download MetaTrader 5

There certainly is a Holy Grail! - page 10

To add comments, please log in or register
Fernando Carreiro
3942
Fernando Carreiro  
Icham Aidibe: Please to give a try with the following OnNewBar() shared across forum workaround - with the "every tick" mode on tester, for sure you won't get the same results. 

You should not be detecting a new bar by count of the Bars, as that is unreliable and bad coding practice! Use the bar's time instead!

static datetime dtBarCurrent   = WRONG_VALUE;
       datetime dtBarPrevious  = dtBarCurrent;
                dtBarCurrent   = (datetime) SeriesInfoInteger( _Symbol, _Period, SERIES_LASTBAR_DATE );
       bool     boolNewBarFlag = ( dtBarCurrent != dtBarPrevious );
Icham Aidibe
10815
Icham Aidibe  
Fernando Carreiro:

You should not be detecting a new bar by count of the Bars, as that is unreliable and bad coding practice! Use the bar's time instead!


Thanks Fernando, I'll give a try with. But will it really change something ? 

EDIT : no, same. When someone will find a way to reproduce the exact same conditions as the open price mode, please to share : my collection's plenty of ea working only in open price mode :/

Felipe Ponce Aragon
971
Felipe Ponce Aragon  
Icham Aidibe:

@Felipe :

Me, I don't apologize.

You're using the OnTick() processing method with the "open price" mode on tester.

Please to give a try with the following OnNewBar() shared across forum workaround - with the "every tick" mode on tester, for sure you won't get the same results. 


Dear Icham,

My algorithm consists in actually trading on new bar. Using any workaround available, I'm not a coder. In the real market I do trade on new bar. And when you trade on new bar, backtests are much more accurate, despite the tick data you have. I thought everyone knew that. But ok. This is the last image I share with every tick. Yes, I got the same result with every tick. The quality is terrible, n/a, not even 10%, but I didn't enter the Forex market to produce high-quality backtests. I'm currently looking for a friend who can actually code and want to be my partner, and is very used to coding in a manner that the EA opens and closes trades ONLY ON NEW BAR. I already have 2 EAs that do this. But I need a friend to code one of my algorithms with high quality. What do I provide? The algorithm. What do I ask? The code. Preferably in MQL5 language, but I accept MQL4!!



Have a blessed weekend everyone, no more images for today :)

Icham Aidibe
10815
Icham Aidibe  
Felipe Ponce Aragon:

Dear Icham,

My algorithm consists in actually trading on new bar. Using any workaround available, I'm not a coder. In the real market I do trade on new bar. And when you trade on new bar, backtests are much more accurate, despite the tick data you have. I thought everyone knew that. But ok. This is the last image I share with every tick. Yes, I got the same result with every tick. The quality is terrible, n/a, not even 10%, but I didn't enter the Forex market to produce high-quality backtests. I'm currently looking for a friend who can actually code and want to be my partner, and is very used to coding in a manner that the EA opens and closes trades ONLY ON NEW BAR. I already have 2 EAs that do this. But I need a friend to code one of my algorithms with high quality. What do I provide? The algorithm. What do I ask? The code. Preferably in MQL5 language, but I accept MQL4!!



Have a blessed weekend everyone, no more images for today :)


Hello Felipe,

Indeed you may have there a graal ! As I told you there's no real OnNewBar() event, it's always tricky, whatever the way used but your own implementation seems to do it well, since the results in every tick are - I was wrong - exactly the same. For sure, you'll find someone to put into code this winning strategy. 

I don't suggest you to watch at the Freelance section :)

Good weekend. 

whroeder1
17094
whroeder1  
Icham Aidibe: As I told you there's no real OnNewBar() event, it's always tricky,
Not tricky, new bar, new time stamp.
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum.) Always use time.
I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
          New candle - MQL4 and MetaTrader 4 - MQL4 programming forum
Marco vd Heijden
Moderator
6152
Marco vd Heijden  

In a real world multi instrument application it is tricky because one new bar for EURUSD does not mean one new bar for USDCHF, or for any other instrument.

That would mean you would have to check for new bars on all instruments separately.  

So in that case you can use TimeCurrent() and the actual volume counts of the instrument bars.

First you will see TimeCurrent() cross over to a new minute(s), hour and etc, and then you can measure the drop in volumes to detect that a new bar has started for each separate symbol.

Sometimes it can take a long time before a new tick comes in and so it will take a long time for the new bar to open.

Here is a tick chart that shows this and you can see it sometimes take a long time for a new bar to start.


Marco vd Heijden
Moderator
6152
Marco vd Heijden  

I don't think it looks like a holy grail.

Chris Mukengeshayi
879
Chris Mukengeshayi  
PennySeven:

Is this a Holy Grail trading plan for the EuroDollar on the H1?

I don´t know. Decide for yourself. I only watch it for longer time frame trend confirmations. 

I don´t trade the H1. I´m finalizing my Holy Grail on the M3. Much more profitable.  :-)

EuroDollar H1


It looks like a Holy Grail, doesn´t it? :-)

All deals are on Divergence. You have to act on Divergence on the H1. It is a valid indicator on such a long time frame. 

Obviously, the Divergence happens on the indicator chart. 

In fact, it is not a finalized Holy Grail because it still has two bottom BUY levels. It is only a final Holy Grail when there is only one BUY level and one SELL level on the Stochastic. This Holy Grail still needs this final item to be resolved.

In my opinion people who have a " holy grail " of a system don't even use any indicator they just understand price action and do some mathematics calculation, they know when to enter and when to exit often they don't even need to trail their open trades. Ask Simba his probably a Mufasa by now :-)

One need to go with the flow of the market.

Marco vd Heijden
Moderator
6152
Marco vd Heijden  

Still i do not think it looks like a holy grail.

A holy grail will stay virtually flat which is not possible with just one instrument.

Marco vd Heijden
Moderator
6152
Marco vd Heijden  
PennySeven:

"Virtually flat"? What do you mean with that? 

It means that if you are negative on one instrument, you are positive on another instrument, staying virtually flat.

Kinda like saying risk-free.

I define a holy grail as signal-less.

This means you can trow it at the market any time any instruments.

It's certainly not a combination of indicator x and indicator y on a single instrument, trying to predict direction, this is impossible.

That is very narrow minded and still involves the full risk of the directional element.

Holy grail does not have that it will generate profit in both directions, direction becomes meaningless, markets just have to move.

To add comments, please log in or register