pyatka__ASD: Can you tell me if anyone has a piece of software that has a high and low zig zag extremum connection. Thanks
I don't know which connection you need, but... This is how I determine in the EA which zigzag extremum is available - low or high, hopefully you will find what you need:
//----------------------------------------------------------------------------------------------------------------- if (op==OP_BUY)
{
for (m=1; m<=CalcBarsLimit; m++) // Найдём первый перелом ЗЗ слева от первого бара
{
zz=iCustom(sy, tf, "ZigZag", dp, dv, bs, 0, m); // Берём данные 0 буфера ЗЗ с бара mif (zz!=0 && // Если первый экстремум верхнийNormalizeDouble(zz, dg)==NormalizeDouble(iCustom(sy, tf, "ZigZag", dp, dv, bs, 1, m), dg))
return(false); // Валим отсюдаelseif (zz!=0 && // Если первый экстремум нижнийNormalizeDouble(zz, dg)==NormalizeDouble(iCustom(sy, tf, "ZigZag", dp, dv, bs, 2, m), dg))
{
if (MathRound((KLevel-zz)/pt)>=DistanceMIN && // Если расстояние от ZZ до KLevel ...MathRound((KLevel-zz)/pt)<=DistanceMAX) // ... в заданных пределах
{
if (Open[1]<KLevel &&
Close[1]>KLevel &&
pa>KLevel)
{
Fibo0_PriceB=zz; // Сохраним цену излома ZZ
Fibo23_PriceB=pa; // Сохраним цену 23 фибы
nmKLB=DoubleToStr(Time[m], 4); // имя метки
SetArrow(5, DeepSkyBlue, nmKLB, Time[m], zz, 1); // Отмечаем излом ЗЗ на графикеreturn(true);
}
}
}
}
}
//----------------------------------------------------------------------------------------------------------------- if (op==OP_SELL)
{
for (m=1; m<=CalcBarsLimit; m++) // Найдём первый перелом ЗЗ слева от первого бара
{
zz=iCustom(sy, tf, "ZigZag", dp, dv, bs, 0, m); // Берём данные 0 буфера ЗЗ с бара mif (zz!=0 && // Если первый экстремум нижнийNormalizeDouble(zz, dg)==NormalizeDouble(iCustom(sy, tf, "ZigZag", dp, dv, bs, 2, m), dg))
return(false); // Валим отсюдаelseif (zz!=0 && // Если первый экстремум верхнийNormalizeDouble(zz, dg)==NormalizeDouble(iCustom(sy, tf, "ZigZag", dp, dv, bs, 1, m), dg))
{
if (MathRound((zz-KLevel)/pt)>=DistanceMIN && // Если расстояние от ZZ до KLevel ...MathRound((zz-KLevel)/pt)<=DistanceMAX) // ... в заданных пределах
{
if (Open[1]>KLevel &&
Close[1]<KLevel &&
pb<KLevel)
{
Fibo0_PriceS=zz; // Сохраним цену излома ZZ
Fibo23_PriceS=pb; // Сохраним цену 23 фибы
nmKLS=DoubleToStr(Time[m], 4); // имя метки
SetArrow(5, BurlyWood, nmKLS, Time[m], zz, 1); // Отмечаем излом ЗЗ на графикеreturn(true);
}
}
}
}
}
return(false);
}
//-------------------------------------------------------------------------------
ZS... The code is rough and unoptimized. I hope you know it's better to subtract two normalized values and check the result for zero...
eddy: how? if a variable is declared inside start, you can assign it to return_value1?
Yes. This is called passing a parameter by reference. If a function is declared normally, its call causes all variables, passed as formal parameters, to be copied to the local variables of the function and handled. The copying is not performed when parameters are passed by reference, i.e., the function operates with their originals, not with their copies. Accordingly, all changes made in the function code with these parameters, remain effective after returning from the function code.
To pass a parameter by reference, indicate this method in the function declaration by putting the & sign before the identifier of the required parameter.
is not multiplied by 5, but by 2. In the first case, the parameter a is passed "by value" and its content is not saved after exiting the function, in the second case it is passed by reference (double &a), so the changed value, i.e. 5*2=10 will be contained in the variable a after exiting the Func2 function.
Can you tell me if anyone has a piece of software that has a high and low zig zag extremum connection. Thanks
I don't know which connection you need, but... This is how I determine in the EA which zigzag extremum is available - low or high, hopefully you will find what you need:
ZS... The code is rough and unoptimized. I hope you know it's better to subtract two normalized values and check the result for zero...
You can. Return to the parameters.
how? if a variable is declared inside start, you can assign it to return_value1?
Yes. This is called passing a parameter by reference. If a function is declared normally, its call causes all variables, passed as formal parameters, to be copied to the local variables of the function and handled. The copying is not performed when parameters are passed by reference, i.e., the function operates with their originals, not with their copies. Accordingly, all changes made in the function code with these parameters, remain effective after returning from the function code.
To pass a parameter by reference, indicate this method in the function declaration by putting the & sign before the identifier of the required parameter.
Example (compile as a script and check)
5*5=5?))
cool:)
How about this?
How about this?
The computer is busy with calculations, so I can't check it myself at the moment.
There is a piece of code like this:
Google has found several repetitions of this code, so I conclude that it works.
However, this line
is confusing.
If DecreaseFactor=3 and losses=3, then according to the formula we get Lot=0 !!!
If losses>3, we getLot<0!!!
Is it possible?
cool:)
How about this?