This indicator combines 5 exponential moving average of different periods, calculate their momentum and synthesize the result into 1 single curve.
Dynamic levels made of the discontinued signal lines function are added to create pseudo overbought and oversold levels.
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 |
//PRC_DSL synthetic EMA momentum | indicator //11.10.2018 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge //converted from MT5 version // --- settings inpPeriod1 = 5 // Period 1 inpPeriod2 = 20 // Period 2 inpPeriod3 = 50 // Period 3 inpPeriod4 = 100 // Period 4 inpPeriod5 = 200 // Period 5 inpSignal = 9 // Signal period // --- end of settings Price = customclose avg = average[inpPeriod1,1](price) avg1 = average[inpPeriod2,1](price)[1] mom1 = 100*(avg-avg1)/avg1 avg2 = average[inpPeriod3,1](price)[2] mom2 = 100*(avg-avg2)/avg2 avg3 = average[inpPeriod4,1](price)[3] mom3 = 100*(avg-avg3)/avg3 avg4 = average[inpPeriod5,1](price)[4] mom4 = 100*(avg-avg4)/avg4 val = (mom4 +mom3*inpPeriod5/inpPeriod4+mom2*inpPeriod5/inpPeriod3+mom1*inpPeriod5/inpPeriod2)/4.0 alpha = 2.0/(1.0+inpSignal) if val>0 then levelu = levelu[1]+alpha*(val-levelu[1]) endif if val<0 then leveld = leveld[1]+alpha*(val-leveld[1]) endif //OB and OS colors r=168 g=168 b=168 if val>levelu then r=30 g=144 b=255 elsif val<leveld then r=255 g=20 b=147 endif drawbarchart(levelu,leveld,levelu,leveld) coloured(168,168,168,50) return val coloured(r,g,b) style(line,2), levelu style(dottedline) as "level up", leveld style(dottedline) as "level down" |
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
Hola, seria posible añadir una línea horizontal en el nivel 0? Me gustaría hacer un screener de valores que crucen la línea 0 hacia arriba. Gracias.
cambiar la última línea por ésta:
return val coloured(r,g,b) style(line,2), levelu style(dottedline) as “level up”, leveld style(dottedline) as “level down”,0