Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1599
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
Both conditions fit...so you get the first result
Both conditions fit...so you get the first result
For some reason I don't think it returns 1 either.
This condition
Tells you that a new bar has been opened. On the first tick of the bar open == high == low == close and == Bid - hence the condition
or
cannot be fulfilled...There was a question today about the condition if(i != i) These conditions are approximately the same.
P.S.
with the isCrossing() function left everything as it is.
For some reason I don't think it returns 1 either.
This condition
tells about the opening of a new bar. On the first tick of the bar open == high == low == close and == Bid - hence, the condition
or
cannot be fulfilled...There was a question today about the condition if(i != i) These conditions are about the same.
"1" returns, did code debugging in MetaEditor.
Further, even if everything is equal, it's only on the first tick.
"1" returns, did code debugging in MetaEditor.
Further, even if everything is equal, it's only on the first tick.
Well, yes, I was wrong. The new bar will be only after the whole condition is fulfilled.
Try to replace high and low by open. Maybe it won't affect the strategy too much.
"1" returns, did code debugging in MetaEditor.
Further, even if everything is equal, it is only on the first tick.
It works like this
It works like this.
I did this and it all works, only messages from isCrossing() are duplicated, because the f-e is called twice for one tick.
So I left it as it was, only now everything from isCrossing() is returned to variable. Nothing is duplicated and everything works. Thanks all :)
can you please explain the difference between the functions?
for (int j = OrdersHistoryTotal()-1; j >= 0; j--)
{
if(OrderSelect(j, SELECT_BY_POS,MODE_HISTORY))
и
int i=OrdersHistoryTotal();
for(int pos=0; pos<i; pos++)
{
if(OrderSelect(pos, SELECT_BY_POS,MODE_HISTORY))