219 lines
10 KiB
Markdown
219 lines
10 KiB
Markdown
# Bullmania Money Line
|
||
|
||
## Bullmania Money Line v2 (strategy)
|
||
|
||
`Bullmania_Money_Line_v2.pine` is a TradingView Strategy version of the original indicator with built-in backtesting.
|
||
|
||
- Convert the original Money Line into a strategy with entries on trend flips.
|
||
- Long/Short toggles and date range filter for backtests.
|
||
- Commission/slippage controls via strategy() header.
|
||
- Two sizing modes: Percent of equity (qty computed from equity and price) or fixed quantity.
|
||
- Optional Money Line-based stop and ATR-multiple take profit.
|
||
|
||
How to use:
|
||
1. Open the file in TradingView Pine Editor and click Add to chart.
|
||
2. In the Inputs tab, set your ATR Period and Multiplier just like v1.
|
||
3. Set backtest range (Start/End date) and toggles (Enable Longs/Shorts).
|
||
4. Choose sizing mode: Percent of equity (qty_percent) or Fixed contracts (qty).
|
||
5. Optionally enable Money Line as Stop and ATR-based Take Profit.
|
||
|
||
Notes:
|
||
- Entries occur on trend flips (when the Money Line switches from down to up for longs and vice versa for shorts).
|
||
- Exits are managed using `strategy.exit` with the Money Line as trailing stop when enabled. TP is optional.
|
||
- Default initial capital is 10,000 and commission is 0.1% with 1 tick slippage; adjust as needed.
|
||
|
||
ATR-based trend line and flip signals for TradingView (Pine v6). The indicator draws a “Money Line” that trails price and flips direction when price crosses it. Green dots mark bullish flips (trend turns up), red dots mark bearish flips (trend turns down).
|
||
|
||
This repo contains multiple versions; v4 is the stable baseline and `v4+` adds optional filters, alerts, and per-timeframe profiles while preserving v4 defaults (off by default).
|
||
|
||
## Files
|
||
- `Bullmania_Money_Line_v1.pine` — Baseline behavior (original). Two inputs: ATR Period, Multiplier.
|
||
- `Bullmania_Money_Line_v2.pine` — Historical variant.
|
||
- `Bullmania_Money_Line_v3.pine` — Historical variant.
|
||
- `Bullmania_Money_Line_v4.pine` — v1 + optional noise reduction (confirmation bars, ATR buffer). Tagged `v4.0.0`.
|
||
- `Bullmania_Money_Line_v4_plus.pine` — v4-compatible but with optional filters and quality-of-life features (Pine v6).
|
||
- `Bullmania_Money_Line_v5.pine` — v1 + optional MACD confirmation gate and optional timeframe profiles (Single mode or auto profile by chart TF).
|
||
- `Bullmania_Money_Line_v6.pine` — v5 + optional RSI confirmation gate (SuperTrend + RSI combo).
|
||
|
||
## How it works (all versions)
|
||
- Money Line is derived from a mid-price `(high + low) / 2` and `ATR(atrPeriod)` scaled by `multiplier`.
|
||
- The line trails in the direction of the current trend and flips when price closes across it.
|
||
- Plots:
|
||
- Green line when trend is up, red line when trend is down.
|
||
- Green dot below bar when trend flips up; red dot above bar when trend flips down.
|
||
- Optional green/red fill between price and the line for quick context.
|
||
|
||
## Inputs
|
||
Common inputs (v1–v4):
|
||
- ATR Period — ATR length in bars.
|
||
- Multiplier — distance from source to the line in ATRs.
|
||
|
||
Additional inputs (v4 only):
|
||
- Flip confirmation bars — require N consecutive closes beyond the Money Line to flip (default 1 = same as v1).
|
||
- Flip buffer (×ATR) — require the cross to exceed the line by X × ATR to flip (default 0.0 = same as v1).
|
||
|
||
Defaults in v4 match v1, so you can upgrade without changing results and then enable the new knobs as needed.
|
||
|
||
### v4+ extras (all optional; defaults preserve v4)
|
||
- Calculation source: Chart or Heikin Ashi
|
||
- Flip confirmation bars and Flip buffer (×ATR)
|
||
- ADX/DMI gate (length, min ADX)
|
||
- Higher timeframe confirmation (request.security with lookahead_off)
|
||
- Session/time gating and cooldown bars after flip
|
||
- EMA trend filter (e.g., 100–200)
|
||
- Anti-chop filters:
|
||
- Choppiness Index (length and max allowed)
|
||
- Retest-after-flip (window and tolerance in ATR)
|
||
- Minimum candle body fraction
|
||
- Visualization:
|
||
- Gate flip circles with filters (optional)
|
||
- Gated markers (triangles) for approved flips
|
||
- Alerts/labels on bar close only
|
||
- Price-to-line shading
|
||
|
||
### Per-timeframe profiles (v4+)
|
||
Enable "Use per-timeframe profiles" to automatically switch parameters by chart timeframe:
|
||
- Intraday (<60m)
|
||
- 1–4h
|
||
- 1D+
|
||
|
||
Each profile has its own confirm bars, ATR buffer, smoothing, ADX length/min, CHOP length/max, retest window/tolerance, min body fraction, and trend EMA. When profiles are OFF, the single global set of inputs is used.
|
||
|
||
Note
|
||
- When profiles are ON, ALL relevant settings are per-profile: ATR Period, Multiplier, and all filter toggles/parameters (ADX, higher TF + its timeframe, session, cooldown, alerts on close, EMA trend filter enable and length, CHOP, Retest, Body filter). You always see exactly which profile is active by your chart timeframe.
|
||
|
||
#### How to use profiles
|
||
1) In the indicator Inputs, enable "Use per-timeframe profiles".
|
||
2) Change the chart timeframe; the active profile is selected automatically:
|
||
- Intraday: under 60 minutes (e.g., 1, 3, 5, 15, 30, 45).
|
||
- 1–4h: from 60 to 240 minutes inclusive (1h, 2h, 3h, 4h).
|
||
- 1D+: daily and above (1D, 2D, 1W, 1M).
|
||
3) Tune the controls in that profile group; they don’t affect the other profiles.
|
||
4) Optional: Save as default or save an Indicator Template in TradingView to reuse your setup.
|
||
5) Turn profiles OFF to revert to one global set of inputs across all timeframes.
|
||
|
||
Tips
|
||
- With profiles ON, toggles and thresholds are per-profile (e.g., ADX on/off and its length/min are tied to the active profile). With profiles OFF, a single global set applies to all timeframes.
|
||
- For consistent behavior across TFs, start by scaling ATR Period with timeframe and then adjust Confirm bars and Buffer (×ATR) per profile.
|
||
- Triangles, labels, and alerts follow the same gating and will only appear when all enabled filters pass.
|
||
|
||
## Quick presets
|
||
Use these as starting points and adjust per symbol/volatility. Values are for Heikin Ashi unless noted.
|
||
|
||
- 30m Conservative (quiet):
|
||
- ATR Period: 8
|
||
- Multiplier: 3.5
|
||
- Flip confirmation bars: 2
|
||
- Flip buffer (×ATR): 0.30
|
||
|
||
- 30m Balanced:
|
||
- ATR Period: 6
|
||
- Multiplier: 3.2
|
||
- Flip confirmation bars: 2
|
||
- Flip buffer (×ATR): 0.25
|
||
|
||
#### Per-profile presets (v4+)
|
||
Balanced starting points that map directly to the three profiles. Tweak per market.
|
||
|
||
- Intraday (<60m):
|
||
- ATR Period: 10
|
||
- Multiplier: 3.0
|
||
- Confirm bars: 2
|
||
- Flip buffer (×ATR): 0.15
|
||
- Smoothing EMA: 1
|
||
- ADX: on (len 18, min 20)
|
||
- Choppiness: on (len 14, max 55)
|
||
- Retest: optional (window 3, tol 0.20)
|
||
- Body filter: optional (min 0.35)
|
||
- Trend EMA: optional (len 100)
|
||
|
||
- 1–4h:
|
||
- ATR Period: 10
|
||
- Multiplier: 3.0
|
||
- Confirm bars: 2
|
||
- Flip buffer (×ATR): 0.10
|
||
- Smoothing EMA: 1
|
||
- ADX: on (len 20, min 19)
|
||
- Choppiness: on (len 14, max 57)
|
||
- Retest: optional (window 3, tol 0.20)
|
||
- Body filter: optional (min 0.30)
|
||
- Trend EMA: optional (len 200)
|
||
|
||
- 1D+:
|
||
- ATR Period: 10
|
||
- Multiplier: 3.0
|
||
- Confirm bars: 1
|
||
- Flip buffer (×ATR): 0.10
|
||
- Smoothing EMA: 0
|
||
- ADX: on (len 14, min 18)
|
||
- Choppiness: on (len 14, max 60)
|
||
- Retest: optional (window 2, tol 0.20)
|
||
- Body filter: optional (min 0.30)
|
||
- Trend EMA: optional (len 200)
|
||
|
||
### Tuning cheat sheet
|
||
- Too noisy (too many reversals):
|
||
1) Increase confirmation bars (e.g., 2 → 3)
|
||
2) Raise buffer by +0.05 to +0.10
|
||
3) Widen Multiplier by +0.3 to +0.5 if needed
|
||
- Too late / too few signals:
|
||
1) Lower buffer by -0.05
|
||
2) Reduce confirmation bars (3 → 2)
|
||
3) Tighten Multiplier by -0.3 to -0.5
|
||
|
||
### Timeframe scaling tip
|
||
If you want a similar time horizon across timeframes, pick a target window `T` in minutes (e.g., ~150 minutes). Then
|
||
|
||
```
|
||
ATR Period ≈ round(T / timeframe_minutes)
|
||
```
|
||
|
||
Keep Multiplier roughly stable and fine-tune by small increments; HA candles allow slightly tighter settings than regular candles.
|
||
|
||
## How to use in TradingView
|
||
1) Open TradingView → Pine Editor.
|
||
2) New blank script.
|
||
3) Copy the contents of the desired `.pine` file and paste.
|
||
4) Save and “Add to chart”.
|
||
5) Open Inputs to adjust parameters.
|
||
|
||
## Changelog
|
||
- v6 — v5 + optional RSI confirmation gate (buy requires RSI < overbought; sell requires RSI > oversold). Combines with MACD if enabled.
|
||
- v5 — v1 + optional MACD gate (buy dot requires MACD line > signal; sell dot requires MACD line < signal). Adds optional timeframe profiles: choose "Single" or "Profiles by timeframe". Profiles buckets: Minutes, Hours, Daily, Weekly/Monthly with independent ATR Period and Multiplier. Defaults keep v1 behavior.
|
||
- v4+ — Pine v6 variant with optional ADX/MTF/session/cooldown, calc source toggle, EMA trend filter, anti-chop (CHOP, retest, min body), gated markers, and per-timeframe profiles.
|
||
- v4.0.0 — Adds Flip confirmation bars and Flip buffer (×ATR). Defaults keep v1 behavior. Tag: `v4.0.0`.
|
||
- v1 — Initial baseline.
|
||
|
||
## v5 timeframe profiles (quick guide)
|
||
In `Bullmania_Money_Line_v5.pine` you can switch "Parameter Mode" between:
|
||
- Single — one global ATR Period and Multiplier (same as v1 behavior).
|
||
- Profiles by timeframe — separate inputs per bucket with auto-selection from chart TF or via "Profile Override":
|
||
- Minutes (<= 59m)
|
||
- Hours (>= 1h and < 1d)
|
||
- Daily (>= 1d and < 1w)
|
||
- Weekly/Monthly (>= 1w)
|
||
|
||
Inputs added in v5 when profiles are enabled:
|
||
- ATR Period (Minutes/Hours/Daily/Weekly-Monthly)
|
||
- Multiplier (Minutes/Hours/Daily/Weekly-Monthly)
|
||
- Profile Override: Auto, or force a specific bucket
|
||
- Optional: show active profile label on the chart
|
||
|
||
Note: Only ATR Period and Multiplier are profiled in v5; filters remain limited to the optional MACD confirmation gate.
|
||
|
||
### Default values (v5 profiles)
|
||
Out of the box defaults meant to be robust across popular markets; adjust per symbol/volatility:
|
||
- Minutes: ATR 12, Multiplier 3.3
|
||
- Hours: ATR 10, Multiplier 3.0
|
||
- Daily: ATR 10, Multiplier 2.8
|
||
- Weekly/Monthly: ATR 7, Multiplier 2.5
|
||
|
||
## Notes
|
||
- v4 is designed to reduce whips without changing the core Money Line logic.
|
||
- Optional future add-ons (can be toggled if requested):
|
||
- RSI centerline or ADX filter to gate flips in weak trends.
|
||
- Timeframe-adaptive ATR period (auto scales with chart TF).
|
||
- Pivot-anchored dots (plot flip dot at prior swing high/low).
|
||
|
||
(If you want a LICENSE file added, tell me which license you prefer.)
|