AI Architecture User Guide

Introduction

This guide provides a comprehensive, in-depth reference for EAsiTrader’s AI integration. It is intended as a companion to the AI Settings section of the main EAsiTrader User Guide, expanding on the architecture, decision-making process, and practical usage patterns that will help you get the most out of AI-assisted trading.

EAsiTrader’s AI system connects your Expert Advisor to external large language models (such as OpenAI’s GPT series, Anthropic’s Claude, or Google’s Gemini) via the NTL API. The AI receives structured market data — OHLC prices, indicator readings, grounded market structure events, and optionally your open positions — and returns a structured JSON assessment. The EA then uses that assessment deterministically: filtering entries, modulating position sizes, or executing autonomous trade instructions, depending on your chosen mode.

The key design principle is deterministic safety: every AI output passes through local validation before it can affect trading. The AI advises; the EA decides.


How the System Works End-to-End

Understanding the full request-response lifecycle helps you configure the system effectively and troubleshoot issues when they arise.

1. Request Trigger

The EA decides when to call the AI based on your configured mode:

  • Periodic modes (Monitor Only, Filter Signals, Autonomous) check on each new bar whether a refresh is needed. A refresh is triggered when the previous assessment has expired (its valid_minutes window has elapsed), the configured refresh interval has passed, and any AI trigger script permits it.
  • Gated Trading mode calls the AI on-demand when your entry scripts generate a trade signal. The signal parameters (direction, entry price, stop loss, take profit, volume, risk/reward ratio) are cached and sent to the AI for evaluation. When management permissions are enabled, the AI also receives position and order data so it can issue management instructions alongside the gate evaluation.
  • Open positions in any mode with position management capability (Autonomous, or Gated Trading with management permissions) bypass the validity window check — if you have active trades and the refresh interval has elapsed, a new request is sent regardless of whether the previous assessment is still technically valid. This ensures the AI can react to changing conditions around your positions.

2. Prompt Construction

The AiPromptBuilder assembles two prompt components:

System Prompt — Defines the AI’s role and behavioural rules. This varies by mode: a “technical market analyst” for advisory modes, a “trading signal gatekeeper” for Gated Trading mode, and an analyst with “full autonomy to manage trades” for Autonomous mode. Your Strategy Instructions are injected here under a dedicated “Trading Strategy” section. The Trading Style (Conservative, Moderate, Aggressive) is embedded as explicit behavioural guidance.

In Gated Trading mode with management permissions, the system prompt additionally includes a “Position Management” section instructing the AI that it may close, modify SL, or modify TP for existing positions, and that when no pending signal is present it should focus on position management only.

User Prompt — Contains the actual market data and context. This includes the market symbol and timeframe, current server time, OHLC price data for all configured timeframes (up to Max Bars depth), indicator data as grounded events, raw buffer values, or both (controlled by AI Export Mode), the prior assessment summary (providing continuity between requests), decision history with accuracy statistics from recent assessments (see Decision History section below), and the required JSON response schema. When the AI has position management capability (Autonomous mode, or Gated Trading with management permissions), the prompt additionally includes open position details (ticket, direction, lots, entry price, current SL/TP, profit in points and R-multiple, bars open), pending order details, recently closed trades (if enabled), and the permissions block defining what actions the AI may take. In Gated Trading mode, the prompt includes the pending entry signal with its direction, entry price, stop loss, take profit, stop size in points, reward in points, risk/reward ratio, volume, signal time, and order type (market, stop, or limit).

3. API Request

The assembled prompt is sent to your configured AI provider(s) via the NTL API. The NTL API acts as a unified interface supporting multiple AI providers simultaneously.

Single-Provider Mode — When you configure a single provider in your Providers Config String, requests are sent directly to that provider. This is the simplest configuration and suitable for most use cases.

Multi-Provider Mode — The NTL API supports dispatching requests to multiple AI providers in parallel (e.g., OpenAI, Anthropic, and Gemini simultaneously). When multiple providers are configured, the NTL API sends the same prompt to each provider, collects their responses, and evaluates consensus across the results before returning a normalised response to the EA. This consensus evaluation increases confidence in the assessment — if multiple independent models agree on market regime, directional bias, and risk assessment, the result is more reliable than any single model’s opinion.

Provider Aliases — Each provider configuration supports an alias field, enabling per-market provider routing. For example, you might configure provider=OpenAI,alias=EURUSD,model=gpt-4o,temperature=0.3 alongside provider=Anthropic,alias=GBPUSD,model=claude-sonnet-4-20250514,temperature=0.3. The EA’s SetActiveProvider() method selects the appropriate configuration for each market based on its alias. This lets you use different models, temperatures, or even different providers for different instruments — perhaps a more conservative model for volatile pairs and a more creative one for trending markets.

The Providers Config String specifies the provider, model, temperature, and optional alias as comma-separated key-value pairs. Multiple providers are separated by semicolons.

4. Response Parsing

When the AI responds, the AiResponseParser extracts the structured JSON and populates the assessment. The parser is lenient with missing fields, applying sensible defaults: regime defaults to “unknown”, bias to “neutral”, risk_mode to “normal”, and confidence to 0.5. If regime_confidence or bias_confidence are omitted, they default to the overall confidence value. The valid_minutes field (defaulting to 15 minutes if omitted) determines how long the assessment remains active before the EA requests a refresh.

The parser also normalises all price values to the symbol’s tick size and all volume values to broker limits, ensuring that AI-suggested levels are always valid for order submission.

For modes with position management capability (Autonomous and Gated Trading with management permissions), the parser also extracts the instructions array, where each instruction specifies an action, a ticket reference, price levels, sizing, confidence, validity window, and reasoning.

5. Validation and Execution

Before any assessment or instruction can affect trading, it passes through local validation:

  • Confidence threshold: The assessment’s overall confidence must meet or exceed your Min Confidence Threshold (default 0.30). Below this, the assessment is ignored and safe defaults apply.
  • Validity window: The assessment must not have expired (current time must be before validUntil).
  • Status check: The assessment must be in Valid or Stale status — Default, Error, and Expired states are rejected.

For trade instructions (in Autonomous and Gated Trading modes), the AiInstructionValidator performs additional checks: permission verification (is the requested action allowed by your permission flags?), confidence threshold per instruction, position limit checks, ticket validation for modify/close actions, risk limit enforcement (lot size and risk percentage), and pending order price validation (e.g., buy stop must be above current ask).

If an instruction exceeds risk limits, the validator reduces the size rather than rejecting it outright. This “override excess risk” behaviour ensures the AI’s intent is preserved at a safe scale.

6. Decision Recording

After each successful AI response is parsed, the EA records the assessment in the decision history (see Decision History section below). Before updating to the new assessment, the prior assessment’s directional prediction is evaluated against actual price movement. This creates a rolling accuracy record that is persisted to disk and fed back into future prompts, enabling the AI to learn from its own recent performance within the session.

