The Top and Bottom indicator is using the breakout of the most recent tops and bottoms of the last x periods to start counting the number of bars elapsed since the events.
- When the bars count of the last bearish breakout is higher than the bars count of the last bullish breakout, a buy signal is generated.
- When the bars count of the last bullish breakout is higher than the bars count of the last bearish breakout, a sell signal is generated.
Code converted from another trading platform programming language, as per a request in the indicators forum.
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 |
//PRC_Top Bottom | indicator //08.10.2020 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge // --- settings per = 14 //Bottom Period per2 = 14 //Top Period // --- end of settings loc = low < lowest[per](low[1]) and low <= lowest[per](low[per]) if loc then locstart=barindex endif bottom = barindex-locstart loc2 = high > highest[per2](high[1]) and high >= highest[per2](high[per2]) if loc2 then loc2start=barindex endif top = barindex-loc2start iBuy = bottom crosses over top iSell = bottom crosses under top if iBuy then drawtext("Buy",barindex,bottom-4,dialog,bold,20) coloured(0,128,0) endif if iSell then drawtext("Sell",barindex,top-4, dialog,bold,20) coloured(255,0,0) endif if top<bottom then backgroundcolor(0,255,0,50) else backgroundcolor(255,0,0,50) endif return bottom coloured(0,0,255) style(line,2) as "bottom", top coloured(255,0,0) style(line,2) as "top" |
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
Bonjour Nicolas, est-il possible de vous contacter en message privé pour une demande d’un développement spécifique sur PRT ?
https://www.prorealcode.com/trading-programming-services/ 😉
Bonjour Je sèche quelqu’un peut il me détailler précisement cette ligne loc = low < lowest[per](low[1]) and low <= lowest[per](low[per])
Hi Nicolas. Is it possible to screen for those giving iBuy signal yesterday? Even better – those that were iSell 2 days ago? TIA
I don’t know how what signals you are talking about, where and when? To get signals from the indicator just test if the Top value crosses over or under the Bottom one.
I would like to implement screener for the first bar that signals now an iSell to iBuy state change, from previous bar[1] to latest bar, signaling a buy opportunity (and vice versa)
Bonjour Nicolas,
est ce que ton indicateur est utilisable sur toutes les UT ? Et sur la dernière version de PRT ?
Meri pour ton retour
Oui, il peut être appliqué sur toutes les unités de temps et fonctionne sur prorealtime v11.
salut
merci pour ton indicateur. Pour bien comprendre , si suis acheteur à quelle comment je dois sortir du Trade ( graphiquent ??) et idem si je suis vendeur a quelle moment je ferme ma position.
Merci beaucoup
A discrétion, bon courage dans ton apprentissage du trading.
Bonjour Nicolas,
j’ai créé un screener avec l’aide à la prog en TF weekly mais je voudrais adapter celui-ci en monthly.
Une solution ?
ignored, indicator1 = CALL “PRC_Top Bottom Indicator”[3, 4]
c1 = (indicator1[1] > 0)
ignored, indicator2 = CALL “PRC_Top Bottom Indicator”[3, 4]
c2 = (indicator2 = 0)
SCREENER[c1 AND c2] ((close/DClose(1)-1)*100 AS “% Veille”)
C’est exactement le même signal que donne le croisement et le décroisement de deux EMA (7 et 20), comme par hasard ?
bonjour,
j’ai un bug sur le programme recopié prorealtime me dit qu’il y a un problème à la ligne 14, caractère 6..
j’ai tout bien recopié , je ne comprends pas. si quelqu’un peut m’aider? merci.