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 );
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 :/
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.
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 :)
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 :)
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.
I don't think it looks like a holy grail.
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. :-)
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.
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.
"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.