7. Assessment Application

Once validated, the assessment influences trading according to your mode:

  • Monitor Only: Assessment is displayed on the chart dashboard. No trading impact.
  • Filter Signals: When your entry scripts fire, the EA checks the assessment. If the AI’s bias opposes the trade direction, the entry is filtered (blocked). If risk_mode is “avoid”, the entry is blocked. If risk_mode is “reduced” or “minimal”, the entry proceeds with a smaller position size.
  • Gated Trading: The AI evaluates the specific pending signal. Its bias and risk_mode are interpreted as Allow, Filter, or Reduce decisions. If management permissions are enabled, validated management instructions (close, modify SL/TP) are also forwarded to the trade execution layer.
  • Autonomous: Validated instructions are forwarded to the trade execution layer for processing.

AI Modes In Depth

Disabled

All AI features are off. No API calls are made, no AI-related processing occurs, and no AI data is displayed. Use this when you want purely script-driven or manual trading.

Monitor Only

The AI analyses the market periodically and its assessment is displayed on the chart, but it has zero impact on trade execution. This mode is ideal for several scenarios: evaluating AI quality before committing to automated use, comparing AI assessments against your own analysis to build confidence, running the AI alongside manual trading for a second opinion, and testing different provider/model configurations to find what works best for your instruments.

API calls occur on each new bar (subject to the refresh interval and the AI’s own validity window), so costs accumulate steadily. Start with a moderate refresh interval (10–15 minutes) while evaluating.

Filter Signals

This is the most common production mode for traders who use EAsiScript entry signals. The AI maintains a periodic assessment of market conditions, and when your scripts generate a trade signal, the assessment is consulted before execution.

How filtering works: When a long entry signal fires, the EA checks AllowsLong() — this returns true if the AI’s bias is Neutral, Bullish, or StrongBull. A Bearish or StrongBear bias blocks the long entry. The same logic applies in reverse for short entries via AllowsShort(). Additionally, AllowsTrading() checks whether risk_mode is anything other than “avoid” — if the AI has set risk_mode to “avoid”, all entries are blocked regardless of direction.

How risk modulation works: If the entry passes the directional filter, the EA applies position sizing adjustments. Two multipliers are combined. The bias multiplier boosts entries aligned with the AI’s directional view and reduces counter-directional entries — StrongBull/StrongBear gives 1.25× for aligned trades and 0.5× against, while regular Bullish/Bearish gives 1.1× aligned and 0.75× against. The risk multiplier scales based on the AI’s risk assessment — Normal is 1.0×, Reduced is 0.5×, Minimal is 0.25×, Aggressive is 1.5×, and Avoid is 0.0× (blocks the trade entirely). These two multipliers are combined, so a StrongBull bias with Reduced risk on a long entry produces 1.25 × 0.5 = 0.625× the normal position size.

Fail-open behaviour: If the AI is unavailable (no assessment received, assessment expired, or confidence below threshold), all multipliers default to 1.0 and all directional filters default to “allow”. Your scripts continue trading normally without AI influence. This makes Filter Signals the safest active mode — AI unavailability never blocks trading.

Gated Trading

Gated Trading is designed for traders who want their scripts to control when trades are entered, but want AI oversight on whether each entry should proceed. Optionally, it also gives the AI the ability to actively manage open positions — trailing stops, adjusting targets, and closing trades — while keeping entry decisions script-driven.

The AI is called on-demand when your entry scripts generate a signal, not periodically. This minimises API calls and costs while still providing AI validation at decision points.

Entry gating: When a signal fires, the EA caches all signal parameters (direction, entry price, SL, TP, volume, stop size in points, reward in points, risk/reward ratio, order type) in a GatedTradeSignal and immediately submits an AI request. The signal is held in a pending state — no trade is executed until the AI responds.

The AI receives the full signal context in its prompt, including the entry direction, exact prices, stop size in points, reward in points, and the risk/reward ratio. It evaluates whether the signal should proceed based on market structure alignment, risk/reward acceptability, and current conditions.

How the AI’s response is interpreted: The AI’s standard assessment fields (bias, risk_mode) are mapped to a gate decision. If the bias aligns with the signal direction AND risk_mode is “normal” or “aggressive”, the signal is allowed. If the bias opposes the signal direction OR risk_mode is “avoid”, the signal is filtered (blocked). If risk_mode is “reduced” or “minimal”, the signal is allowed with a reduced position size.

Position management: When management permissions are enabled (Allow Close, Allow Modify SL, Allow Modify TP), Gated Trading gains a second capability. The AI receives open position data, pending order data, and the permissions block alongside the signal context. It can then issue management instructions — close, modify SL, modify TP, or modify both — for existing positions. The available actions in Gated Trading are deliberately limited to management: close, modify_sl, modify_tp, modify_both, and hold. Open and place-order actions are excluded because entries always come from scripts.

When no pending signal is present (for example, during periodic management-only requests triggered by open positions), the AI is instructed to focus on position management only. This means a Gated Trading setup with management permissions gives you script-controlled entries with AI-controlled trade management — combining the best of both approaches.

Timing considerations: Gate signals use a short cooldown (5 seconds) rather than the full refresh interval, preventing rapid-fire requests while keeping response times practical. The cached signal expires after the configured timeout (default 100 seconds) — if the AI hasn’t responded by then, the signal is discarded. This prevents stale signals from executing after market conditions have moved.

Fail-closed behaviour: Unlike Filter Signals, Gated Trading requires AI approval for entries. If the AI is unreachable, pending signals are discarded. This protects you from unvalidated entries but means API outages will prevent new entries. However, if management permissions are enabled, any existing positions continue to be managed via broker-enforced SL/TP until AI context is restored.

Autonomous

Full AI control over trading decisions. The AI can open positions, close positions, modify SL/TP levels, place pending orders, and cancel orders — all subject to the permission flags you configure.

This is the most powerful and the most dangerous mode. Every permission defaults to false for safety, requiring you to explicitly enable each capability.

One position per assessment: The AI is instructed to open at most one new position per assessment cycle. This prevents the AI from rapidly accumulating positions if it becomes overly bullish or bearish.

Instruction lifecycle: When the AI returns trade instructions, each instruction goes through this pipeline: the response parser extracts it from the JSON, the instruction validator checks it against permissions, confidence thresholds, position limits, risk limits, and price validity, and valid instructions are queued for execution by the trade engine. Each instruction carries its own confidence score, validity window, and reasoning text.

Conflict detection: The instruction set is validated for internal conflicts before any individual instruction is processed. For example, if the AI requests both opening a long position and opening a short position in the same assessment, the entire set is rejected as conflicting.

Risk override: If the AI requests a position size that exceeds your configured max lots or max risk percentage, the validator reduces the size to the limit rather than rejecting the instruction. This preserves the AI’s directional intent while enforcing your risk rules.


The AI Assessment

