[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

 
sdm:
Add in a description of punctuation, and a definition of your concepts (e.g. 'your number') and here. And in this branch only help those with their own hands (and that's when the mood strikes)
 
how do I know if there is an open or set order at a given price?
 
sdm:
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.

 
int start()
{

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)

 
found it myself )
 
hoz:

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:

directionMA == CROSS_DN

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.

int LastCandlesType(int& cnt){//передаём параметры по ссылке, т.е. они у нас отсюда меняются на глобальном уровне
        for (int i=IndicatorCounted(); i>=1; i--){//считаем все неподсчитанные свечи; появится новая свеча - функция прогонится один раз
                if ((2*cross-1)*(Close[i] - Open[i]) >= i_sizeOfSequentialCorrectionBar * pt){cnt=cnt+2;//инкрементируем на 2, т.к. у нас в cnt вшит cross
                }else{
                        cross = !cross;//иначе, если не соответствует, оборачиваем флаг направления
                        cnt = cross;//и обнуляем счётчик её значением
                }//потом cnt/2 будет количеством подсчитанных свечей,
        }//а cnt%2 - их направлением.
}

It goes something like this.

 
sdm:
double kr =0.00060;//внимательнее надо быть
sdm:
found it myself )

As they say, that's the way our people are, they're full of advice. Didn't have time).

 
Good afternoon. Could you please tell me how to solve the following situation: I have drawn anOBJ_FIBOARC object in the window. I have set the required levels. I want to understand that the price has crossed one level or another. I solved a similar problem with Fibonacci levels, but it's easier because we operate with horizontal levels and crossing can be easily calculated. Here we have an ellipse. We cannot use the equation of the circle (ellipse) here because the X coordinate system is time and the Y coordinate system is price, i.e. values are not comparable.
 
gyfto:

Sorry for the delay in replying, I was dealing with the car.

Ooh, naughty boy! You're still tormenting Mashka :)

gyfto:

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.

int LastCandlesType(int& cnt){//передаём параметры по ссылке, т.е. они у нас отсюда меняются на глобальном уровне
        for (int i=IndicatorCounted(); i>=1; i--){//считаем все неподсчитанные свечи; появится новая свеча - функция прогонится один раз
                if ((2*cross-1)*(Close[i] - Open[i]) >= i_sizeOfSequentialCorrectionBar * pt){cnt=cnt+2;//инкрементируем на 2, т.к. у нас в cnt вшит cross
                }else{
                        cross = !cross;//иначе, если не соответствует, оборачиваем флаг направления
                        cnt = cross;//и обнуляем счётчик её значением
                }//потом cnt/2 будет количеством подсчитанных свечей,
        }//а cnt%2 - их направлением.
}

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?

gyfto:

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.

 
So here's the question ... I don't understand, when I downloaded the quotes, the terminal runs a script to recalculate timeframes..... on a month which day it puts 30 or 31 how do I know?
Reason: