Alarme Medo e Ganancia - Bruno Moscan"Alarme Medo e Ganância - Bruno Moscan", is designed to identify extreme market sentiment (Fear and Greed) by using the Relative Strength Index (RSI) as a proxy for price exhaustion.
Here is the breakdown of the code:
1. Settings and Inputs
rsiLen: Sets the look-back period for the RSI (default is 14).
overbought (Greed Level): Defines the threshold (75) where the market is considered overextended to the upside.
oversold (Fear Level): Defines the threshold (25) where the market is considered overextended to the downside.
2. Core Logic
rsiValue: Calculates the standard RSI based on closing prices.
medoExtremo (Extreme Fear): Triggers when the RSI falls below or hits the 25 level. This represents a "Buy" opportunity based on the contrarian philosophy of "buying when there is blood in the streets."
gananciaExtrema (Extreme Greed): Triggers when the RSI rises above or hits the 75 level. This represents a "Sell" opportunity, suggesting the market is overheated.
3. Visuals (Plotting)
The script uses plotshape to place labels directly on the chart:
Green "BUY MEDO" labels appear below the price bars during extreme fear.
Red "SELL GANÂNCIA" labels appear above the price bars during extreme greed.
4. Alerts
The alertcondition functions allow you to set up push notifications, emails, or pop-ups in TradingView.
The messages follow the classic trading proverbs: "Buy to the sound of cannons" (Fear) and "Sell to the sound of violins" (Greed).
אינדיקטור Pine Script®






