Every AI response produces an sAiAssessment — the central data structure that drives all AI-influenced decisions. Understanding each field helps you interpret the dashboard display and tune your settings effectively.

Market Regime

The regime classifies current market behaviour. The AI chooses from seven options:

Regime Description Typical Implications
Trending Clear directional movement with higher highs/lows (uptrend) or lower highs/lows (downtrend) Trend-following strategies favoured; mean reversion risky
Ranging Horizontal consolidation between identifiable support and resistance Breakout strategies on watch; trend signals unreliable
Volatile High ATR, erratic price swings without clear direction Reduced position sizing recommended; wider stops needed
Quiet Low volatility, tight price ranges Breakout potential; current signals may be noise
Breakout Transitioning from range — price breaking through established levels Momentum entry opportunities; false breakout risk
Reversal Evidence of trend exhaustion and potential direction change Counter-trend setups forming; confirmation needed
Unknown Insufficient data or conflicting signals Safe default; AI falls back to neutral recommendations

Directional Bias

The AI’s view on likely price direction:

Bias Effect on Longs Effect on Shorts Multiplier (Aligned) Multiplier (Against)
Neutral Allowed Allowed 1.0× 1.0×
Bullish Allowed Filtered 1.1× 0.75×
StrongBull Allowed Filtered 1.25× 0.5×
Bearish Filtered Allowed 0.75× (longs) 1.1× (shorts)
StrongBear Filtered Allowed 0.5× (longs) 1.25× (shorts)

“Filtered” means the entry is blocked in Filter/Gated Trading modes. In Monitor Only mode, the bias is displayed but not enforced. In Autonomous mode, the AI manages direction through its own instructions rather than through bias filtering.

Risk Mode

The AI’s recommended risk posture:

Risk Mode Multiplier Trading Allowed? Typical Trigger
Normal 1.0× Yes Standard conditions, no unusual factors
Reduced 0.5× Yes (half size) Elevated uncertainty, conflicting signals, approaching key levels
Minimal 0.25× Yes (quarter size) High volatility, very unclear conditions
Aggressive 1.5× Yes (boosted) Strong trend with confirmation (used sparingly)
Avoid 0.0× No Extreme conditions where trading is inadvisable

Confidence Scores

The assessment contains three confidence values from the AI, each ranging from 0.0 to 1.0:

  • Overall — Aggregate confidence across all components. This is the score checked against your Min Confidence Threshold.
  • Regime — How certain the AI is about its market structure classification. Defaults to the overall value if not provided.
  • Bias — How certain the AI is about its directional view. Defaults to the overall value if not provided.

Internally, the EA also tracks a risk confidence value which defaults to the overall confidence.

Interpreting confidence patterns:

  • High overall, low components: The AI is generally confident but hedging on specifics. Common in transitional markets.
  • Low overall, high regime: Clear market structure but uncertain about implications. Example: an obvious range where breakout direction is unclear.
  • High bias, low overall: Confident in direction but uncertain about overall conditions. Consider taking the directional signal but with conservative position size.
  • All scores below 0.3: The AI has insufficient data or deeply conflicting signals. The assessment will be ignored (below default threshold) and safe defaults apply.

Key Levels

The AI identifies support and resistance prices from visible price action and indicator data. These are returned as arrays of prices in the key_levels object. In Autonomous mode, the AI may use these levels for SL/TP placement on its trade instructions.

Referenced Events

When using Grounded Events export mode, the AI is instructed to cite the specific event IDs that influenced its assessment. These IDs appear in the referenced_events array. This creates an audit trail: you can trace exactly which market structure events (FVGs, CHoCH signals, liquidity sweeps) the AI relied upon for its conclusions.

Validity Window

The valid_minutes field (typically 15–60 minutes) tells the EA how long the AI expects its assessment to remain relevant. The EA converts this to a validUntil timestamp. Until that time passes, no new periodic request is sent (saving API costs). When it expires, the next new bar triggers a refresh.

The AI adapts this window based on conditions: in volatile markets, it may set a shorter validity (5–10 minutes) to ensure frequent updates; in quiet markets, it may extend to 30–60 minutes.


Decision History and Accuracy Feedback

EAsiTrader maintains a rolling history of AI decision records that creates a self-correcting feedback loop. Each assessment is recorded when it arrives, its prediction accuracy is evaluated when it is replaced, and the resulting history is fed back into future prompts so the AI can learn from its own recent performance.

How It Works

When a new AI assessment arrives, the EA performs three steps in sequence:

  1. Evaluate the prior assessment — Before replacing the old assessment, the EA compares the prior assessment’s directional bias against actual price movement between the time the assessment was generated and the time it expired (or was replaced). If the bias was Bullish or StrongBull and price moved up, the bias is marked correct. If the bias was Bearish or StrongBear and price moved down, it is marked correct. Neutral bias is evaluated differently since it implies no directional expectation. The regime classification is also evaluated for correctness.

  2. Record the new assessment — The new assessment’s regime, bias, risk mode, confidence, and reasoning are captured in a decision record along with the current price and a sequence ID. As instructions from the assessment are later executed, failed, or rejected, those outcomes are also recorded against the same decision record.

  3. Build the history prompt — On the next AI request, the decision history assembles a structured prompt section containing the recent decision records (up to the last 5 assessments) and aggregated accuracy statistics. The accuracy stats include total assessments evaluated, the number where the directional bias was correct, and the average confidence when the AI was correct versus when it was wrong.

What the AI Sees

The AI receives a “Decision History” section in its user prompt that includes a summary of recent assessments with their outcomes and an accuracy report. For example, if the AI’s bias has been correct on 3 out of the last 5 assessments with an average confidence of 0.72 when correct and 0.55 when wrong, that information is embedded in the prompt. This allows the AI to calibrate its confidence scores more accurately and recognise patterns in its own errors.

Persistence

Decision history is persisted to .hist files (one per symbol/timeframe combination, e.g., EURUSD_H1.hist) using JSON format. This means the history survives EA restarts — when the EA loads, it reads the existing history file and resumes recording from where it left off. The rolling buffer keeps the last 5 records by default, so the file stays small.

Why This Matters

Without decision history, each AI request is stateless — the AI has no knowledge of whether its previous assessments were accurate. With decision history enabled, the AI can: adjust confidence levels based on recent accuracy (lowering confidence if it has been frequently wrong), recognise when its regime classifications are consistently incorrect for the current instrument, adapt its approach if a particular bias direction keeps failing, and correlate instruction outcomes (executed, failed, rejected) with its assessment quality.

This feedback loop is automatic — there are no settings to configure. It operates in all active AI modes (Monitor Only, Filter Signals, Gated Trading, and Autonomous).


Multi-Provider Configuration

EAsiTrader supports configuring multiple AI providers

Single vs Multi-Provider

Single provider is the simplest setup. You configure one provider in your Providers Config String and all AI requests go to that provider. This is sufficient for most traders and keeps costs predictable.

