Is it possible to convert this strategy into a screener?
Indicator : awesome oscillator
What are the conditions?
Conditions applicable to the awesome oscillator indicator in the image
Marked by circles
Thank you for your response, my friend
Hello, if what you are looking for is an oscillator making decreasing minimums, you could store the maximum value reached by the oscillator each time it is positive and then draw a line that joins the maximums. If the line has a negative slope then we look for those values that are crossing upwards today.
AO=Average[5](MedianPrice)-Average[34](MedianPrice)
if AO > 0 then
n=n+1
aohigh = highest[n](AO)
elsif AO crosses under 0 then
$aohighprev[t+1]=aohigh[1]
$aohighprevx[t+1]=barindex-barssince(ao=aohigh)
t=1+t
else
n=0
endif
//(x-x1)/(x2-x1) = (y-y1)/(y2-y1)
y1 = $aohighprev[max(0,t-1)]
x1 = $aohighprevx[max(0,t-1)]
y2 = $aohighprev[t]
x2 = $aohighprevx[t]
yy = y1+(barindex-x1)*(y2-y1)/(x2-x1)
if y1 > y2 and ao[0] > yy and ao[1] < yy then
res = 1
else
res = 0
endif
screener[res=1]
prorParticipant
Veteran
Hello, is it ok for the reverse ?
thks
AO=Average[P1](MedianPrice)-Average[P2](MedianPrice)
if AO < 0 then
n=n+1
aoLOW = LOWest[n](AO)
elsif AO crosses OVer 0 then
$aoLOWprev[t+1]=aoLOW[1]
$aoLOWprevx[t+1]=barindex-barssince(ao=aoLOW)
t=1+t
else
n=0
endif
//(x-x1)/(x2-x1) = (y-y1)/(y2-y1)
y1 = $aoLOWprev[max(0,t-1)]
x1 = $aoLOWprevx[max(0,t-1)]
y2 = $aoLOWprev[t]
x2 = $aoLOWprevx[t]
yy = y1+(barindex-x1)*(y2-y1)/(x2-x1)
if y1 < y2 and ao[0] < yy and ao[1] > yy then
//res = 1
DRAWARROW(barindex, close)COLOURED("RED")
//else
//res = 0
endif
RETURN
Casi
AO=Average[5](MedianPrice)-Average[34](MedianPrice)
if AO < 0 then
n=n+1
aoLOW = LOWest[n](AO)
elsif AO crosses OVer 0 then
$aoLOWprev[t+1]=aoLOW[1]
$aoLOWprevx[t+1]=barindex-barssince(ao=aoLOW)
t=1+t
else
n=0
endif
//(x-x1)/(x2-x1) = (y-y1)/(y2-y1)
y1 = $aoLOWprev[max(0,t-1)]
x1 = $aoLOWprevx[max(0,t-1)]
y2 = $aoLOWprev[t]
x2 = $aoLOWprevx[t]
yy = y1+(barindex-x1)*(y2-y1)/(x2-x1)
if y1 < y2 and ao[0] < yy and ao[1] > yy then
//res = 1
DRAWARROWdown(barindex, ao)COLOURED("RED")
drawsegment(x1,y1,barindex,yy)
//else
//res = 0
endif
RETURN aolow coloured("red")style(dottedline,2), ao, $aolowprev[t] coloured("blue"), 0 style(dottedline,1)