Documentation/AlgoCode/Function reference

flat

Simulated strategy state (not a broker position).

Reference/Language/Language

flat    long    short    in position

These words describe Dovee's analytical position after buy/sell/exit rules — Charting.in does not connect them to a live broker account. Also available: entry price, entry time, bars since entry, position size, position average price, profit, profit percent, trade count.

Return value

true/false or series

Note

  • State updates on closed bars as rules fire.
  • Webhook payloads send { symbol, action, qty, sl?, tp? } from the alert JSON template — not account state. A custom template can add signalId with {{signalId}}; it is deterministic for the strategy, symbol, timeframe, bar, action, and event. Persisted delivery sends an Idempotency-Key header and retries keyed transient failures with bounded backoff; receivers must deduplicate because delivery is at-least-once. Unkeyed generic forwards receive one attempt. Existing payload templates are unchanged.

Example

when fast crosses above slow and flat
  buy
when long and close crosses below slow
  exit
when long and bars since entry > 10
  exit

See also