Multiple providers can be configured by separating provider definitions with semicolons in the config string.

Provider Config String Format

Each provider is defined as comma-separated key-value pairs:

provider=OpenAI,model=gpt-4o,temperature=0.3

Multiple providers are separated by semicolons:

provider=OpenAI,model=gpt-4o,temperature=0.3;provider=Anthropic,model=claude-sonnet-4-20250514,temperature=0.3

Available keys include provider (OpenAI, Anthropic, Gemini), model (the specific model identifier), temperature (0.0–1.0), alias (for per-market routing), and maxOutputTokens.

Per-Market Provider Aliases

The alias field enables different provider configurations for different markets. When you include an alias, the EA routes requests from that market to the matching provider configuration:

provider=OpenAI,alias=EURUSD,model=gpt-4o,temperature=0.2;provider=OpenAI,alias=XAUUSD,model=gpt-4o,temperature=0.4

In this example, EURUSD requests use a lower temperature (more deterministic) while XAUUSD uses a higher temperature (more creative). You could also use entirely different providers or models per market.

If no alias matches the current market, the EA falls back to the first provider configuration without an alias, or the first configuration overall.

Cost Considerations

Multi-provider mode multiplies your API costs by the number of active providers. If you configure three providers, each request costs roughly 3× what a single provider would cost. Use multi-provider consensus selectively — perhaps only for Autonomous mode where the additional confidence justifies the cost, while using a single provider for Filter Signals or Monitor Only modes.


Ask AI Chat Panel

EAsiTrader includes a built-in interactive AI chat panel that lets you have ad-hoc conversations with your configured AI provider directly from within the EA. This is separate from the automated assessment system — it’s a tool for on-demand analysis, strategy discussion, and data exploration.

Accessing the Panel

The Ask AI panel is located in the Tester tab as a sub-tab. It provides a prompt editor where you can type questions or analysis requests, a response display area, and controls for managing conversations.

Data Attachments

The panel’s most powerful feature is the ability to attach live trading data to your prompts. Nine attachment toggles let you include any combination of:

Attachment Description
OHLC Current OHLC price data exported from the chart’s series
Indicators Refreshes all indicators and exports their current state
URLs URLs configured in your AI settings for server-side ingestion
Stats Your statistics log file with performance metrics
Trades Your trades log file with historical trade data
EAsiScript User guide URLs for the scripting system
Presets Your common and market-specific preset configuration files
Code Interpreter Enables the AI to execute code for data analysis
Images Enables image generation (16:9 aspect ratio)

Each attachment is one-shot per send — toggling OHLC on attaches the current OHLC data to the next message only. This keeps token usage controlled.

Use Cases

Strategy development: Attach your OHLC and Indicators data, then ask the AI to analyse current market structure and suggest entry criteria. The AI sees the same data it would receive in automated mode, so its analysis is grounded in actual market conditions.

Performance review: Attach your Stats and Trades logs, then ask the AI to identify patterns in your winning and losing trades, suggest improvements, or highlight time-of-day performance differences.

Configuration tuning: Attach your Presets file and ask the AI to review your settings and suggest optimisations based on your trading goals.

Ad-hoc analysis: Ask questions about specific market conditions, test strategy ideas, or get a second opinion on a trade setup — all with access to your live data.

Conversation Management

The panel supports full conversation threading — follow-up messages maintain context from previous exchanges. Use the Reset button to clear the conversation and start fresh. The Load/Save functions let you persist prompts to .txt files in the AI Prompts folder and save responses to the AI Results folder, building a library of reusable prompts and analysis results.

Output files generated by the AI (when Code Interpreter is enabled) are automatically downloaded and saved to your AI Results folder.


Grounded Events vs Raw Data

This is one of the most important configuration decisions for AI quality and cost.

What Are Grounded Events?

Grounded events are pre-computed, validated market structure facts exported by EAsiTrader’s indicators. Each event has a unique ID, a type (FVG, CHoCH, liquidity sweep, etc.), associated price levels, and a timestamp. The indicator has already done the computational work of identifying these structures — the AI receives them as established facts, not raw data to interpret.

The AI prompt explicitly instructs: “Do not infer structural events (FVG, CHoCH, sweeps) beyond what is listed in grounded_events.” This prevents hallucination — the AI cannot claim to see a Fair Value Gap that doesn’t exist in the data.

When the AI references a grounded event in its reasoning, it includes the event ID in the referenced_events array. This creates verifiable, auditable analysis.

Important: Only enabled indicators export grounded events and raw buffer data to AI requests. In the GUI, enable an indicator by ticking the checkbox alongside its name in the Indicators List. In a preset file, prefix the indicator’s creation string with + (e.g. InpTradeTool_CustomIndicator6=+NTL\ChoCh(...).ex5,...). An indicator that is not enabled will not contribute any data to the AI, even if AI Mode is active and the indicator is listed in the Custom Indicators section. This applies to all export modes — Grounded Events Only, Raw Only, and Both.

What Is Raw Indicator Data?

Raw data consists of timestamped buffer values from each enabled indicator, provided as structured JSON (inline mode) or CSV (file mode). The AI receives the actual numerical readings and must interpret their meaning itself.

This gives the AI maximum flexibility — it can spot patterns across indicator interactions that grounded events don’t capture — but it uses significantly more tokens and is more susceptible to misinterpretation. The AI might, for example, see a price level and incorrectly infer it represents a Fair Value Gap when the indicator data doesn’t support that conclusion.

Recommendations

Production trading: Use Grounded Events Only (default). This gives the lowest token cost, prevents hallucination, and produces the most consistent and verifiable assessments. The AI focuses on validated market structure rather than attempting to re-derive it from raw numbers.

Development and debugging: Use Both to compare what the AI derives from raw data against the grounded events. This helps you validate that your indicators are exporting meaningful events and that the AI is interpreting them correctly.

Advanced usage: Use Raw Only when you want the AI to have full interpretive freedom, perhaps with indicators that don’t export grounded events, or when you’re exploring whether the AI can find patterns your grounded events don’t capture. Be aware of higher costs and potential inconsistency.

Cost Impact

Grounded events are compact — typically a small JSON array of 10 or fewer events with IDs, types, and price levels. Raw buffer data for the same indicators might include hundreds of timestamped rows across multiple buffers. The token difference can be 5–10× or more, directly affecting API cost per request.


Writing Effective Strategy Prompts

The Strategy Instructions setting is your direct communication channel to the AI. Text you enter here is injected verbatim into the AI’s system prompt under a “Trading Strategy” section. This is the single most impactful configuration option for tailoring AI behaviour to your trading approach.

Principles of Effective Strategy Prompts

Be specific and actionable. The AI performs best when given concrete criteria rather than vague guidance. Compare:

Weak: "Trade with the trend."

