Multiple indicators to ProScreener

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #244527 quote
    gp38super
    Participant
    New

    Hi. 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!

    #244540 quote
    JS
    Participant
    Senior

    It might be useful if you upload the code used because first the three indicators will have to be transformed into 1 indicator…

    #244605 quote
    gp38super
    Participant
    New
    MACD 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)
    #244624 quote
    JS
    Participant
    Senior

    I 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…

    Once MACDBars=3
    Once MABandBars=3
    Once STCBars=3
    
    //MACD on Price
    Once FastLength1=12
    Once SlowLength1=26
    Once Signal=9
    
    Once MovingAverageType=0
    
    FL=Average[FastLength1,MovingAverageType](close)
    SL=Average[SlowLength1,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
    BuyMACD=1
    else
    BuyMACD=0
    EndIf
    
    If BRSMACD Crosses Under Si Then
    //DrawArrowDown(barindex,high)coloured(255,0,0) //Signal=sell
    SellMACD=1
    else
    SellMACD=0
    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)
    BuyMABand=1
    Else
    BuyMABand=0
    EndIf
    
    if baseCrossShort then
    //codiff=-1
    //drawarrowdown(barindex,high+rangema*0.5)coloured(225,64,251)
    SellMABand=1
    else
    SellMABand=0
    //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)
    BuySTC=1
    else
    BuySTC=0
    endif
    
    STCCrossUnderOverBought = STC crosses under OverBought
    if 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=1
    else
    SellSTC=0
    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)
    
    c1=Summation[MACDBars](BuyMACD)=1
    c2=Summation[MACDBars](SellMACD)=1
    c3=Summation[MABandBars](BuyMABand)=1
    c4=Summation[MABandBars](SellMABand)=1
    c5=Summation[STCBars](BuySTC)=1
    c6=Summation[STCBars](SellSTC)=1
    
    Screener[(c1 and (c2 or c3)) or (c4 and (c5 or c6))]
    

    robertogozzi, gp38super and Iván González thanked this post
    #244656 quote
    gp38super
    Participant
    New
    Wow!! Awesome!! I can’t wait to play with this and see what I can put together. Thanks a TON! 🙂
    JS thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Multiple indicators to ProScreener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
gp38super @gp38super Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by gp38super
1 year ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/02/2025
Status: Active
Attachments: No files

Multiple indicators to ProScreener

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #244526 quote
    gp38super
    Participant
    New
    Hi. 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!
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Logo Logo
Loading...