You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
It's the quotes, they are of poor quality.
The standard Expert Advisor goes well with them. And on a demo account, trading does not work either. My trades do not open. Although they should.
The standard examiner is fine with them
Compare the Standard Expert Advisor and your own Expert Advisor, find differences and draw conclusions. But the wording of the error indicates poor quality quotes, when the values from one TF do not coincide with the values from the other TF.
If this code is written for trading in mode " open prices only", then this trouble may be avoided.
Added. You are exactly trying to make a code by open prices, it's not clear why it should be tested by all ticks...Compare the standard and your own, find the differences and draw conclusions. You can get away from such misfortune if the code is written for trading in " open prices only" mode.
The standard code also uses closing prices, like mine
Which EA do you call standard? I haven't seen an EA "atclose prices" in the terminal's delivery.
And by open prices, you must either have the entire trading code working in this mode, or not to do it at all. Only part of the code is used on a new bar, the rest will work on every tick.
Which EA do you call standard? I haven't seen an EA "atclose prices" in the terminal's delivery.
And by open prices, you must either have the entire trading code working in this mode, or not to do it at all. You have only part of the code used on a new bar, the rest will work on every tick.
I would call it as a standard MACD Sample. Would you better move the search for a new bar to the beginning?
Where in MACD Sample is the "open prices only" mode, I don't see it? It's better to move the search for a new bar to the beginning of OnTick().
And it's
static datetime New_Time=TimeCurrent();// Время текущего бара
better to be declared outside the function, on a global level.
Or better yet, spend some time and search for better ways of searching for a new bar on the forum.Where in MACD Sample is the "open prices only" mode, I don't see it? It would be better to move the search for a new bar to the beginning of OnTick().
И
static datetime New_Time=TimeCurrent();// Время текущего бара
it's better to declare it outside the function, on a global level.
Folks, a hint. Tester gives error: 2017.02.08 18:24:43.751 TestGenerator: unmatched data error (low value 1.09860 at 2016.07.27 19:30 is not reached from the lowest timeframe, low price 1.09880 mismatches)
double Lots=Margin_Percent/MarketInfo(Symbol(),MODE_MARGINREQUIRED);//Определение общего количества лотов
double Lots_Volume=(MathFloor(Lots)+MarketInfo(Symbol(),MODE_LOTSTEP));
double MacdCurrent=iMACD(NULL,0,Fast_EMA_Period,Slow_EMA_Period,Signal_Period,PRICE_CLOSE,MODE_MAIN,1); //Параметры MACD основной линии текущего бара
double MacdPrevious1=iMACD(NULL,0,Fast_EMA_Period,Slow_EMA_Period,Signal_Period,PRICE_CLOSE,MODE_MAIN,2);//Параметры MACD основной линии предыдущего бара
double MacdPrevious2=iMACD(NULL,0,Fast_EMA_Period,Slow_EMA_Period,Signal_Period,PRICE_CLOSE,MODE_MAIN,3);//Параметры MACD основной линии со смещением на 2 бара
double StopLoss=iSAR(NULL,0,Step_PSAR,Maximum_PSAR,0);//Параметры Трейлинг стоп по параметрам ParabolicSAR текущего бара
double Previous_StopLoss=iSAR(NULL,0,Step_PSAR,Maximum_PSAR,1);//Параметры СтопЛосс по параметрам ParabolicSAR предыдущего бара
double CurrentPSAR=iSAR(NULL,0,Step_PSAR,Maximum_PSAR,1);//Параметры СтопЛосс по параметрам ParabolicSAR предыдущего бара
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//------
}
//-------------------------------------------------------------------------------------------------------
This is the first time I've seen variable calculations done globally outside of event-generating functions, and the compiler doesn't even complain?
No. It accepts everything as is.