Hi all,
I create and indicator that highlighted the moment previous to a crossing SMA and the moment afterwards. What is called “Golden Cross” and “Death Cross”
The indicator is very simple but an be very usefully for an automatic strategy. Because it shows in real time the moment where is inevitable the crossing of two Simple Moving Average and the moment afterwards.
How it can be used? well I can imagine an strategy using it as a filter for Higher Time Frame or multi crossing of SMA in different time frame.
Hope you like it.
period001 = 50
period = 100
WMA001=weightedaverage[period001](close)
WwMA001=weightedaverage[period001](WMA001)
SMA002=average[period002](close)
//Crossing areas definiton
CrossingBULL=0
IF WMA001 > SMA002 and WwMA001 < SMA002 then
CrossingBULL=1
ENDIF
CrossingBEAR=0
IF WMA001 < SMA002 and WwMA001 > SMA002 then
CrossingBEAR=1
ENDIF
Return CrossingBULL COLOURED(0,150,0) STYLE(histogram,2) as "Crossing Bull", CrossingBEAR COLOURED(200,0,0) STYLE(histogram,2) as "Crossing Bear", 0 as "cero"