OPEN-SOURCE SCRIPT
Cập nhật

Nimu Market on Paper

311

Multi-Timeframe Analysis Tool is a powerful visual aid for identifying trends, reversals, and key price movements across multiple timeframes — particularly useful for intraday traders and those using technical analysis strategies


Timeframes & Data Collection:
  • The script tracks multiple timeframes (1m, 5m, 15m, 30m, 1H, 2H, 4H, 8H), storing their open, high, low, and close prices in arrays (trdh, trdc, trdo, trdl).
  • It uses request.security() to fetch these values for the current symbol and specified timeframes
.

User Inputs:

  • Base Timeframe: Chooses the primary timeframe for analysis.
  • Bar Count: Determines how many bars to display.
  • Border Thickness: Sets the visual thickness of box borders.
  • Colors: Configurable for bullish, bearish, background, and borders


Visual Elements:

  • Dynamic Boxes: Drawn using box.new(), these illustrate the range between high and low prices with the percentage change displayed inside.
  • Candlestick Plots: Rendered for each tracked timeframe using plotcandle(), colored according to bullish or bearish price action and styled based on timeframe scaling.
  • Regression Line: A linear regression line plotted over the selected timeframe’s close prices to capture trend direction.


Logic & Presentation:

  • Determines the right timeframe index based on user input (base).
  • Calculates percentage change from high to low and visualizes it with shaded boxes.
  • Automatically deletes older boxes to maintain clarity.
  • Customizes candle appearance based on timeframe granularity.
Phát hành các Ghi chú
Is a multi-timeframe technical analysis and risk management tool

**1. Parameters and Inputs:**
- **Timeframes:** Supports different base timeframes (1, 5, 15, 30, 60 min).
- **Indicators:** Uses two Exponential Moving Averages (EMAs) — short and long — and a 7-period RSI (Relative Strength Index).
- **Volatility Filter:** Uses the ATR (Average True Range) to avoid trades in low-volatility markets.
- **Risk Management:** Calculates position size based on risk percentage and ATR-based stop-loss/take-profit.

**2. Visual Settings:**
- Customizable colors for bullish, bearish, background, borders, and transparency levels.
- Uses visual boxes and colored candles to highlight price action and RSI-based buy/sell signals.

**3. Indicators and Conditions:**
- **EMA Crossover:** Determines trend direction — bullish when short EMA > long EMA, bearish otherwise.
- **RSI:** Identifies overbought and oversold conditions.
- **ATR:** Used for dynamic stop-loss and take-profit calculation.

**4. Multi-Timeframe Analysis:**
- Pulls OHLC data from different timeframes to compare price action.
- Uses functions like `getLow()`, `getHigh()`, `getOpen()`, and `getClose()`.

**5. Signal Display:**
- Visuals include EMA plots, time-based candles, and RSI-based buy/sell text.
- Highlights entry signals when RSI aligns with trend direction (e.g., RSI oversold + bullish trend = "BUY").

**6. Risk Management:**
- Dynamically calculates stop-loss and take-profit based on ATR.
- Adjusts position size based on risk percentage and stop-loss.

**7. Visual Representation:**
- Plots different timeframe candles with distinct colors and transparency for easy visual analysis.
- Uses boxes to highlight significant price movements and signal areas.

it blends technical analysis with multi-timeframe data and dynamic risk management, making it a flexible tool for paper trading and back testing
Phát hành các Ghi chú
Multi-Timeframe Analysis:

Clearly displays candles for multiple timeframes (1m, 5m, 15m, 30m, and 1h).
Dynamically colors candles to distinguish bullish/bearish and different timeframes.
Indicators Used:

EMA (Exponential Moving Average): short (9), long (21) for trend direction.
RSI (7-period) for identifying overbought/oversold conditions.
ATR (14-period) to measure volatility.
Dynamic Risk Management:
Calculates position sizing based on initial capital, risk percentage, and volatility-based stop-loss and take-profit (though these aren't yet directly tied into entry or exit commands in the script).

Label Signals:
Visually displays labels for key signals:

Breakouts (up/down).
Higher lows, lower lows, higher highs, lower highs.
Expanded ranges.
Future Price Trend Projection:
Uses Linear Regression to forecast potential price moves.
Phát hành các Ghi chú
Here are some key areas where calculations could be optimized:

Optimized Areas
Avoiding redundant function calls

ta.ema(close, shortEMA) and ta.ema(close, longEMA) are computed once and stored in shortEMAVal and longEMAVal, preventing multiple redundant recalculations.
Similarly, ta.rsi(close, rsiLength) and ta.atr(14) are stored in rsiVal and atrValue, ensuring they are reused efficiently.
Reusing prior values instead of recalculating

Instead of repeatedly calling ta.lowest(prevLow, 2) and ta.highest(prevHigh,2), storing these in variables like lowestPrevLow and highestPrevHigh would reduce redundant calls.
Checking conditions before performing calculations

The script correctly avoids unnecessary calculations in the label creation section by wrapping it inside if barstate.isconfirmed or barstate.isrealtime, ensuring computations are only performed on confirmed bars.
Reducing unnecessary request.security() calls

The getLow, getHigh, getOpen, and getClose functions request data from different timeframes using request.security(). These are useful, but calling them repeatedly inside conditions can slow performance. Instead, their results could be cached at the start of the script for reuse.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.