Alerts Spec — EnvoTrades Smart Signals V2.7 (TradingView → Webhook)
Scope: build/test spec only. Not trading advice.
1) When an alert fires
In the shipped V2.7 scripts, alerts fire on allowed signals only:
buy_signal/sell_signalare gated by:Confirm On Close(default ON) ⇒barstate.isconfirmed- Session filter (if enabled/effective)
- Range filter (required in Safe mode)
- Daily bias (optional)
- HTF confirmation (optional)
- RSI filter (effective)
- BOS/structure gate (effective)
- Allow Buy/Sell toggles
Alert call:
alert(payload, alert.freq_once_per_bar_close)
Implications:
- Payload timestamp uses
time_close(close time of the bar that generated the signal). - No intrabar alerts when
Confirm On Close = ON.
2) Payload format
Content type
- TradingView sends the message as a raw string.
- The V2.7 message is JSON (single object).
JSON schema (current)
{
"version": "2.7",
"script": "EnvoTrades Smart Signals",
"symbol": "<syminfo.ticker + optional suffix>",
"tickerid": "<syminfo.tickerid>",
"timeframe": "<timeframe.period>",
"timestamp": 1700000000000,
"direction": "BUY|SELL",
"entry": 123.45,
"sl": 120.00,
"tp1": 130.00,
"tp2": 140.00,
"score": 85,
"grade": "A",
"pass": "ALLOW|SESSION|RANGE_OFF|BIAS_OFF|HTF_OFF|RSI|BOS_OFF",
"block": "SESSION|RANGE",
"risk_percent": 1.0
}
Field notes:
entry/sl/tp1/tp2/scorecan benullwhen unavailable.passandblockare pipe-delimited reason codes for easy splitting downstream.*_OFFcodes indicate a category was not required/enabled but still awarded for scoring.
Reason codes (enumeration)
PASS/BLOCK lists may include:
ALLOWSESSION,SESSION_OFFRANGE,RANGE_OFFBIAS,BIAS_OFFHTF,HTF_OFFRSI,RSI_OFFBOS,BOS_OFF
3) Receiver (webhook) requirements
Minimum receiver behavior:
- Parse JSON.
- Validate required keys:
version,symbol,timestamp,direction. - Validate numeric fields are numbers or null.
- Enforce idempotency:
- Suggested key:
tickerid + timeframe + timestamp + direction.
- Suggested key:
- Log/store full payload for replay.
4) Automation mapping guidance (non-broker-specific)
Suggested mapping for an MT5 EA / bridge:
symbol→ broker symbol (may require mapping table)direction→ trade directionentry→ informational (signal-close entry)sl,tp1,tp2→ order levelsrisk_percent→ position sizing input (EA-defined)score,grade,pass,block→ journaling/telemetry only (do not assume profitability)
5) BLOCKED / NEED
NEED (to finalize receiver validation rules):
- Exact broker symbol mapping rules (suffix/prefix, CFD naming).
- Price precision rules (digits/point) for each instrument.
- Whether you want to allow
tp2=null.