{"product_id":"japanese-yen-6j-ema-momentum-bot-python-70-5-backtest","title":"Japanese Yen 6J EMA Momentum Bot -- Python +70.5% Backtest","description":"\u003cp\u003e * +70.52% backtested return across 83 trades on CME 6J\u003cbr\u003e    * EMA(8\/21) momentum crossover with composite 3-factor score\u003cbr\u003e    * Dynamic ATR stop-loss (trailing) + dynamic R:R (1.2-2.8)\u003cbr\u003e    * 15% max-drawdown circuit-breaker baked in\u003cbr\u003e    * Phase 2.5 calibration (60m signal \/ 5m execution) pre-applied\u003cbr\u003e    * Python 3.10+ standard library only -- zero extra dependencies\u003cbr\u003e    * 10+ labelled BROKER INTEGRATION: placeholders throughout\u003cbr\u003e    * Works with IBKR, Alpaca, Tradier, NinjaTrader, and more\u003cbr\u003e    * 479 lines, fully commented -- readable, not obfuscated\u003cbr\u003e    * Educational use: study a real production-grade algo line by line\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003eJAPANESE YEN FUTURES EMA MOMENTUM BOT  |  CME 6J  |  LONG  |  +70.5% BACKTEST\u003c\/p\u003e\n\u003cp\u003eWhat if you could skip the months of research, indicator math, and infrastructure\u003cbr\u003edebugging -- and start with a complete, documented, production-style Python\u003cbr\u003ealgorithmic trading bot ready to connect to your own broker?\u003c\/p\u003e\n\u003cp\u003eThis listing gives you exactly that: the full source code for an EMA-crossover\u003cbr\u003emomentum strategy targeting CME Japanese Yen Futures (6J), built and run live\u003cbr\u003eon September 14, 2026. Every design decision is commented. Every risk control\u003cbr\u003eis explained. Every broker dependency has been cleanly extracted and replaced\u003cbr\u003ewith a labelled placeholder so you can wire in your own execution layer.\u003c\/p\u003e\n\u003cp\u003e  Bot ID   : bar_6j_long_20260914_142933\u003cbr\u003e  Created  : September 14, 2026 at 14:29:33 UTC\u003cbr\u003e  Includes : Gen1 portable Python script (479 lines, fully commented)\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003e================================================================================\u003cbr\u003eBACKTESTED PERFORMANCE\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003e  Instrument            CME Japanese Yen Futures (6J), front-month\u003cbr\u003e  Direction             LONG only\u003cbr\u003e  Backtest type         Bar-data simulation (historical OHLCV bars)\u003cbr\u003e  Signal timeframe      60-minute bars  (Phase 2.5 calibration)\u003cbr\u003e  Execution timeframe   5-minute bars   (Phase 2.5 calibration)\u003cbr\u003e  -----------------------------------------------------------------\u003cbr\u003e  Total Trades          83\u003cbr\u003e  Win Rate              25.3%  (see FAQ -- by design, not a defect)\u003cbr\u003e  Profit Factor         1.616\u003cbr\u003e  Total Return          +70.52%\u003cbr\u003e  Max Drawdown (raw)    34.5%\u003cbr\u003e  -----------------------------------------------------------------\u003cbr\u003e  Live Circuit Breaker  15.0% max drawdown hard-cap (session reset)\u003cbr\u003e  AI Profit Probability 45%  (forward estimate at creation, not a guarantee)\u003c\/p\u003e\n\u003cp\u003eIMPORTANT DISCLOSURE: This bot does NOT appear in the profitable_bots_ranking\u003cbr\u003edatabase, which tracks only live-traded or rolling-forward-tested strategies.\u003cbr\u003eThe backtest above was performed solely on historical bar data -- past\u003cbr\u003eperformance does NOT predict future results. Always use the 15% drawdown\u003cbr\u003ecircuit-breaker and trade with risk capital only.\u003c\/p\u003e\n\u003cp\u003e================================================================================\u003cbr\u003eSTRATEGY DEEP-DIVE\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003eWHY 6J (JAPANESE YEN FUTURES)?\u003cbr\u003eCME 6J is one of the most liquid currency futures, avg daily volume \u0026gt;100k\u003cbr\u003econtracts. At creation: ATR=0.059% of price, trailing return=+4.25%, volume\u003cbr\u003etrend=-2.5%. Regime: mature uptrend with weakening participation -- ideal for\u003cbr\u003easymmetric momentum strategies.\u003c\/p\u003e\n\u003cp\u003eHOW THE ENTRY WORKS  (signal bar -- 60 min)\u003cbr\u003e  1. Warmup gate: requires \u0026gt;= 20 closed signal bars.\u003cbr\u003e  2. Composite momentum score (0-100):\u003cbr\u003e       Trend   (50%): EMA(8) vs EMA(21) gap normalised by ATR(14)\u003cbr\u003e       RSI     (35%): RSI(14) rescaled from 35-70 range to 0-100\u003cbr\u003e       Volume  (15%): EMA5 vs EMA20 of volume (60 if healthy, 40 if not)\u003cbr\u003e  3. Entry gate (all four must pass, relaxed mode -- threshold ~36):\u003cbr\u003e       EMA(8) \u0026gt; EMA(21) AND close \u0026gt;= EMA(8)  [trend aligned]\u003cbr\u003e       Price extension 0.0 - 1.3x ATR above EMA(8)  [mean-reversion filter]\u003cbr\u003e       Volume EMA5 \u0026lt;= EMA20 x 1.1  [volume regime healthy]\u003cbr\u003e       Momentum score \u0026gt;= 36  [composite gate]\u003cbr\u003e  4. On pass: emit pending_signal with anchor price, stop distance, R:R.\u003cbr\u003e     Signal expires after 8 execution bars (~40 minutes).\u003c\/p\u003e\n\u003cp\u003eHOW ENTRY TRIGGERS  (execution bar -- 5 min)\u003cbr\u003e  1. Require pending_signal (not expired).\u003cbr\u003e  2. mid-price \u0026lt;= execution EMA(9) x 1.0015  [pullback filter]\u003cbr\u003e  3. mid-price \u0026lt;= anchor_price x 1.0025      [no excessive chase]\u003cbr\u003e  4. On pass: enter LONG, set ATR stop and R:R target.\u003c\/p\u003e\n\u003cp\u003eDYNAMIC STOP (ATR x multiplier, trailing)\u003cbr\u003e  ATR \u0026lt; 0.04%  -\u0026gt; 2.0x  |  ATR 0.04-0.08% -\u0026gt; 1.8x  |  ATR \u0026gt; 0.08% -\u0026gt; 1.5x\u003cbr\u003e  Phase 2.5 calibration: minimum 5 ticks; multiplier fixed at 2.0.\u003cbr\u003e  Stop ratchets UPWARD as price rises (trailing).\u003c\/p\u003e\n\u003cp\u003eDYNAMIC R:R RATIO  (range 1.2 - 2.8)\u003cbr\u003e  ATR \u0026lt; 0.04% -\u0026gt; R:R 2.3  |  0.04-0.08% -\u0026gt; 2.0  |  \u0026gt; 0.08% -\u0026gt; 1.7\u003cbr\u003e  High momentum (score \u0026gt;= 46): +0.2  |  Low (score \u0026lt; 34): -0.2\u003c\/p\u003e\n\u003cp\u003eFIVE EXIT TYPES  (priority order)\u003cbr\u003e  1. 15% drawdown guard  -- hard halt, force-flat immediately\u003cbr\u003e  2. Trailing protective stop -- ATR ratchet\u003cbr\u003e  3. Soft profit target  -- entry + stop_distance x rr_ratio\u003cbr\u003e  4. 30-bar time stop    -- ~150 minutes on 5m bars\u003cbr\u003e  5. Signal invalidation -- EMA(8) crosses below EMA(21), score \u0026lt; 38\u003c\/p\u003e\n\u003cp\u003e================================================================================\u003cbr\u003eWHAT YOU RECEIVE\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003e  bar_6j_long_20260914_142933_portable.py  (479 lines, broker-agnostic)\u003cbr\u003e  - All Rithmic \/ Redis infrastructure removed; strategy 100% intact\u003cbr\u003e  - Self-contained BaseTradingBot stub; no external dependencies\u003cbr\u003e  - 10+ labelled # BROKER INTEGRATION: placeholder comments\u003cbr\u003e  - Phase 2.5 calibration (60m\/5m) pre-applied at module load\u003cbr\u003e  - Fully commented: every method, parameter, and design decision\u003c\/p\u003e\n\u003cp\u003e  Complete strategy logic preserved:\u003cbr\u003e  EMA(8\/21), RSI(14), ATR(14), composite momentum score,\u003cbr\u003e  dynamic ATR multiplier, dynamic R:R, warmup gate, 15% DD guard,\u003cbr\u003e  signal expiry (8-bar), trailing stop, soft target, time stop,\u003cbr\u003e  signal-invalidation exit\u003c\/p\u003e\n\u003cp\u003e  Standard-library only -- zero extra pip installs required\u003cbr\u003e  (asyncio, logging, os, math, typing -- all built in to Python 3.10+)\u003c\/p\u003e\n\u003cp\u003e  Works with any OHLCV data source:\u003cbr\u003e  Interactive Brokers (ib_insync), Alpaca, Tradier, Tastytrade,\u003cbr\u003e  NinjaTrader, Sierra Chart, TradeStation, or any custom feed\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003e================================================================================\u003cbr\u003eWHO THIS IS FOR\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003e  Python developers exploring algorithmic trading for the first time\u003cbr\u003e  Quant hobbyists wanting a real, backtested strategy to study\u003cbr\u003e  Traders who want to understand how production CME bots are structured\u003cbr\u003e  Anyone building a multi-bot portfolio wanting 6J\/yen exposure\u003cbr\u003e  Students of systematic trading, momentum strategies, ATR risk sizing\u003cbr\u003e  Researchers comparing EMA-crossover variants on FX futures\u003c\/p\u003e\n\u003cp\u003e  NOT a push-button money machine. Requires Python knowledge and a\u003cbr\u003e  broker API. See FAQ below.\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003e================================================================================\u003cbr\u003eINTEGRATION QUICK-START  (5 minutes to first paper trade)\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003e  Step 1: Python 3.10+ (no extra packages needed)\u003c\/p\u003e\n\u003cp\u003e  Step 2: Environment variables\u003cbr\u003e    export ALLOCATED_CAPITAL=100000\u003cbr\u003e    export CONTRACT_POINT_VALUE=125000   # CME 6J standard\u003c\/p\u003e\n\u003cp\u003e  Step 3: Subclass and wire your broker\u003c\/p\u003e\n\u003cp\u003e    from bar_6j_long_20260914_142933_portable import Bar6jLong20260914142933\u003c\/p\u003e\n\u003cp\u003e    class MyYenBot(Bar6jLong20260914142933):\u003cbr\u003e        def open_position(self, direction, qty, price, stop=None, reason=\"\"):\u003cbr\u003e            # your_broker.submit_order(symbol=\"6JZ6\", side=\"buy\", qty=qty)\u003cbr\u003e            pass\u003cbr\u003e        def close_position(self, price, reason=\"\"):\u003cbr\u003e            # your_broker.submit_order(symbol=\"6JZ6\", side=\"sell\")\u003cbr\u003e            pass\u003c\/p\u003e\n\u003cp\u003e  Step 4: Feed bars\u003cbr\u003e    bot = MyYenBot()\u003cbr\u003e    await bot.on_bar_closed(\"signal\",    {\"open\":x, \"high\":x, \"low\":x,\u003cbr\u003e                                          \"close\":x, \"volume\":x})  # each 60m close\u003cbr\u003e    await bot.on_bar_closed(\"execution\", {\"open\":x, \"high\":x, \"low\":x,\u003cbr\u003e                                          \"close\":x, \"volume\":x})  # each  5m close\u003c\/p\u003e\n\u003cp\u003e  Step 5: Bot auto-manages signal, entry, stop, target, time stop, DD guard.\u003c\/p\u003e\n\u003cp\u003e================================================================================\u003cbr\u003eTECHNICAL SPECIFICATIONS\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003e  Instrument                 CME Japanese Yen Futures (6J), front-month\u003cbr\u003e  Direction                  LONG only\u003cbr\u003e  Signal timeframe           60 minutes  (Phase 2.5 calibration)\u003cbr\u003e  Execution timeframe        5 minutes   (Phase 2.5 calibration)\u003cbr\u003e  Original timeframes        10m signal -\u0026gt; 2m execution  (preserved in code)\u003cbr\u003e  Entry indicator            EMA(8) x EMA(21) crossover + momentum gate\u003cbr\u003e  Momentum score             Composite: trend 50% + RSI 35% + volume 15%\u003cbr\u003e  Stop type                  ATR-based, trailing (ratchets up)\u003cbr\u003e  ATR period                 14 bars\u003cbr\u003e  ATR multiplier             Dynamic 1.2x - 2.4x (Phase 2.5: 2.0x)\u003cbr\u003e  Min stop                   5 ticks  (Phase 2.5)\u003cbr\u003e  R:R ratio                  Dynamic 1.2 - 2.8  (typically ~2.0)\u003cbr\u003e  Max drawdown guard         15% of account equity (session halt)\u003cbr\u003e  Signal expiry              8 execution bars (~40 minutes)\u003cbr\u003e  Time stop                  30 execution bars (~150 minutes)\u003cbr\u003e  Contracts                  1 (configurable via num_contracts)\u003cbr\u003e  Capital env-var            ALLOCATED_CAPITAL (default $100,000)\u003cbr\u003e  Point value env-var        CONTRACT_POINT_VALUE (default $125,000)\u003cbr\u003e  Python version             3.10+\u003cbr\u003e  Dependencies               Standard library only (asyncio, logging, os, math)\u003cbr\u003e  Lines of code              479\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003e================================================================================\u003cbr\u003eFREQUENTLY ASKED QUESTIONS\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003e  Q: Does this require Rithmic or Redis?\u003cbr\u003e  A: No. All Rithmic and Redis code has been removed. You supply the data\u003cbr\u003e     (any OHLCV source) and the order execution (any broker API).\u003c\/p\u003e\n\u003cp\u003e  Q: Why is the win rate only 25.3%?\u003cbr\u003e  A: Intentional. The strategy uses asymmetric R:R (~2.0-2.3). At 2:1 R:R,\u003cbr\u003e     a 34% win rate breaks even; 25% with PF=1.616 means winners are\u003cbr\u003e     significantly larger than losers. This is a mathematically sound design.\u003c\/p\u003e\n\u003cp\u003e  Q: Why does raw backtest show 34.5% DD but you advertise 15%?\u003cbr\u003e  A: The raw backtest does not include the live circuit-breaker. In live\u003cbr\u003e     operation the bot halts and flattens when drawdown exceeds 15%.\u003c\/p\u003e\n\u003cp\u003e  Q: This bot is NOT in the profitable bots ranking -- should I be concerned?\u003cbr\u003e  A: The ranking covers live-traded\/forward-tested bots only. This is a\u003cbr\u003e     bar_historical bot backtested at creation (September 14, 2026). It is a\u003cbr\u003e     strategy blueprint with historical basis, not a live track record.\u003cbr\u003e     Forward performance depends on whether the current regime resembles\u003cbr\u003e     the trend regime at creation.\u003c\/p\u003e\n\u003cp\u003e  Q: Can I paper-trade without a real broker?\u003cbr\u003e  A: Yes. Override open_position() and close_position() with logging stubs.\u003cbr\u003e     Promote to live once paper results satisfy your criteria.\u003c\/p\u003e\n\u003cp\u003e  Q: Can I use this on instruments other than 6J?\u003cbr\u003e  A: Yes. Update SYMBOL, CONTRACT_POINT_VALUE, and the TIMEFRAME_CALIBRATION\u003cbr\u003e     block at the bottom of the file for your instrument.\u003c\/p\u003e\n\u003cp\u003e  Q: Does the 15% drawdown cap reset daily?\u003cbr\u003e  A: Session-based -- re-instantiate the bot to start fresh. Wrap in a\u003cbr\u003e     daily scheduler or cron.\u003c\/p\u003e\n\u003cp\u003e  Q: Is Gen2 included?\u003cbr\u003e  A: No. Gen2 had no backtest data at creation time. Gen1 is the verified,\u003cbr\u003e     fully backtested version included here.\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003e================================================================================\u003cbr\u003eRISK DISCLAIMER\u003cbr\u003e================================================================================\u003c\/p\u003e\n\u003cp\u003eThis software is provided for EDUCATIONAL PURPOSES ONLY and does NOT\u003cbr\u003econstitute investment advice, financial advice, or a solicitation to trade.\u003c\/p\u003e\n\u003cp\u003eFutures trading involves substantial risk of loss and is not appropriate for\u003cbr\u003eall investors. The 15% drawdown circuit-breaker is a software control -- it\u003cbr\u003edoes not eliminate risk. Bar-data backtests do not account for slippage,\u003cbr\u003ecommission, exchange fees, liquidity constraints, or live market microstructure.\u003cbr\u003ePast backtested performance is NOT indicative of future results.\u003c\/p\u003e\n\u003cp\u003eYou are solely responsible for any trading decisions. Consult a qualified\u003cbr\u003efinancial professional before committing real capital. Only trade with money\u003cbr\u003eyou can afford to lose.\u003c\/p\u003e\n\u003cp\u003e \u003c\/p\u003e\n\u003cp\u003e \u003c\/p\u003e","brand":"HFTCODE.COM","offers":[{"title":"Default Title","offer_id":53624492982581,"sku":null,"price":0.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0967\/8549\/8421\/files\/6jyenfuturesemabot.png?v=1790038146","url":"https:\/\/hftcode.com\/products\/japanese-yen-6j-ema-momentum-bot-python-70-5-backtest","provider":"HFTCODE.COM","version":"1.0","type":"link"}