INVITE-ONLY SCRIPT

WOLONG Dev v2.6 - GPT+Pineconnector'

211
WOLONG Pine Script - Summary and Maintenance Guide
==================================================

1. SYSTEM OVERVIEW
-------------------
This Pine Script is designed for automated alert-based trading using PineConnector,
integrating key trading logic with alert() calls for entry/exit on TradingView.

It includes:
- Dynamic trailing stop logic
- Label plotting for entry/exit points
- Real-time alerting with webhook support
- Embedded testing logic (popup/email alerts)

2. KEY COMPONENTS
-------------------
- `entryPrice`, `exitPrice`, `inTrade`: Track trade states
- `dynamic_sl`: Updated SL according to TP1 → TP2 → TP3
- `alert()`: Sends webhook to PineConnector (MT4/MT5 integration)
- `label.new`: Marks entries/exits for visual review
- `plotshape()`: Shows BUY/SELL signals for strategy visualization

3. ALERT CONDITIONS
---------------------
Alerts trigger when:
- Entry + SL + TP1/2/3 are plotted
- Signal is confirmed on candle close (barstate.isconfirmed)
- No duplicate alert is sent (controlled with `alertSent`)

4. TRAILING SL RULES
---------------------
- SL starts at original stop_y
- Moves to Entry when TP1 is hit
- Moves to TP1 when TP2 is hit
- Moves to TP2 when TP3 is hit
- Always waits for candle close before shifting (anti-repaint)

5. COMMON ERRORS (and Fixes)
-----------------------------
- `Undeclared identifier 'label'`: Use label.style_label_up/down (v5 syntax)
- `Already defined`: Ensure var declarations occur only once
- Replay mode: Alerts won't trigger webhook (for test use only)

6. MAINTENANCE TIPS
---------------------
- Always test in TradingView Replay before using live
- Monitor alert logs + MT4/MT5 Experts tab to verify webhook success
- Avoid declaring same variable multiple times
- For new strategy logic, always wrap execution with `barstate.isconfirmed`

7. RECOMMENDATIONS
---------------------
- Use 1–5 minute timeframes for scalping logic
- Set alert: "Any alert() function call" + webhook URL
- Add a version number and change lo

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.