Multiple indicators to ProScreener
Forums › ProRealTime English forum › ProScreener support › Multiple indicators to ProScreener
- This topic has 4 replies, 2 voices, and was last updated 8 months ago by  gp38super. gp38super.
- 
	
		
- 
		
			
				
03/02/2025 at 12:04 AM #244527Hi. Need help getting screener to identify when at least 2 out of 3 indicators are true. I’ve gotten great help building “Entry Signal”, “SP Indicator” and an “MACD” signal to all draw arrows when true, but would now like to scan for either or all of the following: at a minimum: scan for tickers on my watchlist/s and identify when Entry Signal and MACD signal(buy signals(arrows)) are both true on same 2min candles on or after close; beyond that, ideally, when at least 2 out of the 3 are true, possibly within “x” number of bars. For instance, identify if MACD signal is true, AND SP OR Entry on same candle, possibly within say, 2 candles. Or possibly, identify when Entry signal is true AND SP or MACD within 2 candles(or something similar) Would be amazing to be able to adjust which signals and within how many candles, if that makes sense. I primarily use 2min chart for active trading/scalping, but I also use similar design on current Thinkorswim scanner to identify same kind of search for signals on daily chart to identify strong potential in daily movement. I can provide the scripts I’m currently using for these indicators, but they are also in the forum. I hope I described what I’m trying to do well enough to understand. π Thanks! 03/02/2025 at 2:38 PM #24454003/03/2025 at 8:58 PM #244605MACD on price: FL=Average[FastLength,MovingAverageType](close) 
 SL=Average[SlowLength,MovingAverageType](close)
 BRSMACD=FL-SL
 Si=Average[Signal,MovingAverageType](BRSMACD)
 Zeroline=0
 D=BRSMACD-Si
 If BRSMACD Crosses Over Si Then
 DrawArrowUp(barindex,low-0.5*pipsize)coloured(0,255,0) //Signal=buy
 Elsif BRSMACD Crosses Under Si Then
 DrawArrowDown(barindex,high)coloured(255,0,0) //Signal=sell
 Endif
 Return BRSMACD as “MACD”, Si as “Signal”, Zeroline as “Zeroline”, D as “Histogram”>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SP on Price: //—————————————// 
 //PRC_SP Indicator
 //version = 1
 //11.02.2025
 //IvΓ‘n GonzΓ‘lez @ http://www.prorealcode.com
 //Sharing ProRealTime knowledge
 //—————————————//
 // inputs
 //—————————————//
 src=close
 len=60
 //—————————————//
 // Moving Average and Bands
 //—————————————//
 bbmc=average[max(1,round(sqrt(len))),2](average[max(1,round(len/2)),2](src)*2-average[len,2](src))
 rangema=average[len,1](tr)
 upperk=bbmc+rangema*0.2
 lowerk=bbmc-rangema*0.2
 //—————————————//
 // Colors Definition
 //—————————————//
 if close>upperk then
 r=33
 g=150
 b=243
 elsif close<lowerk then
 r=225
 g=64
 b=251
 else
 r=120
 g=123
 b=134
 endif
 drawcandle(open,high,low,close)coloured(r,g,b)
 //—————————————//
 // Signals
 //—————————————//
 srcH=high
 lenH=15
 ExitHigh=average[max(1,round(sqrt(lenH))),2](average[max(1,round(lenH/2)),2](srcH)*2-average[lenH,2](srcH))
 srcL=low
 lenL=15
 ExitLow=average[max(1,round(sqrt(lenL))),2](average[max(1,round(lenL/2)),2](srcL)*2-average[lenL,2](srcL))
 if close>ExitHigh then
 Hlv3=1
 elsif close<ExitLow then
 Hlv3=-1
 endif
 if Hlv3<0 then
 sslExit=ExitHigh
 else
 sslExit=ExitLow
 endif
 baseCrossLong=close crosses over sslExit
 baseCrossShort=close crosses under sslExit
 if baseCrossLong then
 codiff=1
 drawarrowup(barindex,low-pipsize*1.5)coloured(33,150,243)
 elsif baseCrossShort then
 codiff=-1
 drawarrowdown(barindex,high+rangema*0.5)coloured(225,64,251)
 else
 codiff=1=undefined
 endif
 //—————————————//
 return bbmc coloured(r,g,b)style(line,2)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Entry signal on Price //———————————————————// 
 //PRC_Trend Cycle STC
 //version = 0
 //20.02.2025
 //IvΓ‘n GonzΓ‘lez @ http://www.prorealcode.com
 //Sharing ProRealTime knowledge
 //———————————————————//
 // Inputs
 //———————————————————//
 fastLength = 23 // Fast moving average length (MACD)
 slowLength = 50 // Slow moving average length (MACD)
 KPeriod = 10 // %K period for stochastic
 DPeriod = 3 // %D period for stochastic smoothing
 overBought = 75 // Overbought level
 overSold = 25 // Oversold level
 averageType = 1 // Type of moving average used in calculations
 //———————————————————//
 // MACD Calculation
 //———————————————————//
 mymacd= average[fastLength,averageType](close)-average[slowLength,averageType](close)
 // First Stochastic Stage on MACD
 LowestMACD = LOWEST[ KPeriod ](mymacd)
 HighestMACD = HIGHEST[ KPeriod ](mymacd)
 IF HighestMACD – LowestMACD <> 0 THEN
 FastK1 = ((mymacd – LowestMACD) / (HighestMACD – LowestMACD)) * 100
 ELSE
 FastK1 = 0
 ENDIF
 FastD1 = AVERAGE[DPeriod,averageType](FastK1) // Smoothed FastK1
 // Second Stochastic Stage on FastD1
 LowestFastD1 = LOWEST[KPeriod](FastD1)
 HighestFastD1 = HIGHEST[KPeriod](FastD1)
 IF HighestFastD1 – LowestFastD1 <> 0 THEN
 FastK2 = ((FastD1 – LowestFastD1) / (HighestFastD1 – LowestFastD1)) * 100
 ELSE
 FastK2 = 0
 ENDIF
 // Final STC Calculation
 STC = AVERAGE[DPeriod,averageType](FastK2)
 //———————————————————//
 // Plot
 //———————————————————//
 // Detection of Crossovers from the Oversold Zone
 STCCrossAboveOversold = STC crosses over Oversold
 if STCCrossAboveOversold then
 drawarrowup(barindex,low-1.5*pipsize)coloured(“white”)
 //drawpoint(barindex,STC,5)coloured(“green”,40)
 //drawpoint(barindex,STC,2)coloured(“green”,200)
 endif
 // Color Assignment
 IF STC > OverBought THEN
 r = 255
 g = 0
 b = 0 // Red for overbought
 ELSIF STC < OverSold THEN
 r = 0
 g = 255
 b = 0 // Green for oversold
 ELSE
 r = 128
 g = 128
 b = 128 // Grey for neutral zone
 ENDIF
 //———————————————————//
 // Return Oscillator below price
 //———————————————————//
 RETURN //STC AS “STC Oscilador” COLOURED(r,g,b) STYLE(LINE,2), OverBought AS “Sobrecompra” COLOURED(“red”) STYLE(dottedline), OverSold AS “Sobreventa” COLOURED(“green”) STYLE(dottedline)03/04/2025 at 12:09 PM #244624I have combined the three indicators with each other but there are a few points of attention in the indicators such as variables that are not used, the STC indicator only goes “Long” (I have adjusted) and some other things… You can set the number of bars that the signal is valid for all three indicators… I have now made a certain combination of the conditions, but other combinations can also be set… Combined Screener123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202Once MACDBars=3Once MABandBars=3Once STCBars=3//MACD on PriceOnce FastLength1=12Once SlowLength1=26Once Signal=9Once MovingAverageType=0FL=Average[FastLength1,MovingAverageType](close)SL=Average[SlowLength1,MovingAverageType](close)BRSMACD=FL-SLSi=Average[Signal,MovingAverageType](BRSMACD)//Zeroline=0//D=BRSMACD-SiIf BRSMACD Crosses Over Si Then//DrawArrowUp(barindex,low-0.5*pipsize)coloured(0,255,0) //Signal=buyBuyMACD=1elseBuyMACD=0EndIfIf BRSMACD Crosses Under Si Then//DrawArrowDown(barindex,high)coloured(255,0,0) //Signal=sellSellMACD=1elseSellMACD=0Endif//Return BRSMACD as "MACD", Si as "Signal", Zeroline as "Zeroline", D as "Histogram"//SP on Price://βββββββββββββ////PRC_SP Indicator//version = 1//11.02.2025//IvΓ‘n GonzΓ‘lez @ http://www.prorealcode.com//Sharing ProRealTime knowledge//βββββββββββββ//// inputs//βββββββββββββ////src=close//len=60//βββββββββββββ//// Moving Average and Bands//βββββββββββββ////bbmc=average[max(1,round(sqrt(len))),2](average[max(1,round(len/2)),2](src)*2-average[len,2](src))//rangema=average[len,1](tr)//upperk=bbmc+rangema*0.2//lowerk=bbmc-rangema*0.2//βββββββββββββ//// Colors Definition//βββββββββββββ////if close>upperk then//r=33//g=150//b=243//elsif close<lowerk then//r=225//g=64//b=251//else//r=120//g=123//b=134//endif//drawcandle(open,high,low,close)coloured(r,g,b)//βββββββββββββ//// Signals//βββββββββββββ//srcH=highlenH=15ExitHigh=average[max(1,round(sqrt(lenH))),2](average[max(1,round(lenH/2)),2](srcH)*2-average[lenH,2](srcH))srcL=lowlenL=15ExitLow=average[max(1,round(sqrt(lenL))),2](average[max(1,round(lenL/2)),2](srcL)*2-average[lenL,2](srcL))if close>ExitHigh thenHlv3=1elsif close<ExitLow thenHlv3=-1endifif Hlv3<0 thensslExit=ExitHighelsesslExit=ExitLowendifbaseCrossLong=close crosses over sslExitbaseCrossShort=close crosses under sslExitif baseCrossLong then//codiff=1//drawarrowup(barindex,low-pipsize*1.5)coloured(33,150,243)BuyMABand=1ElseBuyMABand=0EndIfif baseCrossShort then//codiff=-1//drawarrowdown(barindex,high+rangema*0.5)coloured(225,64,251)SellMABand=1elseSellMABand=0//codiff=1=undefinedendif//βββββββββββββ////return bbmc coloured(r,g,b)style(line,2)//Entry signal on Price//βββββββββββββββββββ////PRC_Trend Cycle STC//version = 0//20.02.2025//IvΓ‘n GonzΓ‘lez @ http://www.prorealcode.com//Sharing ProRealTime knowledge//βββββββββββββββββββ//// Inputs//βββββββββββββββββββ//fastLength = 23 // Fast moving average length (MACD)slowLength = 50 // Slow moving average length (MACD)KPeriod = 10 // %K period for stochasticDPeriod = 3 // %D period for stochastic smoothingoverBought = 75 // Overbought leveloverSold = 25 // Oversold levelaverageType = 1 // Type of moving average used in calculations//βββββββββββββββββββ//// MACD Calculation//βββββββββββββββββββ//mymacd= average[fastLength,averageType](close)-average[slowLength,averageType](close)// First Stochastic Stage on MACDLowestMACD = LOWEST[ KPeriod ](mymacd)HighestMACD = HIGHEST[ KPeriod ](mymacd)IF HighestMACD - LowestMACD <> 0 THENFastK1 = ((mymacd - LowestMACD) / (HighestMACD - LowestMACD)) * 100ELSEFastK1 = 0ENDIFFastD1 = AVERAGE[DPeriod,averageType](FastK1) // Smoothed FastK1// Second Stochastic Stage on FastD1LowestFastD1 = LOWEST[KPeriod](FastD1)HighestFastD1 = HIGHEST[KPeriod](FastD1)IF HighestFastD1 - LowestFastD1 <> 0 THENFastK2 = ((FastD1 - LowestFastD1) / (HighestFastD1 - LowestFastD1)) * 100ELSEFastK2 = 0ENDIF// Final STC CalculationSTC = AVERAGE[DPeriod,averageType](FastK2)//βββββββββββββββββββ//// Plot//βββββββββββββββββββ//// Detection of Crossovers from the Oversold ZoneSTCCrossAboveOversold = STC crosses over Oversoldif STCCrossAboveOversold then//drawarrowup(barindex,low-1.5*pipsize)coloured("white")//drawpoint(barindex,STC,5)coloured("green",40)//drawpoint(barindex,STC,2)coloured("green",200)BuySTC=1elseBuySTC=0endifSTCCrossUnderOverBought = STC crosses under OverBoughtif STCCrossUnderOverBought then//drawarrowup(barindex,low-1.5*pipsize)coloured("white")//drawpoint(barindex,STC,5)coloured("green",40)//drawpoint(barindex,STC,2)coloured("green",200)SellSTC=1elseSellSTC=0endif//// Color Assignment//IF STC > OverBought THEN//r = 255//g = 0//b = 0 // Red for overbought//ELSIF STC < OverSold THEN//r = 0//g = 255//b = 0 // Green for oversold//ELSE//r = 128//g = 128//b = 128 // Grey for neutral zone//ENDIF//βββββββββββββββββββ//// Return Oscillator below price//βββββββββββββββββββ////RETURN //STC AS "STC Oscilador" COLOURED(r,g,b) STYLE(LINE,2), OverBought AS "Sobrecompra" COLOURED("red") STYLE(dottedline), OverSold AS "Sobreventa" COLOURED("green") STYLE(dottedline)c1=Summation[MACDBars](BuyMACD)=1c2=Summation[MACDBars](SellMACD)=1c3=Summation[MABandBars](BuyMABand)=1c4=Summation[MABandBars](SellMABand)=1c5=Summation[STCBars](BuySTC)=1c6=Summation[STCBars](SellSTC)=1Screener[(c1 and (c2 or c3)) or (c4 and (c5 or c6))]3 users thanked author for this post.03/04/2025 at 10:30 PM #244656
- 
		AuthorPosts
			Find exclusive trading pro-tools on 
 
  
  
		 
		 
		