Dears traders,
Example long
When sma60> sma90 and sma60> sma150 and sma90> sma150 we will take as maximum reference the maximum of the 30 bars before the cross.
If then this maximum will be broken upwards we will have long signal.
I have verified that it does not respect the maximum constraint of the 30 candles before the cross up.
What's wrong with the formula ??
thank you.
All help graciously received and appreciated.
luca
in simple terms:
When the averages cross up, the cross is the condition that if it is true we will have buy signal at the top when it is exceeds the previous 30 candles crossing.
code:
Input: average(c), len(60), len1(90),len2(150);
condition1= len>len1 and len>len2 and len1>len2 ;
condition2=len<len1 and len<len2 and len1<len2;
condition3=H crosses over Highest(h,30);
condition4=L crosses under Lowest(l,30);
if condition1 and condition3 then buy next bar at market;
if condition2 and condition4 then sellshort next bar at market;
Example long
When sma60> sma90 and sma60> sma150 and sma90> sma150 we will take as maximum reference the maximum of the 30 bars before the cross.
If then this maximum will be broken upwards we will have long signal.
I have verified that it does not respect the maximum constraint of the 30 candles before the cross up.
What's wrong with the formula ??
thank you.
All help graciously received and appreciated.
luca
in simple terms:
When the averages cross up, the cross is the condition that if it is true we will have buy signal at the top when it is exceeds the previous 30 candles crossing.
code:
Input: average(c), len(60), len1(90),len2(150);
condition1= len>len1 and len>len2 and len1>len2 ;
condition2=len<len1 and len<len2 and len1<len2;
condition3=H crosses over Highest(h,30);
condition4=L crosses under Lowest(l,30);
if condition1 and condition3 then buy next bar at market;
if condition2 and condition4 then sellshort next bar at market;
Last edited: