OPEN-SOURCE SCRIPT

Bottom Fishing

The Bottom Fishing Indicator is a technical analysis tool that integrates RSI (Relative Strength Index), CCI (Commodity Channel Index), and MFI (Money Flow Index) to detect potential market bottoming opportunities. It calculates the oversold accumulation value of these indicators and marks buy signals when specific thresholds are met.

This indicator supports multi-timeframe (MTF) analysis, allowing users to track oversold conditions on higher timeframes such as daily or weekly charts.

Calculation Logic

(1) RSI Calculation
The Relative Strength Index (RSI) measures the strength of price movement by comparing recent gains and losses over a defined period. If the RSI value drops below 30, it indicates that the asset is oversold, meaning that selling pressure has been dominant and a potential rebound might occur. When this condition is met, the difference between 30 and the RSI value is added to the accumulation sum.

(2) CCI Calculation
The Commodity Channel Index (CCI) compares the current price level to its moving average over a specific period. If the CCI value falls below -100, it suggests that the asset is experiencing significant downward pressure. The difference between -100 and the actual CCI value is recorded and accumulated over time to gauge the intensity of the oversold condition.

(3) MFI Calculation
The Money Flow Index (MFI) evaluates price movements in relation to volume to determine buying and selling pressure. When the MFI drops below 20, it signals that the market is experiencing excessive selling pressure. The difference between 20 and the MFI value is added to the accumulation sum to track the degree of the oversold condition.

(4) Oversold Accumulation Calculation
Each time the selected indicator (RSI, CCI, or MFI) enters an oversold state, the corresponding difference is added to an ongoing sum. If the indicator exits the oversold zone, the accumulation sum resets to zero. Once the accumulation sum reaches or exceeds the defined threshold, the indicator marks a buy signal on the chart, indicating a potential bottom.

Multi-Timeframe (MTF) Calculation

Uses request.security() to fetch higher timeframe data (e.g., Daily, Weekly).
RSI, CCI, and MFI are recalculated on the selected timeframe.
The same oversold accumulation logic is applied to detect long-term buy opportunities.
The MTF accumulation line is plotted to visualize oversold conditions on higher timeframes.

Chart Display

(1) Indicator Lines
✅ Accumulation Value Line

Value Sum Line (Aqua color): Represents the oversold accumulation sum in the current timeframe.
MTF Value Sum Line (Orange color): Represents the oversold accumulation sum in the selected multi-timeframe.
✅ Divergence Signal Markers

If accumulation exceeds the threshold, a "Goal" marker is plotted above the candle, signaling a potential bottom.

Use Cases

🔹 Short-term Trading: Ideal for scalping and intraday trading, detecting potential reversals when RSI, CCI, or MFI enters the oversold zone.
🔹 Trend Reversal Trading: Works best with multi-timeframe confirmation, where a higher timeframe also signals an oversold condition.
🔹 Combining with Other Indicators: Can be used alongside moving averages, MACD, Bollinger Bands for higher accuracy.

כתב ויתור