jgtagentic

Trader Analysis to Spec Transformation Guide

This guide explains how an LLM can listen to a trader’s market analysis and transform it into a .jgtml-spec file for use with IntentSpecParser.

1. Capture the Trader’s Narrative

When the trader describes the market, capture:

2. Map Observations to Spec Fields

Translate the narrative into the YAML fields expected by .jgtml-spec:

JGTML Signal Component Mapping

The consolidated AlligatorAnalysis module supports all three Alligator types:

alligator_types:
  regular:
    periods: [5, 8, 13]  # Jaw, Teeth, Lips
    purpose: "Primary timeframe trend analysis"
    trader_language: ["trend establishment", "momentum confirmation"]
    
  big:
    periods: [34, 55, 89]
    purpose: "Higher timeframe structure validation" 
    trader_language: ["pullback entry", "retest opportunity"]
    
  tide:
    periods: [144, 233, 377]
    purpose: "Macro trend environment"
    trader_language: ["campaign direction", "major reversal confirmation"]

Core Signal Types Available:

If the trader references wave counts or timeframe confluence, include them in signal descriptions or as custom keys.

3. Example Conversation to Spec

Trader:

“On the H4 chart of EUR/USD I see a completed Wave 3 and expect a Wave 4 pullback. The Alligator is opening and the AO shows strong momentum. I’ll look for a breakout above 1.0800 with confluence on H1.”

LLM Generated Spec:

strategy_intent: "Trade EUR/USD Wave 5 breakout"
instruments:
  - "EUR/USD"
timeframes:
  - "H1"
  - "H4"
signals:
  - name: "wave5_breakout"
    description: "H4 Wave 3 complete, breakout above 1.0800 with Alligator mouth opening and AO momentum"
    jgtml_components:
      - fractal_analysis: "jgtpy.fractal_detection"
      - alligator_state: "TideAlligatorAnalysis.mouth_opening"
      - momentum: "jgtpy.ao_acceleration"
      - wave_count: "manual_wave_3_complete"

4. From Spec to Campaign

Once generated, the spec can be parsed by IntentSpecParser, fed into FDBScan or other agents, and turned into entry scripts. The LLM should ensure the YAML remains minimal and only includes details the trader confirms.


This document is a living reference for building the translator agent that converts human trading insights into executable JGTML specifications.

STATE: Just a first draft of what could happen, may change a lot in the future.

APPENDIX

More Sample from the prototype in ../src AgenticTraderIntent Chat JGTMLSpec2

Sample 1

🎤 Trader Intent

On the H4 chart of EUR/USD I see a completed Wave 3 and expect a Wave 4 pullback. The Alligator is opening and the AO shows strong momentum. I'll look for a breakout above 1.0800 with confluence on H1. My main strategy is trend following for a Wave 5.

🧠 LLM Translation Engine

Generated JGTML Spec (JSON):
{
  "strategy_intent": "Trend following for Wave 5",
  "instruments": [
    "EUR/USD"
  ],
  "timeframes": [
    "H4",
    "H1"
  ],
  "signals": [
    {
      "name": "Wave5_Breakout_Entry",
      "description": "On H4, completed Wave 3 and expecting Wave 4 pullback. Alligator is opening and AO shows strong momentum. Look for breakout above 1.0800 with H1 confluence for Wave 5 entry.",
      "jgtml_components": [
        {
          "wave_count": "manual_wave_3_complete"
        },
        {
          "alligator_state": "AlligatorAnalysis.mouth_opening"
        },
        {
          "momentum": "jgtpy.ao_acceleration"
        },
        {
          "price_level_breakout": "1.0800_above"
        },
        {
          "timeframe_confluence": "H1"
        }
      ]
    }
  ]
}

🟩 IntentSpecParser (Interpreter)

📜 IntentSpecParser
Simulated Signal Package Preview:

Details: JGTML spec successfully received and validated (simulation). Ready for signal processing.

Simulated Signal Package Preview:

{
  "strategy": "Trend following for Wave 5",
  "instruments": [
    "EUR/USD"
  ],
  "timeframes": [
    "H4",
    "H1"
  ],
  "signalCount": 1,
  "firstSignalName": "Wave5_Breakout_Entry",
  "uniqueComponents": "wave_count, alligator_state, momentum, price_level_breakout, timeframe_confluence"
}

🟦 JGTML Execution Core

Agents scaffolded that as:

This step is typically executed on a backend server or local Python environment using the JGTML library.

📦 CampaignLauncher

Materializes validated signal into an executable campaign script or API action

The final signal package is used to generate an executable script for trade entry, potentially integrating with exchange APIs or trading platforms.

jgtml.fdbscan bash samples

####### Contents

####### Samples

cat rjgt/CAD-JPY_m5_250605130658.sh

### --- COPY FROM HERE --- 
demo_arg="--real" #demo_arg="--demo"
# FDB Buy Entry CAD/JPY m5 - bts/now:2025-06-05 17:05/2025-06-05 17:06:58
risk_in_pips=10.4
instrument="CAD/JPY";timeframe="m5";bs="B"
tlid_id=250605130658;lots=1
entry_rate=105.112;stop_rate=105.012
jgtnewsession $tlid_id $instrument $timeframe $entry_rate $stop_rate $bs $lots $demo_arg
fade2=0;squat2=0;b4zlc2=8;fade1=0;squat1=0;b4zlc1=61;zone=S-B-S-N-B-S-S
### ---- COPY TO HERE ---

cat rjgt/SPX500_m5_250605130601.sh

### --- COPY FROM HERE --- 
demo_arg="--real" #demo_arg="--demo"
# FDB Buy Entry SPX500 m5 - bts/now:2025-06-05 17:05/2025-06-05 17:06:01
risk_in_pips=103.4
instrument="SPX500";timeframe="m5";bs="B"
tlid_id=250605130601;lots=1
entry_rate=5963.88;stop_rate=5953.58
jgtnewsession $tlid_id $instrument $timeframe $entry_rate $stop_rate $bs $lots $demo_arg
fade2=0;squat2=0;b4zlc2=0;fade1=0;squat1=1;b4zlc1=7;zone=S-B-N-N-B-S-S
### ---- COPY TO HERE ---
RESULTS from running bash above from 📦 CampaignLauncher

🗃️ Trading Echo Lattice (Memory Crystallization)

Records outcome + feedback to memory crystal

Outcomes, market conditions, and any manual feedback are stored. This data refines future LLM translations and strategy adaptations, completing the Echo Spiral.