This code is made of hk-lisse attempt to create divergences signals spot between price and indicator. It has been modified to add the RSX indicator (derivate from RSI) to get the divergences signals. Period lookback is modifiable in the code (p variable).
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 |
// DIV RSX DID 03.05.2014 // parameter p = 20 // RSX prix = close + 0.5 * STD (high [10]) Hausse = MAX ( 0, prix - prix [ 1 ] ) Baisse = MAX ( 0, prix [ 1 ] - prix ) mh=wilderaverage[p](hausse) mb=wilderaverage[p](baisse) rs=mh/mb MonRSX = endpointaverage ( 100 - ( 100 / (1 + RS ))) // Variable = p = 11 periode RSI/RSX ////////////////////////////////////////////////////////////////// // DIVERGENCES STOCHASTIQUES BAISSIERES et HAUSSIERES d’après le code de HKlisse x = MonRSX[11] y=average[2](x) // DIVERGENCES BAISSIERES RSX if x>y then hi=max(hi,x) hico=max(hico,max(high,high[1])) endif if x crosses under y then sto2b=sto1b sto1b=hi hi=0 p3b=p1b p2b=max(p1b,hico1) p1b=max(highest[3](high),hico) if p2b=p1b then p2b=max(p3b,p4b) endif hico=0 hico1=0 endif if x<y then p4b=hico1 hico1=max(hico1,high) endif if p1b>p2b and sto1b<sto2b and x crosses under y and x<x[1] then signB= -2 else signB= 0 endif // DIVERGENCES HAUSSIERES RSX if x<y then lo=min(lo,x) lowco=min(lowco,min(low,low[1])) endif if x CROSSES OVER y then sto2h=sto1h sto1h=lo lo=100 p3h=p1h p2h=min(p1h,lowco1) p1h=min(lowest[3](low),lowco) if p2h=p1h then p2h=min(p3h,p4h) endif lowco=100000 lowco1=100000 endif if x>y then p4h=lowco1 lowco1=min(lowco1,low) endif if p1h<p2h and sto1h > sto2h and x crosses over y and x>x[1] then signH= 2 else signH= 0 endif //////////////////////////////////////////////// return signH as " div RSX H ", signB as " div RSX B " , 0 as " zero " |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Interesting code.I see that you like HKLisse and Sohocool !