Strong: "Only assign bullish bias when price is above the 200-bar EMA and the most recent CHoCH event confirms a bullish break of structure. Only assign bearish bias when price is below the 200-bar EMA and the most recent CHoCH confirms bearish BOS."

Reference the data the AI actually receives. The AI can only work with what’s in its prompt. If you reference indicators or concepts that aren’t in the exported data, the AI will either ignore them or hallucinate. Stick to OHLC price action concepts, the specific grounded event types your indicators export, and the raw indicator buffers included in the data.

Use the AI’s output vocabulary. Frame instructions in terms of the fields the AI controls: regime, bias, risk_mode, confidence, key_levels, and (in Autonomous or Gated Trading with management permissions) instructions. For example:

"Set risk_mode to 'reduced' during the first 30 minutes after London open (08:00-08:30 server time) due to high spread and erratic price action."

"When a bullish FVG event exists within 20 points of current price, increase bias confidence by 0.1 if the bias is already bullish."

Keep it concise. The strategy instructions become part of every AI request. Excessively long instructions consume tokens on every call. Aim for clear, direct statements rather than lengthy explanations. A well-crafted prompt of 5–15 lines is typically more effective than a rambling paragraph.

Strategy Prompt Templates

Trend-Following Strategy

Focus on trend continuation setups only.
Assign bullish/bearish bias only when the most recent CHoCH event confirms the direction.
Set risk_mode to 'reduced' during the first and last hour of the trading session.
Prefer 'normal' risk_mode when bias aligns with the higher timeframe trend visible in multi-TF OHLC data.
Set risk_mode to 'avoid' when regime is 'ranging' — wait for breakout confirmation.
Key levels should prioritise recent swing highs and lows from CHoCH and LP events.

Mean Reversion / Range Strategy

Focus on range-bound setups.
Set regime to 'ranging' when price has tested both support and resistance from LP events within the last 50 bars.
Assign bullish bias only near identified support levels (within 15 points).
Assign bearish bias only near identified resistance levels (within 15 points).
Set risk_mode to 'avoid' when regime shifts to 'breakout' or 'trending'.
Keep valid_minutes short (5-10) when price is near key levels — reassess frequently.

News-Aware Configuration

If current server time is within 15 minutes of a major session open (London 08:00, New York 13:00 server time), set risk_mode to at least 'reduced'.
After session opens, if volatility normalises within 3-5 bars, return to 'normal' risk_mode.
Avoid setting 'aggressive' risk_mode during the London/New York overlap (13:00-16:00 server time).

Conservative Capital Preservation

Never set risk_mode to 'aggressive'.
Default bias to 'neutral' unless confidence exceeds 0.7.
Set risk_mode to 'reduced' whenever regime is 'volatile'.
Set risk_mode to 'avoid' when regime is 'unknown'.
Use tight valid_minutes (5-10) to ensure frequent reassessment.
Key levels should include only levels with at least two touches visible in OHLC data.

Aggressive Momentum

Favor 'aggressive' risk_mode when regime is 'trending' and bias confidence exceeds 0.75.
Set strong bias (strongbull/strongbear) when momentum is confirmed by multiple timeframes.
Allow 'normal' risk_mode even when regime is 'volatile' if bias is clear.
Extend valid_minutes (20-45) during clean trends to reduce API calls.
Only use 'avoid' when data is genuinely insufficient.

Autonomous Mode — SMC-Based

Trade Smart Money Concepts: FVG entries, CHoCH confirmations, liquidity sweeps.
Open positions only after a CHoCH confirms direction AND an unfilled FVG provides an entry zone.
Set SL behind the FVG zone boundary (the high for shorts, the low for longs).
Set TP at the next LP (liquidity pool) level visible in grounded events.
If no clear FVG entry exists near current price, return an empty instructions array.
Trail stops to break-even once position reaches 1R profit.
Close positions early if a CHoCH event fires in the opposite direction.

Common Mistakes to Avoid

Don’t reference external information. Statements like “Consider NFP data this Friday” are meaningless to the AI — it has no knowledge of economic calendars unless you provide news URLs. The AI’s data grounding rules explicitly forbid referencing information not in the prompt.

Don’t override the response format. Instructions like “respond in a different JSON format” will cause parsing failures. The EA expects the exact schema defined in the prompt.

Don’t set contradictory rules. “Always be aggressive” combined with “never risk more than minimal” will confuse the AI. It will either ignore one instruction or produce inconsistent assessments.

Don’t micromanage every bar. The AI is designed to provide a stable view across several bars. Instructions that change behaviour bar-by-bar undermine the assessment stability and increase the likelihood of whipsaw recommendations.

Don’t make instructions too long. Every token in your strategy instructions is sent on every request. A 500-word strategy prompt at 15-minute intervals adds up to significant token usage over time.


Trading Style In Detail

The Trading Style setting (Conservative, Moderate, Aggressive) applies across all active modes — not just Autonomous. It is communicated to the AI in the system prompt as explicit behavioural guidance that shapes how the AI applies your strategy instructions and interprets market conditions.

Conservative

In Filter/Gated Trading modes, the AI uses stricter thresholds. It sets “avoid” for signals with confidence below 0.7 or unclear setups, and prefers “reduced” risk_mode for marginal signals. It will block more entries and produce smaller positions overall.

In Autonomous mode, the AI employs selective entry criteria, sets tighter initial stops (1–2R), targets modest gains (1.5–2R), locks in profits early by trailing stops aggressively, and prefers single position management over pyramiding.

Moderate (Default)

Balanced approach. The AI uses “avoid” only for clearly adverse conditions, applies standard confidence thresholds, and allows trades through when conditions are ambiguous but not clearly negative.

Aggressive

The AI favours allowing trades. In Filter/Gated Trading modes, it only blocks signals with strongly opposing evidence and prefers “normal” or “aggressive” risk_mode when the signal has any merit.

In Autonomous mode, the AI accepts wider stops (2–4R), targets larger moves (3–5R), has higher drawdown tolerance, and may build positions in strong trends.


Cost Management

AI API calls cost money. Understanding the cost drivers helps you balance analysis quality against budget.

Cost Drivers

Request frequency is the primary cost factor. Periodic modes (Monitor Only, Filter Signals, Autonomous) call the AI on every bar that passes the refresh interval check. On a 5-minute chart with a 5-minute refresh interval, that’s up to 12 calls per hour. On a 1-minute chart with no refresh interval, it could be 60 calls per hour.

Token volume per request depends on Max Bars (more history = more tokens), number of configured timeframes (each adds a full OHLC dataset), export mode (Raw data is 5–10× larger than Grounded Events), number of open positions and orders (in modes with position management), strategy instruction length, and decision history prompt content (compact, but adds some overhead per request).

Multi-provider configuration multiplies per-request costs by the number of active providers. Three providers means roughly 3× the cost per assessment cycle.

