[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 320
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
How do I know if there is an open or a pending order at the given price?
Go through the orders and compare with the given price. If so, check the open time
if(OrderOpenTime()!=0) If not equal to zero, then it is open, if equal, then it is pending.
{
double kr =0.00060 // set multiple, step
double msell =Ask - MathMod( Ask, kr); // sell price
{
Alert(" just ", msell," typed);
return;// exit start()
}
//----
//----
return(0)
}
Can you tell me what's wrong here?
compilation gives 'msell' - variable not defined C:\Program Files\MetaTrader 4 \experts\temp.mq4 (16, 11)
we have a counter where the values are calculated according to the order in which the bars appear from the bar with indexi_AnyBarsToHistory to the bar with index 1. It follows that if the condition will be fulfilled on the bars from index 30 to index 15:
directionMA == CROSS_UP
and then for example at cnt=2 the condition will be fulfilled:
Then cnt will be incremented to the previous value. If we had 2, the new condition will increment with 1, then cnt=3 and we will exit the function with value 3. Do you see what I mean? Take a closer look, the logic is in principle clear here.
Sorry for the delay in replying, I was dealing with my handheld. So. The question is, how to use such a single counter to determine which movement it refers to, right? You can sew a logical variable into the counter, but then increment it by two instead of one.
It goes something like this.
found it myself )
As they say, that's the way our people are, they're full of advice. Didn't have time).
Sorry for the delay in replying, I was dealing with the car.
Sorry for the delay in replying, I was dealing with the car. So. The question is, how to use such a single counter to determine which movement it refers to, right? You can sew a logical variable into the counter, but then increment it by two instead of one.
It goes something like this.
Well, you have written it for the indicator, not for the Expert Advisor. I am an Expert Advisor.
And why increment by 2?
So. The question is, how to determine which movement it refers to, right?
I want the calculation of consecutive bars of one characteristic (for example, either bearish or bullish) to be based on some characteristic, which is passed through a function parameter.
By the way, https://www.mql5.com/ru/forum/144705, I have created a separate branch. It is all there, what is needed. It's very interesting to find what's wrong.