PROTECTED SOURCE SCRIPT
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).
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).
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.