Forums › ProRealTime forum Français › Support ProScreener › range filter buy & sell › Reply To: range filter buy & sell
09/24/2023 at 2:05 PM
#221513
HELLO ci après le screener avec per=80 (à adapter) :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
// Source src = close // Sampling Period // Settings for 5min chart, BTCUSDC. For Other coin, change the paremeters // per = defval=100, minval=1, "Sampling Period" per=80 // Range Multiplier // mult = defval=3.0, minval=0.1, "Range Multiplier" mult=3 // Smooth Average Range wper = per*2 -1 avrng = exponentialaverage[per](abs(src-src[1])) smrng = mult * exponentialaverage[wper](avrng) // Range Filter rngfilt = src If src > rngfilt[1] then If rngfilt[1] > src-smrng then rngfilt = rngfilt[1] Else rngfilt = src-smrng endif elsif rngfilt[1] < src+smrng then rngfilt = rngfilt[1] else rngfilt = src+smrng endif filt = rngfilt // Filter Direction upward = 0 If filt > filt[1] then upward = upward[1]+1 elsif filt < filt[1] then upward = 0 else upward = upward[1] endif downward = 0 If filt < filt[1] then downward = downward[1]+1 elsif filt > filt[1] then downward = 0 else downward = downward[1] endif // Target Bands //hband = filt + smrng //lband = filt - smrng // Colors //If upward > 0 then //filtcolorR = upColorR //filtcolorG = upColorG //filtcolorB = upColorB //elsif downward > 0 then //filtcolorR = downColorR //filtcolorG = downColorG //filtcolorB = downColorB //else //filtcolorR = midColorR //filtcolorG = midColorG //filtcolorB = midColorB //endif if src > filt and src > src[1] and upward > 0 then //barcolorR = upColorR //barcolorG = upColorG //barcolorB = upColorB elsif src > filt and src < src[1] and upward > 0 then //barcolorR = upColorR //barcolorG = upColorG //barcolorB = upColorB elsif src < filt and src < src[1] and downward > 0 then //barcolorR = downColorR //barcolorG = downColorG //barcolorB = downColorB elsif src < filt and src > src[1] and downward > 0 then //barcolorR = downColorR //barcolorG = downColorG //barcolorB = downColorB else //barcolorR = midColorR //barcolorG = midColorG //barcolorB = midColorB endif // Break Outs longCond = (src > filt and src > src[1] and upward > 0) or (src > filt and src < src[1] and upward > 0) shortCond = (src < filt and src < src[1] and downward > 0) or (src < filt and src > src[1] and downward > 0) CondIni = 0 If longCond then CondIni = 1 elsif shortCond then CondIni = -1 else CondIni = CondIni[1] endif longCondition = longCond and CondIni[1] = -1 shortCondition = shortCond and CondIni[1] = 1 F=longCondition or shortCondition //Alerts If longCondition then flag=1 endif If shortCondition then flag=2 endif screener [F](flag=1 as"long",flag=2 as "court") |