### JSON Configuration Structure Example Source: https://context7_llms Provides an example of the JSON structure for configuration settings, including lists of columns to remove and pattern definitions. ```json { "columns_to_remove": ["aocolor", "accolor"], "patterns": { "mz": { "columns": ["mfi_sig", "zone_sig", "ao"] } }, "ttf_columns_to_remove": [], "default_quotescount": 335 } ``` -------------------------------- ### CLI Usage Examples (Bash) Source: https://context7_llms Provides examples of how to use the `fdbscan` command-line interface for scanning financial instruments and timeframes. Demonstrates single and multiple instrument/timeframe scanning, cache control, verbose output, demo/real trading modes, and environment variable usage. ```bash # Scan single instrument/timeframe fdbscan -i EUR/USD -t H4 # Scan multiple instruments fdbscan -i "EUR/USD,SPX500,XAU/USD" -t "H1,H4,D1" # Force fresh data (ignore cache) fdbscan -i EUR/USD -t H4 --no-cache # Verbose output fdbscan -i EUR/USD -t H4 -v -v -v # Demo mode (default) fdbscan -i EUR/USD -t H4 --demo # Real trading mode fdbscan -i EUR/USD -t H4 --real # Using environment variables INSTRUMENTS="EUR/USD,GBP/USD" TIMEFRAMES="H1,H4" LOTS=0.1 fdbscan ``` -------------------------------- ### tfw/wtf CLI: Desired Outcome Example Source: https://context7_llms Provides an example of how to use the `tfw` (or `wtf`) CLI command to schedule a script execution. This example demonstrates waiting for an H1 bar to close before executing a shell script. ```bash tfw -t H1 -S /path/to/refresh.sh ``` -------------------------------- ### FDB Scan CLI Command Example Source: https://context7_llms An example command to run the FDB scanner, specifying instruments and timeframes to scan for trading signals. ```bash fdbscan -i "EUR/USD,GBP/USD,SPX500" -t "H1,H4" ``` -------------------------------- ### Default Patterns Configuration (Python) Source: https://context7_llms Provides a dictionary of common, suggested patterns for initial setup. Each pattern maps a name (e.g., 'mz', 'ttf') to a list of column names. ```python # Common patterns (suggested for setup) patterns = { "mz": ["jaw", "teeth", "lips", "ao", "ac"], "ttf": ["jaw", "teeth", "lips", "ao", "ac", "aocolor", "accolor"], "alligator_all": ["jaw", "teeth", "lips", "bjaw", "bteeth", "blips", "tjaw", "tteeth", "tlips"], "signals": ["fdb", "fdbb", "fdbs", "zlcB", "zlcS", "bz", "sz"] } ``` -------------------------------- ### Example of Adding an FX Order via jgtapp Source: https://context7_llms Shows how to use the jgtapp CLI to add a foreign exchange order, including parameters for instrument, quantity, rate, direction, stop loss, and demo mode. ```bash jgtapp fxaddorder -i EUR/USD -n 1 -r 1.0950 -d B -x 1.0900 --demo ``` -------------------------------- ### Usage Pattern Example (Python) Source: https://context7_llms Demonstrates how to use the defined JGT constants within a Python script, specifically for accessing DataFrame columns and checking trading conditions. This example shows practical application of the constants. ```python from jgtutils.jgtconstants import ( HIGH, LOW, CLOSE, OPEN, JAW, TEETH, LIPS, BJAW, BTEETH, BLIPS, FDB, FDBB, FDBS, AO, AC, ZLC ) # Use constants for column access entry_price = df[HIGH].iloc[-1] is_buy_signal = df[FDBB].iloc[-1] == 1 alligator_direction = df[LIPS].iloc[-1] < df[TEETH].iloc[-1] ``` -------------------------------- ### PatternAnalyzer Usage Example (Python) Source: https://context7_llms Demonstrates how to initialize and use the PatternAnalyzer class to analyze correlations across a directory of CDS files. It prints the total number of datasets analyzed and the top 5 positive correlations found. ```python from jgt_insight.correlations import PatternAnalyzer # Initialize analyzer = PatternAnalyzer(min_appearances=3) # Analyze all CDS files report = analyzer.analyze_directory("/b/trading/jgtml/data/current/cds") print(f"Analyzed {report.dataset_count} datasets") print("\nTop Positive Correlations:") for feat in report.top_positive[:5]: print(f" {feat.feature}: {feat.correlation:.3f} ({feat.appearances} datasets)") ``` -------------------------------- ### Get Universe View and Perspective using MCP Client Source: https://jgtsrc.jgwill.com/jgt-data-server/rispecs/app.specs Demonstrates how to use the MCP client to retrieve universe-specific data views and a comprehensive perspective for a given instrument. Requires an initialized MCP client instance. ```typescript const signalView = await mcpClient.call('get_universe_view', { instrument: 'EUR/USD', universe: 'signal_detection' }); const perspective = await mcpClient.call('get_perspective', { instrument: 'EUR/USD', universe: 'all' }); ``` -------------------------------- ### Core Package Configuration Functions (Python) Source: https://context7_llms Provides essential configuration and environment setup functions for the JGT core package. These functions are crucial for initializing the trading ecosystem. ```python def get_config(): # Implementation for getting configuration pass def get_settings(): # Implementation for getting settings pass def setup_environment(): # Implementation for setting up the environment pass ``` -------------------------------- ### Signal Detection Suggested Flows (TypeScript) Source: https://context7_llms Provides example suggested action flows for different intents within the signal detection universe. These flows are represented as arrays of strings, outlining sequential steps for trading actions based on detected patterns. ```typescript const WILLIAMS_FLOWS = { fractal_breakout: [ 'check_alligator_state', 'validate_fractal_position', 'check_zone_confluence', 'calculate_entry_stop', 'place_stop_order' ], momentum_saucer: [ 'check_ao_position', 'validate_saucer_pattern', 'check_ac_alignment', 'validate_entry' ], // ... more flows }; ``` -------------------------------- ### Window Configuration - Python Source: https://context7_llms This Python code sets the minimum and maximum look-ahead window for calculating trade profitability. WINDOW_MIN defines the starting bar after a signal, and WINDOW_MAX sets the furthest bar to consider for zero-line crosses or other target calculations. ```python WINDOW_MIN = 1 # Start looking 1 bar after signal WINDOW_MAX = 150 # Look up to 150 bars forward # The window determines how far forward we look # to calculate if the trade would have been profitable ``` -------------------------------- ### Downstream Usage: Create MX Dataset (Python) Source: https://context7_llms Demonstrates how the generated MLF is consumed by the MX (ML Matrix) system. It shows an example of calling `create_mx_dataset` to generate an ML-ready dataset for a specific instrument, timeframe, and target column. ```python # MLF is consumed by MX for final ML matrix: from jgtml.mxcli import create_mx_dataset mx_df = create_mx_dataset( "EUR/USD", "H1", patternname="mz", target_column="fdb" ) ``` -------------------------------- ### Python CLI Argument Parsing Setup Source: https://context7_llms Defines functions for setting up and customizing command-line argument parsers using the `argparse` module. It includes utilities for adding common arguments like instrument, timeframe, fresh data, and verbosity. ```python def new_parser( description: str, epilog: str = "", prog_name: str = "", add_exiting_quietly_flag: bool = False ) -> argparse.ArgumentParser: """Create new argument parser with JGT defaults.""" def add_instrument_timeframe_arguments( parser: argparse.ArgumentParser ) -> argparse.ArgumentParser: """Add -i and -t arguments.""" def add_use_fresh_argument( parser: argparse.ArgumentParser ) -> argparse.ArgumentParser: """Add --fresh argument.""" def add_verbose_argument( parser: argparse.ArgumentParser ) -> argparse.ArgumentParser: """Add -v/--verbose argument.""" def parse_args( parser: argparse.ArgumentParser ) -> argparse.Namespace: """Parse arguments with JGT defaults applied.""" ``` -------------------------------- ### Get Pip Size for Instrument Source: https://context7_llms Retrieves the pip size for a given financial instrument. This is crucial for accurate price calculations and risk management. Examples include 'EUR/USD' -> 0.0001 and 'USD/JPY' -> 0.01. ```python # From iprops module def get_pips(instrument: str) -> float: """ Get pip size for instrument. Examples: "EUR/USD" -> 0.0001 "USD/JPY" -> 0.01 "SPX500" -> 1.0 """ ``` -------------------------------- ### Alligator Analysis Specification - Desired Outcome Source: https://context7_llms Defines the desired outcome for the Alligator Analysis specification. Users should be able to generate comprehensive analysis across three period scales (Regular, Big, Tide) to identify market structure and convergence for high-probability trading setups. The example command shows how to achieve this for the SPX500 instrument on a daily timeframe. ```python # Achievement Indicator: Running `python -m jgtml.alligator_cli -i SPX500 -t D1 --type all` produces: # - Regular Alligator (5-8-13) state analysis # - Big Alligator (34-55-89) intermediate cycle analysis # - Tide Alligator (144-233-377) macro trend analysis # - Convergence score showing alignment across all three ``` -------------------------------- ### Initialize Regime Detector and Load Data Source: https://context7_llms Demonstrates the basic usage of the RegimeDetector class. It shows how to initialize the detector with a custom ADX threshold and how to load historical price data from a CSV file. ```python from jgt_insight.regime import RegimeDetector import pandas as pd # Initialize detector = RegimeDetector(adx_threshold=25) # Load data df = pd.read_csv("EUR-USD_D1.csv") ``` -------------------------------- ### Configuration File Structure Source: https://context7_llms Illustrates the directory structure and file types used for configuration, including main settings, pattern-specific settings, and optional YAML configurations. ```text ~/.jgt/ ├── config.json # Main configuration ├── config.yaml # YAML alternative (optional) ├── patterns/ │ ├── mz.json # Pattern: mz columns │ └── full.json # Pattern: full columns └── secrets.json # API tokens (not committed) ``` -------------------------------- ### Creating an FX Entry Order Request (Python) Source: https://context7_llms Demonstrates how to construct an order request object for creating an entry order using the fxcorepy library. It specifies the order type, offer ID, account ID, buy/sell direction, entry rate, stop loss rate, and the calculated amount in units. ```python # Entry order type entry = fxcorepy.Constants.Orders.ENTRY # Order request parameters request = fx.create_order_request( order_type=entry, OFFER_ID=offer.offer_id, # Instrument offer ACCOUNT_ID=str_account, # Trading account BUY_SELL=str_buy_sell, # "B" or "S" RATE=str_rate, # Entry price RATE_STOP=str_stop, # Stop loss price AMOUNT=amount, # Position size (units) ) ``` -------------------------------- ### GET /api/v1/scheduler/status Source: https://context7_llms Retrieves the current status of the scheduler. ```APIDOC ## GET /api/v1/scheduler/status ### Description Retrieves the current status of the scheduler. ### Method GET ### Endpoint `/api/v1/scheduler/status` ### Response #### Success Response (200) - **status** (string) - The current status of the scheduler (e.g., "running", "idle", "paused"). - **nextRun** (string) - The timestamp of the next scheduled run, if applicable. #### Response Example ```json { "status": "running", "nextRun": "2023-10-27T12:00:00Z" } ``` ``` -------------------------------- ### Create Entry Order (fxaddorder) - Python Source: https://context7_llms Creates an entry stop order on the broker. It wraps the fxaddorder CLI from jgtfxcon and requires parameters such as instrument, lot size, entry rate, buy/sell direction, and stop loss price. Optional flags allow for using a demo account or interpreting the stop loss as a pip distance. ```python def fxaddorder( instrument: str, lots: str, rate: str, buysell: str, stop: str, demo: bool = False, flag_pips: bool = False ) -> None: """ Create entry stop order on broker. Wraps: fxaddorder CLI from jgtfxcon Args: instrument: Trading pair (EUR/USD) lots: Position size in lots rate: Entry price buysell: Direction (B/S) stop: Stop loss price (or pips if flag_pips) demo: Use demo account flag_pips: Interpret stop as pips distance """ pass ``` -------------------------------- ### GET /api/v1/perspective/{instrument} Source: https://context7_llms Retrieves the universe perspective for a specified instrument. ```APIDOC ## GET /api/v1/perspective/{instrument} ### Description Retrieves the universe perspective for a specified instrument. ### Method GET ### Endpoint `/api/v1/perspective/{instrument}` ### Parameters #### Path Parameters - **instrument** (string) - Required - The financial instrument symbol ### Response #### Success Response (200) - **perspective** (object) - Details about the universe perspective #### Response Example ```json { "instrument": "BTCUSD", "perspective": { "trend": "bullish", "volatility": "high", "sentiment": "positive" } } ``` ``` -------------------------------- ### GET /api/v1/alligator/alignment/{instrument} Source: https://context7_llms Retrieves the HTF Alligator alignment for a specified instrument. ```APIDOC ## GET /api/v1/alligator/alignment/{instrument} ### Description Retrieves the HTF Alligator alignment for a specified instrument. ### Method GET ### Endpoint `/api/v1/alligator/alignment/{instrument}` ### Parameters #### Path Parameters - **instrument** (string) - Required - The financial instrument symbol ### Response #### Success Response (200) - **alignment** (string) - The HTF Alligator alignment status (e.g., "aligned", "not_aligned") #### Response Example ```json { "instrument": "BTCUSD", "alignment": "aligned" } ``` ``` -------------------------------- ### GET /api/v1/williams/dimensions/{instrument}/{timeframe} Source: https://context7_llms Retrieves the Williams 5 dimensions for a given instrument and timeframe. ```APIDOC ## GET /api/v1/williams/dimensions/{instrument}/{timeframe} ### Description Retrieves the Williams 5 dimensions for a given instrument and timeframe. ### Method GET ### Endpoint `/api/v1/williams/dimensions/{instrument}/{timeframe}` ### Parameters #### Path Parameters - **instrument** (string) - Required - The financial instrument symbol - **timeframe** (string) - Required - The timeframe for the data (e.g., 1m, 5m, 1h, 1d) ### Response #### Success Response (200) - **fractal** (object) - Fractal indicator details - **ao** (object) - Awesome Oscillator indicator details - **ac** (object) - Accelerator/Decelerator indicator details - **zone** (object) - Zone indicator details - **balanceLine** (object) - Balance Line indicator details #### Response Example ```json { "instrument": "BTCUSD", "timeframe": "1h", "timestamp": "2023-10-27T10:00:00Z", "fractal": { "upFractal": false, "downFractal": false, "barsFromUpFractal": 5, "barsFromDownFractal": 8, "fdb": null, "outsideTeeth": false }, "ao": { "value": 0.0012, "color": "green", "aboveZero": true, "saucerPattern": false, "twinPeaks": false, "zeroCross": null }, "ac": { "value": 0.0003, "color": "green", "aboveZero": true, "consecutiveGreen": 2, "consecutiveRed": 0 }, "zone": { "state": "green", "consecutiveBars": 3, "pyramidReady": false }, "balanceLine": { "mouthOpen": true, "direction": "up", "priceAboveJaw": true, "priceAboveTeeth": true, "priceAboveLips": true } } ``` ``` -------------------------------- ### CLI for Creating FX Entry Stop Orders (Python) Source: https://context7_llms Defines the command-line interface for the JGT FX Create Entry Stop Order tool. It specifies arguments for demo/real accounts, instrument, buy/sell direction, entry rate, stop loss rate, and position size in lots. Includes examples for creating buy and sell entry orders for both demo and real accounts. ```python def main(): """ JGT FX Create Entry Stop Order CLI. Arguments: --demo: Use demo account (vs real) -i, --instrument: Instrument symbol (required) -bs: Buy/Sell direction - "B" or "S" (required) -rate: Entry rate (required) -stop: Stop loss rate (required) -lots: Position size in lots (required) Examples: # Create buy entry order (demo) fxaddorder --demo -i EUR/USD -bs B -rate 1.0950 -stop 1.0900 -lots 1 # Create sell entry order (demo) fxaddorder --demo -i EUR/USD -bs S -rate 1.0850 -stop 1.0900 -lots 2 # Real account order fxaddorder -i GBP/USD -bs B -rate 1.2500 -stop 1.2450 -lots 0.5 """ ``` -------------------------------- ### jgt-data-server REST API Endpoints Source: https://context7_llms This section outlines the available endpoints for the jgt-data-server REST API, including their methods, descriptions, and example usage. ```APIDOC ## GET /api/v1/health ### Description Performs a health check on the jgt-data-server. ### Method GET ### Endpoint /api/v1/health ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates the health status of the server. #### Response Example ```json { "status": "OK" } ``` --- ## GET /api/v1/pds/{instrument}/{timeframe} ### Description Retrieves raw price data (PDS) for a given instrument and timeframe. ### Method GET ### Endpoint /api/v1/pds/{instrument}/{timeframe} ### Parameters #### Path Parameters - **instrument** (string) - Required - The trading instrument (e.g., EURUSD). - **timeframe** (string) - Required - The timeframe for the data (e.g., H1, D1). ### Request Example None ### Response #### Success Response (200) - **data** (array) - Array of price data objects, each containing Date, Open, High, Low, Close, Volume. #### Response Example ```json { "data": [ { "Date": "2023-10-27T00:00:00Z", "Open": 1.06500, "High": 1.06600, "Low": 1.06400, "Close": 1.06550, "Volume": 1000 } ] } ``` --- ## GET /api/v1/cds/{instrument}/{timeframe} ### Description Retrieves signal data (CDS) for a given instrument and timeframe. ### Method GET ### Endpoint /api/v1/cds/{instrument}/{timeframe} ### Parameters #### Path Parameters - **instrument** (string) - Required - The trading instrument (e.g., EURUSD). - **timeframe** (string) - Required - The timeframe for the data (e.g., H1, D1). ### Request Example None ### Response #### Success Response (200) - **data** (array) - Array of signal data objects, including fdb, fdbb, fdbs, zlcB, zlcS, bz, sz, sb, ss. #### Response Example ```json { "data": [ { "Date": "2023-10-27T00:00:00Z", "fdb": 1, "fdbb": 0, "fdbs": 1, "zlcB": 0, "zlcS": 0, "bz": 1, "sz": 0, "sb": 1, "ss": 0 } ] } ``` --- ## GET /api/v1/williams/dimensions/{instrument}/{tf} ### Description Retrieves all 5 dimensions of Williams' indicators for a given instrument and timeframe. ### Method GET ### Endpoint /api/v1/williams/dimensions/{instrument}/{tf} ### Parameters #### Path Parameters - **instrument** (string) - Required - The trading instrument (e.g., EURUSD). - **tf** (string) - Required - The timeframe for the data (e.g., H1, D1). ### Request Example None ### Response #### Success Response (200) - **data** (object) - An object containing various Williams' indicator dimensions. #### Response Example ```json { "data": { "jaw": [1.06500, 1.06550], "teeth": [1.06400, 1.06500], "lips": [1.06300, 1.06450], "ao": [0.00050, 0.00060], "ac": [0.00040, 0.00055], "fh": [1.06700], "fl": [1.06200], "mfi": [55.5] } } ``` --- ## GET /api/v1/williams/alligator/{instrument}/{tf} ### Description Retrieves the Balance Line (Alligator) indicator data for a given instrument and timeframe. ### Method GET ### Endpoint /api/v1/williams/alligator/{instrument}/{tf} ### Parameters #### Path Parameters - **instrument** (string) - Required - The trading instrument (e.g., EURUSD). - **tf** (string) - Required - The timeframe for the data (e.g., H1, D1). ### Request Example None ### Response #### Success Response (200) - **data** (object) - An object containing the jaw, teeth, and lips components of the Alligator indicator. #### Response Example ```json { "data": { "jaw": [1.06500, 1.06550], "teeth": [1.06400, 1.06500], "lips": [1.06300, 1.06450] } } ``` --- ## GET /api/v1/williams/ao/{instrument}/{tf} ### Description Retrieves the Awesome Oscillator (AO) indicator data for a given instrument and timeframe. ### Method GET ### Endpoint /api/v1/williams/ao/{instrument}/{tf} ### Parameters #### Path Parameters - **instrument** (string) - Required - The trading instrument (e.g., EURUSD). - **tf** (string) - Required - The timeframe for the data (e.g., H1, D1). ### Request Example None ### Response #### Success Response (200) - **data** (object) - An object containing the AO and AC components of the Awesome Oscillator. #### Response Example ```json { "data": { "ao": [0.00050, 0.00060], "ac": [0.00040, 0.00055] } } ``` --- ## GET /api/v1/williams/zones/{instrument}/{tf} ### Description Retrieves zone analysis data for a given instrument and timeframe. ### Method GET ### Endpoint /api/v1/williams/zones/{instrument}/{tf} ### Parameters #### Path Parameters - **instrument** (string) - Required - The trading instrument (e.g., EURUSD). - **tf** (string) - Required - The timeframe for the data (e.g., H1, D1). ### Request Example None ### Response #### Success Response (200) - **data** (object) - An object containing zone analysis data, potentially including fractal high (fh) and fractal low (fl). #### Response Example ```json { "data": { "fh": [1.06700], "fl": [1.06200] } } ``` --- ## GET /api/v1/perspective/{instrument} ### Description Retrieves the overall perspective for a given instrument across different universes. ### Method GET ### Endpoint /api/v1/perspective/{instrument} ### Parameters #### Path Parameters - **instrument** (string) - Required - The trading instrument (e.g., EURUSD). ### Request Example None ### Response #### Success Response (200) - **data** (object) - An object detailing the perspective from different universes (Signal Detection, Wave Analysis, Coordination). #### Response Example ```json { "data": { "signal_detection": { "fdb_signal": true, "zone_confluence": "High", "fractal_confirmation": "Up" }, "wave_analysis": { "htf_alligator_aligned": true, "current_wave_position": "Impulse 3", "trend_strength": "Strong" }, "coordination": { "risk_reward_ratio": 2.5, "stop_loss_level": 1.06350, "trading_plan_fit": "Good" } } } ``` --- ## POST /api/v1/refresh ### Description Triggers a data refresh for the jgt-data-server. ### Method POST ### Endpoint /api/v1/refresh ### Parameters None ### Request Example None ### Response #### Success Response (200) - **message** (string) - Confirmation message that the refresh has been initiated. #### Response Example ```json { "message": "Data refresh initiated successfully." } ``` ``` -------------------------------- ### Get JGT Code Configuration Path Source: https://context7_llms This command displays the file path to the JGT Code configuration file. The configuration is typically stored at `~/.jgt-code/config.json`. ```bash # Display the path to the configuration file ./jgt-code where-config ``` -------------------------------- ### Order Creation Flow Logic (Python) Source: https://context7_llms Outlines the step-by-step process for creating an FX order. It covers argument parsing, validation, credential retrieval, ForexConnect connection, account and offer retrieval, amount calculation, order request creation, order monitoring setup, request sending, confirmation waiting, and final logout. ```python def main(): """ Main entry point. Flow: 1. Parse arguments 2. Validate stop level provided 3. Read broker credentials from config 4. Connect to ForexConnect 5. Get account (demo or real) 6. Get offer for instrument 7. Calculate amount from lots × base_unit_size 8. Create ENTRY order request with: - OFFER_ID - ACCOUNT_ID - BUY_SELL - RATE (entry) - RATE_STOP (stop loss) - AMOUNT 9. Set up OrdersMonitor listener 10. Send request 11. Wait for order confirmation 12. Print order details 13. Logout """ ``` -------------------------------- ### GET /api/v1/{type}/{instrument}/{timeframe} Source: https://context7_llms Retrieves market data for a specified instrument and timeframe. Supported types include pds, cds, ttf, and mlf. ```APIDOC ## GET /api/v1/{type}/{instrument}/{timeframe} ### Description Retrieves market data for a specified instrument and timeframe. Supported types include pds, cds, ttf, and mlf. ### Method GET ### Endpoint `/api/v1/{type}/{instrument}/{timeframe}` ### Parameters #### Path Parameters - **type** (string) - Required - Type of market data (e.g., pds, cds, ttf, mlf) - **instrument** (string) - Required - The financial instrument symbol - **timeframe** (string) - Required - The timeframe for the data (e.g., 1m, 5m, 1h, 1d) ### Response #### Success Response (200) - **data** (object) - Market data details - **timestamp** (string) - The timestamp of the data #### Response Example ```json { "data": { "open": 100.50, "high": 101.20, "low": 99.80, "close": 100.90, "volume": 10000 }, "timestamp": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Example Output of Added Order (Text) Source: https://context7_llms Shows a sample output message confirming that a stop order has been added. It includes details such as the entry rate, stop rate, account ID, order ID, type, buy/sell direction, rate, and time in force. ```text Adding a stop to an entry order with entry rate: 1.09500, stop: 1.09000 AccountID='12345678' The order has been added. OrderID=456789, Type=SE, BuySell=B, Rate=1.09500, TimeInForce=GTC ``` -------------------------------- ### Agent Package Terminal UI (Python) Source: https://context7_llms Provides a terminal user interface for agents, facilitating Three-Universe Processing and guiding traders through the Medicine Wheel phases. ```python # Core functionalities for the agent terminal UI # Three-Universe Processing # Medicine Wheel navigation ``` -------------------------------- ### Load Home Settings (Python) Source: https://context7_llms Loads user settings from the `~/.jgt/settings.json` file. If the file does not exist, it returns an empty structure with an empty 'patterns' dictionary. This function is crucial for retrieving existing configuration. ```python def load_home_settings() -> Dict[str, Any]: """ Load settings from ~/.jgt/settings.json. Returns empty structure if file doesn't exist: {"patterns": {}} """ pass ``` -------------------------------- ### Example of FDB Signal Output Source: https://context7_llms Demonstrates the output format for a validated FDB buy signal, including scanning status, instrument, timeframe, and execution script path. ```text a=Scanning;i=EUR/USD;t=H4;vtlid=2601311400 # FDB Buy Entry EUR/USD H4 risk_in_pips=25.5 . rjgt/EUR-USD_H4_260131140500.sh ``` -------------------------------- ### Select Lead Universe Based on Confidence (TypeScript) Source: https://context7_llms Demonstrates how to select the 'lead' trading universe from a set of perspectives (signal, wave, coordination) based on which has the highest confidence score. This uses the `reduce` method to iterate and compare confidence levels. ```typescript const lead = [signalDetection, waveAnalysis, coordination] .reduce((a, b) => a.confidence > b.confidence ? a : b); ``` -------------------------------- ### Get Decimal Precision for Instrument Prices Source: https://context7_llms Retrieves the number of decimal places required for representing prices accurately for a specific financial instrument. This is essential for display and trading logic. ```python def get_precision(instrument: str) -> int: # Get decimal precision for prices. """ Get decimal precision for prices. """ ``` -------------------------------- ### CDS CLI Entry Point Source: https://context7_llms The `main` function in `cdscli.py` serves as the command-line interface entry point for the CDS tool. It parses arguments for instrument, timeframe, data freshness, indicator inclusion (MFI, Gator, Alligators), and output options. Examples demonstrate various ways to invoke the CLI for different CDS generation scenarios. ```python # jgtpy/cdscli.py def main(): """ CDS CLI Entry Point. Arguments: -i, --instrument: Instrument symbol (required) -t, --timeframe: Timeframe (required) --fresh: Force fresh data fetch --full: Use full historical data -n, --quotescount: Number of bars --mfi: Include MFI indicator (default: True) --gator: Include Gator Oscillator --balligator: Include Big Alligator (89) --talligator: Include Tide Alligator (377) --mouth-water: Include Mouth Water analysis --largest-fractal-period: Fractal lookback period --viewpath: Show output path only --dropna-volume: Drop zero-volume bars --ads: Show chart after generation Examples: # Default CDS generation cdscli -i EUR/USD -t H1 # Multiple instruments/timeframes cdscli -i EUR/USD,GBP/USD -t H1,H4 # Include all Alligators cdscli -i SPX500 -t D1 --balligator --talligator # Fresh data with chart display cdscli -i GBPUSD -t H4 --fresh --ads """ pass ``` -------------------------------- ### Get Price History (getPH) Source: https://context7_llms Retrieves historical OHLCV price data for a specified instrument and timeframe. It first checks the cache and then fetches fresh data from the broker if necessary. ```APIDOC ## GET /api/pds/pricehistory ### Description Retrieves historical OHLCV price data for a specified instrument and timeframe. This function abstracts the complexities of fetching data from broker APIs or reading from a local cache, providing a clean and consistent DataFrame output. ### Method GET ### Endpoint /api/pds/pricehistory ### Parameters #### Query Parameters - **instrument** (string) - Required - The trading instrument symbol (e.g., "EUR/USD", "SPX500"). - **timeframe** (string) - Required - The period for the price data (e.g., "m1", "H1", "D1"). - **quotes_count** (integer) - Optional - The number of historical data points (bars) to fetch. Defaults to -1 (all available). - **date_from** (datetime) - Optional - The start date for the data range. - **date_to** (datetime) - Optional - The end date for the data range. - **compressed** (boolean) - Optional - If true, reads/writes data in gzip format. Defaults to false. - **quiet** (boolean) - Optional - If true, suppresses output messages. Defaults to true. - **keep_bid_ask** (boolean) - Optional - If true, preserves Bid/Ask columns in the output. Defaults to true. ### Response #### Success Response (200) - **DataFrame** (pandas.DataFrame) - A DataFrame with a Date index and OHLCV columns (Open, High, Low, Close, Volume). Optionally includes Bid/Ask columns if `keep_bid_ask` is true. #### Response Example ```json { "Date": "2023-10-27T10:00:00Z", "Open": 1.07500, "High": 1.07550, "Low": 1.07450, "Close": 1.07520, "Volume": 1000, "BidOpen": 1.07490, "BidHigh": 1.07540, "BidLow": 1.07440, "BidClose": 1.07510, "AskOpen": 1.07510, "AskHigh": 1.07560, "AskLow": 1.07460, "AskClose": 1.07530 } ``` ``` -------------------------------- ### Format Settings as YAML Source: https://context7_llms Returns settings as a formatted YAML string. It can optionally filter the output to include only specified keys. ```python def dump_as_yaml_output( _settings: dict = None, keys: List[str] = None, custom_path: str = None ) -> str: """Return settings as formatted YAML string.""" ``` -------------------------------- ### JGT-Insight Entry Point Script Source: https://context7_llms Specifies the entry point for the JGT-Insight command-line tool in the pyproject.toml file. This configuration allows the tool to be installed and run directly from the command line. ```toml # pyproject.toml [project.scripts] jgt-insight = "jgt_insight.cli:cli" ```