The AI’s own validity window provides natural cost optimisation. When the AI sets valid_minutes to 30, no new request is made for 30 minutes even if the refresh interval is lower. The AI adapts this based on conditions — volatile markets get shorter windows, quiet markets get longer ones.

Cost Optimisation Strategies

Use Gated Trading mode when you have reliable entry scripts. The AI is only called when a signal fires (plus any management requests for open positions), which might be a few times per day rather than every few minutes. This can reduce costs by 90% or more compared to periodic modes.

Increase the Refresh Interval to set a floor on request frequency. A 15-minute interval limits you to 4 calls per hour maximum, regardless of timeframe.

Use Grounded Events Only for export mode. Raw indicator data can be 5–10× larger in tokens. Grounded events are compact and produce better results.

Reduce Max Bars to 100–200 unless your strategy requires deep history. 300 bars of 5-minute data is 25 hours of history — more than enough for most intraday strategies.

Limit additional timeframes. Each timeframe in the Timeframes setting adds a complete OHLC dataset. Two additional timeframes triples your OHLC data volume. Use only the timeframes that genuinely inform your analysis.

Use single-provider mode for advisory modes (Monitor Only, Filter Signals) where consensus adds less value, and reserve multi-provider configurations for Autonomous or Gated Trading where the extra confidence justifies the cost.

Monitor token usage via the inputTokens and outputTokens fields in the assessment metadata. These are tracked per request and cumulatively across the session, and can help you identify unexpectedly expensive configurations.


Error Handling and Resilience

The AI system is designed to degrade gracefully when things go wrong.

Error Throttling

If an API call fails, the EA applies exponential backoff. The first retry is delayed by 60 seconds, and subsequent failures double the delay up to a maximum of 1 hour. This prevents hammering a failing API endpoint with rapid retries, which would waste money and potentially trigger rate limits.

Fatal errors (such as invalid API keys, expired credits, or provider configuration issues) halt AI requests entirely with a 24-hour lockout until manually cleared. The EA detects these from HTTP status codes and error messages. To resume after fixing the underlying issue, use the “Clear Fatal Error” function.

Errors are classified into categories (transient, rate-limit, auth, fatal) to determine appropriate backoff behaviour. Transient errors use standard exponential backoff, rate-limit errors respect the server’s Retry-After header, and auth/fatal errors trigger immediate lockout.

Context Staleness

Assessments transition through a lifecycle: Default → Valid → Stale → Expired. A Valid assessment is fresh and actively used. A Stale assessment has passed its validity window but is still usable (with caution) if it meets the confidence threshold. An Expired assessment is too old and is treated as unavailable.

Mode-Specific Resilience

Filter Signals is fail-open: if the AI is unavailable, entries proceed normally with default (1.0×) multipliers. This is the safest behaviour for most traders.

Gated Trading is fail-closed for entries: if the AI is unreachable, pending entry signals are discarded. This protects you from unvalidated entries but means API outages stop new trades from opening. Existing positions retain their broker-enforced SL/TP and are not affected by AI unavailability.

Autonomous mode falls back to broker-enforced SL/TP management only when AI context is unavailable. Existing positions retain their stop loss and take profit levels as placed by the broker, but no new trades are opened and no active management occurs until AI context is restored.


Trade Management Permissions Reference

Each permission independently controls a category of trade actions. All default to false. These permissions apply to Autonomous mode and, for management actions, to Gated Trading mode.

Permission Actions Controlled Autonomous Gated Trading Considerations
Allow Open Open Long, Open Short Enables the AI to initiate new market positions. The AI respects max positions and risk limits. Not available in Gated Trading (entries come from scripts).
Allow Close Close position Enables early exits based on AI analysis. The AI can mark closes as only_if_profitable.
Allow Modify SL Modify SL, Modify Both* Enables stop-loss trailing and adjustment. Useful for active trade management.
Allow Modify TP Modify TP, Modify Both* Enables take-profit adjustment for trend extension or early profit-taking.
Allow Place Orders Buy Stop, Sell Stop, Buy Limit, Sell Limit Enables pending order placement at key levels. Not available in Gated Trading.
Allow Cancel Orders Cancel Order Enables removal of pending orders that no longer align with the AI’s view.

*Modify Both (adjusting SL and TP simultaneously) requires both Allow Modify SL and Allow Modify TP.

Starting out (minimal risk):
Enable only Allow Modify SL. The AI can trail stops on positions opened by your scripts but cannot open or close trades. This lets you evaluate AI trade management quality with minimal risk. This works in both Autonomous and Gated Trading modes.

Active management (Gated Trading):
Use Gated Trading mode with Allow Close and Allow Modify SL enabled. Your scripts control entries via the gate evaluation, and the AI manages the resulting positions — trailing stops and closing early when conditions deteriorate.

Active management (Autonomous):
Enable Allow Close and Allow Modify SL. The AI can manage existing positions — trailing stops and closing early when conditions deteriorate — but cannot initiate new trades.

Full autonomy:
Enable Allow Open, Allow Close, Allow Modify SL, and Allow Modify TP. The AI has complete trade lifecycle control. Add Allow Place Orders if your strategy benefits from pending orders at key levels.


Closed Trade History

When Allow Closed History is enabled, the AI receives up to 5 recently closed trades from the current trading session. This applies to any mode where the AI has position management capability — Autonomous mode, and Gated Trading with management permissions enabled. Each trade includes its direction, entry and exit prices, profit in points, R-multiple, duration in bars, and close reason (SL hit, TP hit, manual close, AI-instructed, expired, or margin call).

This feedback loop enables the AI to avoid re-entry traps at levels where stops were recently hit, adjust stop placement based on repeated stop-out patterns, factor session P&L context into risk decisions (such as becoming more cautious after a string of losses), and confirm trend direction from profitable trade patterns.

If the market session start cannot be determined (e.g., market is closed), the system falls back to trades from the last 12 hours.


Configuration Recipes

The recipes below show AI Section settings in isolation. Remember that any indicators whose grounded events or raw data the AI should receive must be enabled with the + prefix in the Custom Indicators section of your preset file. See the full preset file examples in the EAsiTrader User Guide for complete configurations.

Recipe 1: Low-Cost Signal Validation

Goal: Validate entry signals with AI while minimising API costs.

Setting Value Rationale
AI Mode Gated Trading (3) AI called only when signals fire
Export Mode Grounded Events Only (0) Minimal token usage
Max Bars 150 Sufficient context, low cost
Timeframes (empty) Chart timeframe only
Trading Style Moderate (1) Balanced filtering
Min Confidence 0.30 Default threshold
Strategy Instructions Focus on trend alignment and key level proximity.

Corresponding .set file AI Section:

;
; Section AI
;
InpTradeTool_AIMode=3 // Gated Trading
InpTradeTool_AIProvidersConfigString=provider=Gemini,model=gemini-3-pro-preview,temperature=0.2
InpTradeTool_AIStrategyInstructions=Focus on trend alignment and key level proximity.
InpTradeTool_AITradingStyle=1 // Moderate
InpTradeTool_AIUrls=
InpTradeTool_AITimeframes=
InpTradeTool_AIMaxHistorySizeInBars=150
InpTradeTool_AIRefreshIntervalMinutes=15
InpTradeTool_AIMinConfidenceThreshold=0.3000
InpTradeTool_AIExportMode=0 // Grounded Events Only
InpTradeTool_AIGateSignalTimeoutInSeconds=100
InpTradeTool_AIAllowOpen=false
InpTradeTool_AIAllowClose=false
InpTradeTool_AIAllowModifySL=false
InpTradeTool_AIAllowModifyTP=false
InpTradeTool_AIAllowPlaceOrders=false
InpTradeTool_AIAllowCancelOrders=false
InpTradeTool_AIIncludeClosedHistory=true

Note: In Gated Trading mode, AIAllowOpen and AIAllowPlaceOrders must be false — entries always come from scripts. This recipe uses no management permissions, so all AIAllow* flags are false.

Recipe 2: AI-Enhanced Trend Following

Goal: Use AI to filter entries and modulate risk for a trend-following strategy.

Setting Value Rationale
AI Mode Filter Signals (2) Continuous assessment, filters entries
Export Mode Grounded Events Only (0) Focus on CHoCH and structure events
Max Bars 300 Deeper history for trend identification
Timeframes H1,H4 Multi-timeframe trend alignment
Refresh Interval 10 Balance cost and freshness
Trading Style Moderate (1) Standard filtering
Min Confidence 0.40 Slightly higher threshold for quality
Strategy Instructions See Trend-Following template above

Recipe 3: Script Entries with AI Trade Management

Goal: Scripts control entries, AI manages the resulting positions.

Setting Value Rationale
AI Mode Gated Trading (3) Gate entries + manage positions
Export Mode Grounded Events Only (0) Cost efficiency
Max Bars 200 Sufficient context for management
Timeframes M15 One higher timeframe for context
Trading Style Moderate (1) Balanced approach
Allow Close true AI can exit early
Allow Modify SL true AI can trail stops
Allow Modify TP false Let TP levels stand
Allow Closed History true Learn from recent trades
Min Confidence 0.40 Moderate bar for management decisions
Strategy Instructions Trail stops to break-even at 1R. Close early if CHoCH fires against position direction.

Corresponding .set file AI Section:

;
; Section AI
;
InpTradeTool_AIMode=3 // Gated Trading
InpTradeTool_AIProvidersConfigString=provider=Gemini,model=gemini-3-pro-preview,temperature=0.2
InpTradeTool_AIStrategyInstructions=Trail stops to break-even at 1R.\nClose early if CHoCH fires against position direction.
InpTradeTool_AITradingStyle=1 // Moderate
InpTradeTool_AIUrls=
InpTradeTool_AITimeframes=M15
InpTradeTool_AIMaxHistorySizeInBars=200
InpTradeTool_AIRefreshIntervalMinutes=15
InpTradeTool_AIMinConfidenceThreshold=0.4000
InpTradeTool_AIExportMode=0 // Grounded Events Only
InpTradeTool_AIGateSignalTimeoutInSeconds=100
InpTradeTool_AIAllowOpen=false
InpTradeTool_AIAllowClose=true
InpTradeTool_AIAllowModifySL=true
InpTradeTool_AIAllowModifyTP=false
InpTradeTool_AIAllowPlaceOrders=false
InpTradeTool_AIAllowCancelOrders=false
InpTradeTool_AIIncludeClosedHistory=true

Note: AIAllowOpen and AIAllowPlaceOrders are false (Gated Trading — entries from scripts only). AIAllowClose and AIAllowModifySL are true for active position management. Strategy Instructions use literal \n as the newline separator between lines.

Recipe 4: Autonomous Scalping

Goal: AI-driven scalping on a 5-minute chart.

Setting Value Rationale
AI Mode Autonomous (4) Full AI control
Export Mode Grounded Events Only (0) Speed and cost efficiency
Max Bars 100 Short-term focus
Timeframes M15 One higher timeframe for context
Refresh Interval 5 Frequent updates for active trading
Trading Style Moderate (1) Balanced aggression
Allow Open true Can initiate trades
Allow Close true Can exit early
Allow Modify SL true Can trail stops
Allow Modify TP false Let TP levels stand
Allow Closed History true Learn from recent trades
Min Confidence 0.50 Higher bar for autonomous action
Strategy Instructions See Autonomous Mode — SMC-Based template above

Corresponding .set file AI Section:

;
; Section AI
;
InpTradeTool_AIMode=4 // Autonomous
InpTradeTool_AIProvidersConfigString=provider=Gemini,model=gemini-3-pro-preview,temperature=0.2
InpTradeTool_AIStrategyInstructions=Trade Smart Money Concepts: FVG entries, CHoCH confirmations, liquidity sweeps.\nOpen only after CHoCH confirms direction AND an unfilled FVG provides entry zone.\nSet SL behind FVG boundary. Set TP at the next LP level.\nReturn empty instructions if no clear setup exists.\nTrail stops to break-even at 1R. Close early on opposite CHoCH.\nNever use aggressive risk_mode. Use reduced when regime is volatile.
InpTradeTool_AITradingStyle=1 // Moderate
InpTradeTool_AIUrls=
InpTradeTool_AITimeframes=M15
InpTradeTool_AIMaxHistorySizeInBars=100
InpTradeTool_AIRefreshIntervalMinutes=5
InpTradeTool_AIMinConfidenceThreshold=0.5000
InpTradeTool_AIExportMode=0 // Grounded Events Only
InpTradeTool_AIGateSignalTimeoutInSeconds=100
InpTradeTool_AIAllowOpen=true
InpTradeTool_AIAllowClose=true
InpTradeTool_AIAllowModifySL=true
InpTradeTool_AIAllowModifyTP=false
InpTradeTool_AIAllowPlaceOrders=false
InpTradeTool_AIAllowCancelOrders=false
InpTradeTool_AIIncludeClosedHistory=true

Note: In Autonomous mode, at least AIAllowOpen or AIAllowClose must be true. AIStrategyInstructions must be non-empty — it provides the AI with the decision-making framework. Entry and exit scripts in the Scripts section should be left empty since the AI controls all trade actions.

Recipe 5: Conservative Portfolio Overlay

Goal: AI as a safety net across multiple charts.

Setting Value Rationale
AI Mode Filter Signals (2) Protective filtering
Export Mode Grounded Events Only (0) Cost-efficient
Max Bars 200 Moderate context
Timeframes (empty) Chart timeframe only (cost control across many charts)
Refresh Interval 15 Low frequency across multiple instances
Trading Style Conservative (0) Maximum protection
Min Confidence 0.30 Default
Strategy Instructions See Conservative Capital Preservation template above

Recipe 6: Multi-Provider Autonomous Trading

Goal: Maximum confidence in autonomous trading decisions via consensus.

Setting Value Rationale
AI Mode Autonomous (4) Full AI control with consensus backing
Export Mode Grounded Events Only (0) Cost efficiency (multi-provider already multiplies cost)
Max Bars 200 Moderate context
Timeframes M15 One higher timeframe for context
Refresh Interval 10 Moderate frequency
Trading Style Moderate (1) Balanced by consensus
Providers Config provider=OpenAI,model=gpt-4o,temperature=0.3;provider=Anthropic,model=claude-sonnet-4-20250514,temperature=0.3 Two providers for consensus
Allow Open true Can initiate trades
Allow Close true Can exit early
Allow Modify SL true Can trail stops
Allow Modify TP true Full management
Allow Closed History true Learn from recent trades
Min Confidence 0.60 Higher bar — consensus should produce higher confidence
Strategy Instructions See Autonomous Mode — SMC-Based template above

Generating Complete AI Preset Files

The recipes above show the AI Section settings in isolation. To generate a complete, working .set preset file that includes all sections (Header, Scripts, Risk Management, Position Management, etc.), refer to:

  • EAsiTrader User Guide → Section 14: Rules for Creating Main Preset Files — Rules 1–10 cover general preset structure; Rules 11–14 cover AI-specific requirements including mode/permission mapping, Strategy Instructions formatting, AI Trigger Script behaviour, and URL encoding.
  • EAsiTrader User Guide → Preset Validation Checklist — A 10-point checklist for verifying AI-enabled presets after generation.
  • EAsiTrader User Guide → Main Preset File Examples 2–4 — Complete .set files demonstrating Filter Signals, Gated Trading with management, and Autonomous configurations.
  • Learn EAsiScript Guide → AI Prompt Examples (Examples 9–11) — Ready-to-use AI prompts for generating complete preset files with AI configurations for each mode.

Troubleshooting

AI Not Making Requests

Check that AI Mode is not Disabled, a provider config string is set, the refresh interval hasn’t locked out requests (check throttle status), no fatal error is active (clear it if so), the market is open (the session check must pass), and in Gated Trading mode, that entry scripts are configured and generating signals.

Assessments Ignored (No Effect on Trading)

Check that the assessment’s overall confidence meets your Min Confidence Threshold, the assessment hasn’t expired (check data age vs valid_minutes), AI Mode is Filter Signals or Gated Trading (Monitor Only doesn’t affect trades), and in Filter mode, that entry scripts are actually generating signals for the AI to filter.

High API Costs

Reduce Max Bars, remove unnecessary additional timeframes, switch to Grounded Events Only export mode, increase the Refresh Interval, consider switching to Gated Trading mode if you have reliable entry scripts, shorten your Strategy Instructions, and if using multi-provider mode, consider whether single-provider is sufficient for your current mode.

AI Assessments Seem Wrong

Verify that the indicators you expect the AI to use are enabled (prefixed with + in the preset file, or checkbox ticked in the GUI) — disabled indicators do not export grounded events or raw data to AI requests. Switch export mode to “Both” temporarily to compare grounded events against raw data interpretation. Check that your indicators are exporting meaningful grounded events (indicators that don’t export events contribute nothing in Grounded Events Only mode). Review the AI’s reasoning field and referenced_events to understand its logic. Check the decision history — if the AI’s recent accuracy is low, it may be receiving insufficient or misleading data for the current instrument. Try adjusting the temperature in your provider config (lower = more consistent, higher = more varied). Experiment with different models — newer models often produce better structured analysis.

Autonomous or Gated Trading Instructions Rejected

Check the Experts log for validation messages. Common causes include insufficient permissions (the requested action isn’t enabled), confidence below threshold on the individual instruction, position limit exceeded (already at max_positions), risk limit exceeded (instruction wanted more lots or risk than allowed), invalid pending order prices (buy stop must be above ask, etc.), conflicting instructions in the same set, and in Gated Trading, attempting to use open or place-order actions (which are restricted to Autonomous mode).

Decision History Issues

Decision history files (.hist) are persisted automatically. If you suspect corrupted history is affecting AI quality, you can delete the relevant .hist file from your strategy’s market folder — the EA will start fresh with no history on the next assessment cycle.


Appendix: JSON Response Schema

This is the complete JSON schema the AI must return. Understanding it helps when reviewing logs or crafting strategy prompts.

{
  "regime": "trending | ranging | volatile | quiet | breakout | reversal | unknown",
  "bias": "bullish | bearish | neutral | strongbull | strongbear",
  "risk_mode": "normal | reduced | minimal | aggressive | avoid",
  "confidence": 0.0-1.0,
  "regime_confidence": 0.0-1.0,
  "bias_confidence": 0.0-1.0,
  "valid_minutes": 15,
  "reasoning": "Brief explanation of assessment rationale",
  "key_levels": {
    "resistance": [1.1050, 1.1075],
    "support": [1.1020, 1.0995]
  },
  "warnings": ["Array of concerns or caveats"],
  "referenced_events": ["EVT_001", "EVT_003"],
  "instructions": [
    {
      "action": "open_long | open_short | close | modify_sl | modify_tp | modify_both | place_buy_stop | place_sell_stop | place_buy_limit | place_sell_limit | cancel_order | hold",
      "ticket": 0,
      "entry_price": 0.0,
      "sl_price": 1.1020,
      "tp_price": 1.1080,
      "lots": 0.0,
      "risk_percent": 1.0,
      "confidence": 0.75,
      "only_if_profitable": false,
      "valid_minutes": 5,
      "reasoning": "Explanation for this specific action"
    }
  ]
}

Notes on specific fields:

  • confidence, regime_confidence, and bias_confidence are the three confidence values the AI provides. If regime_confidence or bias_confidence are omitted, they default to the overall confidence value. There is no risk_confidence field in the schema — internally, risk confidence defaults to the overall value.
  • valid_minutes at the assessment level controls how long before the EA requests a refresh. At the instruction level, it controls how long the instruction remains executable.
  • ticket of 0 means new position (for open actions). For modify, close, and cancel actions, this must reference an existing position or order ticket.
  • entry_price of 0 means market price (for open actions). For pending orders, this is the trigger price and is required.
  • lots of 0 means the EA should calculate position size based on risk_percent and the stop loss distance.
  • risk_percent of 0 means use the EA’s configured default risk per trade.
  • The instructions array is present in Autonomous mode (full action set) and in Gated Trading mode with management permissions (limited to close, modify_sl, modify_tp, modify_both, and hold). In all other modes, it is omitted.
  • referenced_events should list only IDs from the grounded_events data provided in the prompt. The AI is instructed not to fabricate event references.
  • All prices in the response are normalised to the symbol’s tick size, and all volume values are normalised to broker limits, ensuring AI-suggested values are always valid for order submission.

Rev: 27.02.2026 18:34