Lol !!
I tried to retrieve a bar's value wich is crossing above my MA10 ...
Without success the "cross" function gives only the value 1, true or 0.
What is the good way?
Here is what I have done.
First attempt
2nd attempt
I tried to retrieve a bar's value wich is crossing above my MA10 ...
Without success the "cross" function gives only the value 1, true or 0.
What is the good way?
Here is what I have done.
First attempt
Code:
Curve1= 0 ;
Curve2 = 0;
Curve1 = Cross(MA(C,10),MA(C,30)); // gives only 1 , true or false?!
Curve2= Ref(Cross(WMA(C,10),MA(C,30)),80);
2nd attempt
Code:
a= 0;
b= 0 ;
for(i=0;i<BarCount;i++)
{
if (MA(C,10) = MA(C,30)) //the formula to see a cross but there is a bug
{
a = MA(C,30);
b = Ref(MA(C,30,80);// I need to retrieve the value 80 days ago .
}
else
{
a = 0;
b =0 ;
}
}