Double Bottom screener
Forums › ProRealTime English forum › ProScreener support › Double Bottom screener
- This topic has 2 replies, 2 voices, and was last updated 5 years ago by prevailution.
Tagged: double bottom, double top
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
05/22/2019 at 1:55 PM #99165
Hi,
I am looking for a double bottom screener with minimum volume 1 million and minimum price 20 dollars
My search online found Leo’s double top and bottom screener, but I am wondering if it is possible to:
- Exclude double tops
- Add minimum volume
- Add minimum price
His screener code is. I’m not sure how to exclude double tops and add minimum conditions without ruining the code.
Leo code123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156//LOCALS MINIMUMS AND MAXIMUMS USING LEO MOVING AVERAGE//Autor: LEO//VARIABLES TO BE OPTIMIZEDPERIOD=40 //Period for analysis//Definition of what is a double top or double bottomKdouble=0.2 //Factor for defining what is double top or bottom//-----------//Leo Moving Average, formula: LMA= WMA+(WMA-SMA)LMA=2*weightedaverage[period](close)-average[period](close)//Smoothed curve of Leo Moving AverageIF BARINDEX > period THENsmoothLMA=weightedaverage[period](LMA)ELSEsmoothLMA=undefinedENDIF// Direction or trend of the LMA// << Storage of minimums and maximums >>once mintemp=lowonce posmintemp=1once maxtemp=highonce posmaxtemp=1IF BARINDEX>2 THEN// the value 0.7 is to ensure that the donchian channel is faster than the curves analysis (this value to be checked)IF low < lowest[round(0.7*period)](low[1]) THENmintemp=low //minimum temporalposmintemp=BARINDEX //postition of minimum temporalENDIFIF high > highest[round(0.7*period)](high[1]) thenmaxtemp=high //maximum temporalposmaxtemp=BARINDEX //position maximum temporalENDIFENDIF// << Detecting and locating a local minimums >>// Where the LMA is crossing the smoothed LMA, there is a maximum or minimum nearby// If there is a new local min/max, the preivus one is stored in de varible B... (before)once LEVMIN=lowonce POSLEVMIN=1once LEVMAX=highonce POSLEVMAX=1once bullcross=0once bearcross=0IF BARINDEX > PERIOD THEN //For avoid computer errorsbullcross=LMA crosses over smoothLMAbearcross=LMA crosses under smoothLMAENDIFIF bullcross and POSLEVMIN<>posmintemp THENBLEVMIN=LEVMIN //previus local minimum is savedBPOSLEVMIN=POSLEVMINLEVMIN=mintempPOSLEVMIN=posmintempsupport=LEVMINENDIF// --> Detecting and locating a local maximumIF bearcross and POSLEVMAX<>posmaxtemp THENBLEVMAX=LEVMAX //previus local maximum is savedBPOSLEVMAX=POSLEVMAXLEVMAX=maxtempPOSLEVMAX=posmaxtempresistance=LEVMAXENDIFsupport=min(low,support)resistance=max(high,resistance)// << DETECTING DOUBLE TOP OR BOTTOMS >>once WidthDoubleTop = high-lowonce WidthDoubleBottom = high-lowonce Wpattern=0once Mpattern=0// <<<<<< Double bottoms >>>>>>>>>//looking for the top between two local minimumsIF bullcross THENdoublebottomtop=high[BARINDEX-POSLEVMIN+1] // we start looking for the top in between two local minimums//POSdoublebottomtop=BARINDEX-POSLEVMIN+1FOR i = (BARINDEX-POSLEVMIN+1) to (BARINDEX-BPOSLEVMIN-1) DOIF high[i] > doublebottomtop THENdoublebottomtop=high[i]//POSdoublebottomtop=BARINDEX-iENDIFNEXTWidthDoubleBottom = doublebottomtop-(BLEVMIN+LEVMIN)/2 // (top betwen local minimums) - (average of the las two local minimums)IF abs(BLEVMIN-LEVMIN) < Kdouble*WidthDoubleBottom THEN// we have a double bottomWpattern=1elseWpattern=0ENDIFENDIF// <<<<<<<<<< Double tops >>>>>>>//looking for the bottom between two local maximumsIF bearcross THENdoubletopbottom=low[BARINDEX-POSLEVMAX+1]//POSdoubletopbottom=BARINDEX-POSLEVMAX+1FOR i = (BARINDEX-POSLEVMAX+1) to (BARINDEX-BPOSLEVMAX-1) DOIF low[i] < doubletopbottom THENdoubletopbottom=low[i]//POSdoubletopbottom=BARINDEX-iENDIFNEXTWidthDoubleTop=(BLEVMAX+LEVMAX)/2 -doubletopbottomIF abs(BLEVMAX-LEVMAX) < Kdouble*WidthDoubleTop THEN// we have a double topMpattern=1elseMpattern=0ENDIFENDIF// <<<<<<<<<< DOUBLE TOP AND DOUBLE BOTTOM FOR TRADING >>>>>>>>myATR=AverageTrueRange[2*period](close)IF Wpattern=1 THENIF close > (doublebottomtop+myATR) or close < (LEVMIN-0.5*myATR) THENWpattern=0 // <<<< double bottom has been activated or it was cancelled >>>>>ELSE// <<<<<<< HERE WE HAVE A DOUBLE BOTTOM FOR TRADING >>>>>exactness=abs(BLEVMIN-LEVMIN) / WidthDoubleBottomENDIFENDIFIF Mpattern=1 THENIF close < (doubletopbottom-myATR) or close > (LEVMAX+0.5*myATR) THENMpattern=0 //double top has been activated or it was cancelledELSE// <<<<<<< HERE WE HAVE A DOUBLE TOP FOR TRADING >>>>>exactness= abs(BLEVMAX-LEVMAX) / WidthDoubleTopENDIFENDIFSCREENER[Wpattern=1 or Mpattern=1](exactness)05/22/2019 at 5:02 PM #99193It is not necessary to delete the double top part, just add a condition that there is no double top. I added a minimum price and volume condition at the end of the code, you can change it there.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158//LOCALS MINIMUMS AND MAXIMUMS USING LEO MOVING AVERAGE//Autor: LEO//VARIABLES TO BE OPTIMIZEDPERIOD=40 //Period for analysis//Definition of what is a double top or double bottomKdouble=0.2 //Factor for defining what is double top or bottom//-----------//Leo Moving Average, formula: LMA= WMA+(WMA-SMA)LMA=2*weightedaverage[period](close)-average[period](close)//Smoothed curve of Leo Moving AverageIF BARINDEX > period THENsmoothLMA=weightedaverage[period](LMA)ELSEsmoothLMA=undefinedENDIF// Direction or trend of the LMA// << Storage of minimums and maximums >>once mintemp=lowonce posmintemp=1once maxtemp=highonce posmaxtemp=1IF BARINDEX>2 THEN// the value 0.7 is to ensure that the donchian channel is faster than the curves analysis (this value to be checked)IF low < lowest[round(0.7*period)](low[1]) THENmintemp=low //minimum temporalposmintemp=BARINDEX //postition of minimum temporalENDIFIF high > highest[round(0.7*period)](high[1]) thenmaxtemp=high //maximum temporalposmaxtemp=BARINDEX //position maximum temporalENDIFENDIF// << Detecting and locating a local minimums >>// Where the LMA is crossing the smoothed LMA, there is a maximum or minimum nearby// If there is a new local min/max, the preivus one is stored in de varible B... (before)once LEVMIN=lowonce POSLEVMIN=1once LEVMAX=highonce POSLEVMAX=1once bullcross=0once bearcross=0IF BARINDEX > PERIOD THEN //For avoid computer errorsbullcross=LMA crosses over smoothLMAbearcross=LMA crosses under smoothLMAENDIFIF bullcross and POSLEVMIN<>posmintemp THENBLEVMIN=LEVMIN //previus local minimum is savedBPOSLEVMIN=POSLEVMINLEVMIN=mintempPOSLEVMIN=posmintempsupport=LEVMINENDIF// --> Detecting and locating a local maximumIF bearcross and POSLEVMAX<>posmaxtemp THENBLEVMAX=LEVMAX //previus local maximum is savedBPOSLEVMAX=POSLEVMAXLEVMAX=maxtempPOSLEVMAX=posmaxtempresistance=LEVMAXENDIFsupport=min(low,support)resistance=max(high,resistance)// << DETECTING DOUBLE TOP OR BOTTOMS >>once WidthDoubleTop = high-lowonce WidthDoubleBottom = high-lowonce Wpattern=0once Mpattern=0// <<<<<< Double bottoms >>>>>>>>>//looking for the top between two local minimumsIF bullcross THENdoublebottomtop=high[BARINDEX-POSLEVMIN+1] // we start looking for the top in between two local minimums//POSdoublebottomtop=BARINDEX-POSLEVMIN+1FOR i = (BARINDEX-POSLEVMIN+1) to (BARINDEX-BPOSLEVMIN-1) DOIF high[i] > doublebottomtop THENdoublebottomtop=high[i]//POSdoublebottomtop=BARINDEX-iENDIFNEXTWidthDoubleBottom = doublebottomtop-(BLEVMIN+LEVMIN)/2 // (top betwen local minimums) - (average of the las two local minimums)IF abs(BLEVMIN-LEVMIN) < Kdouble*WidthDoubleBottom THEN// we have a double bottomWpattern=1elseWpattern=0ENDIFENDIF// <<<<<<<<<< Double tops >>>>>>>//looking for the bottom between two local maximumsIF bearcross THENdoubletopbottom=low[BARINDEX-POSLEVMAX+1]//POSdoubletopbottom=BARINDEX-POSLEVMAX+1FOR i = (BARINDEX-POSLEVMAX+1) to (BARINDEX-BPOSLEVMAX-1) DOIF low[i] < doubletopbottom THENdoubletopbottom=low[i]//POSdoubletopbottom=BARINDEX-iENDIFNEXTWidthDoubleTop=(BLEVMAX+LEVMAX)/2 -doubletopbottomIF abs(BLEVMAX-LEVMAX) < Kdouble*WidthDoubleTop THEN// we have a double topMpattern=1elseMpattern=0ENDIFENDIF// <<<<<<<<<< DOUBLE TOP AND DOUBLE BOTTOM FOR TRADING >>>>>>>>myATR=AverageTrueRange[2*period](close)IF Wpattern=1 THENIF close > (doublebottomtop+myATR) or close < (LEVMIN-0.5*myATR) THENWpattern=0 // <<<< double bottom has been activated or it was cancelled >>>>>ELSE// <<<<<<< HERE WE HAVE A DOUBLE BOTTOM FOR TRADING >>>>>exactness=abs(BLEVMIN-LEVMIN) / WidthDoubleBottomENDIFENDIFIF Mpattern=1 THENIF close < (doubletopbottom-myATR) or close > (LEVMAX+0.5*myATR) THENMpattern=0 //double top has been activated or it was cancelledELSE// <<<<<<< HERE WE HAVE A DOUBLE TOP FOR TRADING >>>>>exactness= abs(BLEVMAX-LEVMAX) / WidthDoubleTopENDIFENDIFminprice = close>10minvol = volume>100000SCREENER[Wpattern=1 and not Mpattern and minprice and minvol](exactness)1 user thanked author for this post.
05/22/2019 at 6:09 PM #99199 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: