OPEN-SOURCE SCRIPT

FxAST Ichi ProSeries Enhanced Full Market Regime Engine

138
FxAST Ichi ProSeries v1.x is a modernized Ichimoku engine that keeps the classic logic but adds a full market regime engine for any market and instrument.”

  • Multi-timeframe cloud overlay
  • Oracle long-term baseline
  • Trend regime classifier (Bull / Bear / Transition / Range)
  • Chikou & Cloud breakout signals
  • HTF + Oracle + Trend dashboard
  • Alert-ready structure for automation


No repainting: all HTF calls use lookahead_off.

1. Core Ichimoku Engine

Code sections:


  • Input group: Core Ichimoku
  • Function: ichiCalc()
  • Variables: tenkan, kijun, spanA, spanB, chikou


What it does
Calculates the classic Ichimoku components:

  • Tenkan (Conversion Line) – fast Donchian average (convLen)
  • Kijun (Base Line) – slower Donchian average (baseLen)
  • Senkou Span A (Span A / Lead1) – (Tenkan + Kijun)/2
  • Senkou Span B (Span B / Lead2) – Donchian over spanBLen
  • Chikou – current close shifted back in time (displace)


Everything else in the indicator builds on this engine.

How to use it (trading)
  • Tenkan vs Kijun = short-term vs medium-term balance.
  • Tenkan above Kijun = short-term bullish control; below = bearish control.
  • Span A / B defines the cloud, which represents equilibrium and support/resistance.
  • Price above cloud = bullish bias; price below cloud = bearish bias.


Graphic

https://www.tradingview.com/x/Jcv2Xtiq/

2. Display & Cloud Styling

Code sections:

  • Input groups: Display Options, Cloud Styling, Lagging Span & Signals
  • Variables: showTenkan, showKijun, showChikou, showCloud, bullCloudColor, bearCloudColor, cloudLineWidth, laggingColor
  • Plots: plot(tenkan), plot(kijun), plot(chikou), p1, p2, fill(p1, p2, ...)


What it does

  • Lets you toggle individual components:
  • Show/hide Tenkan, Kijun, Chikou, and the cloud.

  • Customize cloud colors & opacity:

  • bullCloudColor when Span A > Span B
  • bearCloudColor when Span A < Span B

  • Adjust cloud line width for clarity.


How to use it


  • Turn off components you don’t use (e.g., hide Chikou if you only want cloud + Tenkan/Kijun).
  • For higher-timeframe or noisy charts, use thicker Kijun & cloud so structure is easier to see.


Graphic

Before
https://www.tradingview.com/x/hS5fXB6p/

After
https://www.tradingview.com/x/9MWbEtOS/

3. HTF Cloud Overlay (Multi-Timeframe)

Code sections:

  • Input group: HTF Cloud Overlay
  • Vars: showHTFCloud, htfTf, htfAlpha
  • Logic: request.security(..., ichiCalc(...)) → htfSpanA, htfSpanB
  • Plots: pHTF1, pHTF2, fill(pHTF1, pHTF2, ...)


What it does

  • Pulls higher-timeframe Ichimoku cloud (e.g., 1H, 4H, Daily) onto your current chart.
  • Uses the same Ichimoku settings but aggregates on htfTf.
  • Plots an extra, semi-transparent cloud ahead of price:


  • Greenish when HTF Span A > Span B
  • Reddish when HTF Span B > Span A


How to use it

  • Trade LTF (e.g., 5m/15m) only in alignment with HTF trend:


  • HTF cloud bullish + LTF Ichi bullish → look for longs
  • HTF cloud bearish + LTF Ichi bearish → look for shorts

  • Treat HTF cloud boundaries as major S/R zones.


Graphic
https://www.tradingview.com/x/1wtNCTWL/

4. Oracle Module

Code sections:

  • Input group: Oracle Module
  • Vars: useOracle, oracleLen, oracleColor, oracleWidth, oracleSlopeLen
  • Logic: oracleLine = donchian(oracleLen); slope check vs oracleLine[oracleSlopeLen]
  • Plot: plot(useOracle ? oracleLine : na, "Oracle", ...)


What it does

  • Creates a long-term Donchian baseline (default 208 bars).

  • Uses a simple slope check:

  • Current Oracle > Oracle oracleSlopeLen bars ago → Oracle Bull
  • Current Oracle < Oracle oracleSlopeLen bars ago → Oracle Bear

  • Slope state is also shown in the dashboard (“Bull / Bear / Flat”).


How to use it

  • Think of Oracle as your macro anchor:

  • Only take longs when Oracle is sloping up or flat.
  • Only take shorts when Oracle is sloping down or flat.

  • Works well combined with HTF cloud:

  • HTF cloud bullish + Oracle Bull = higher conviction long bias.
  • Ideal for Gold / Indices swing trades as a trend filter.


Graphic idea
https://www.tradingview.com/x/jnBVUWpq/

5. Trend Regime Classifier

Code sections:

  • Input group: Trend Regime Logic
  • Vars: useTrendRegime, bgTrendOpacity, minTrendScore
  • Logic:

  • priceAboveCloud, priceBelowCloud, priceInsideCloud
  • Tenkan vs Kijun alignment
  • Cloud bullish/bearish
  • bullScore / bearScore (0–3)
  • regime + regimeLabel + regimeColor
  • Visuals: bgcolor(regimeColor) and optional barcolor() in priceColoring mode.


What it does

Scores the market in three dimensions:

  1. Price vs Cloud
  2. Tenkan vs Kijun
  3. Cloud Direction (Span A vs Span B)


  • Each condition contributes +1 to either bullScore or bearScore.
  • Then:
  • Bull regime when:
  • bullScore >= minTrendScore and bullScore > bearScore

  • Price in cloud → “Range”
  • Everything else → “Transition”


  • These regimes are shown as:
  • Background colors:
  • Teal = Bull
  • Maroon = Bear
  • Orange = Range
  • Silver = Transition
  • Optional candle recoloring when priceColoring = true.


How to use it

  • Filters:
  • Only buy when regime = Bull or Transition and Oracle/HTF agree.
  • Only sell when regime = Bear or Transition and Oracle/HTF agree.
  • No trade zone:
  • When regime = Range (price inside cloud), avoid new entries; wait for break.
  • Aggressiveness:
  • Adjust minTrendScore to be stricter (3) or looser (1).


Graphic
https://www.tradingview.com/x/9HrSq2OB/

6. Signals: Chikou & Cloud Breakout

Code sections:


  • Logic:
  • chikouBuySignal = ta.crossover(chikou, close)
  • chikouSellSignal = ta.crossunder(chikou, close)
  • cloudBreakUp = priceInsideCloud[1] and priceAboveCloud
  • cloudBreakDown = priceInsideCloud[1] and priceBelowCloud


What it does

1. Two key signal groups:

Chikou Cross Signals

  • Buy when Chikou crosses up through price.
  • Sell when Chikou crosses down through price.
  • Classic Ichi confirmation idea: Chikou breaking free of price cluster.

2. Cloud Breakout Signals

  • Long trigger: yesterday inside cloud → today price breaks above cloud.
  • Short trigger: yesterday inside cloud → today price breaks below cloud.
  • Captures “equilibrium → expansion” moves.


These are conditions only in this version (no chart shapes yet) but are fully wired for alerts. (Future Updates)

How to use it

  • Use Chikou signals as confirmation, not standalone entries:
  • Eg., Bull regime + Oracle Bull + cloud breakout + Chikou Buy.
  • Use Cloud Breakouts to catch the first impulsive leg after consolidation.


Graphic
https://www.tradingview.com/x/eRFCY1UA/

7. Alerts (Automation Ready)

[
  • b]Code sections:
  • Input group: Alerts
  • Vars: useAlertTrend, useAlertChikou, useAlertCloudBO
  • Alert lines like: "FxAST Ichi Bull Trend", "FxAST Ichi Bull Trend", "FxAST Ichi Cloud Break Up"


What it does

  • Provides ready-made alert hooks for:
  • Trend regime (Bull / Bear)
  • Chikou cross buy/sell
  • Cloud breakout up/down
  • Each type can be globally toggled on/off via the inputs (helpful if a user only wants one kind).


How to use it

  • In TradingView: set alerts using “Any alert() function call” on this indicator.
  • Then filter which ones fire by:
  • Turning specific alert toggles on/off in input panel, or
  • Filtering text in your external bot / webhook side.


Example simple workflow ---> Indicator ---> TV Alert ---> Webhook ---> Bot/Broker

8. FxAST Dashboard

Code sections:

  • Input group: Dashboard
  • Vars: showDashboard, dashPos, dash, dashInit
  • Helper: getDashPos() → position.*
  • Table cells (updated on barstate.islast):
  • Row 0: Regime + label
  • Row 1: Oracle status (Bull / Bear / Flat / Off)
  • Row 2: HTF Cloud (On + TF / Off)
  • Row 3: Scores (BullScore / BearScore)


What it does

  • Displays a compact panel with the state of the whole system:
  • Current Trend Regime (Bull / Bear / Transition / Range)
  • Oracle slope state
  • Whether HTF Cloud is active + which timeframe
  • Raw Bull / Bear scores (0–3 each)

  • Position can be set: Top Right, Top Left, Bottom Right, Bottom Left.


  • How to use it
  • Treat it like a pilot instrument cluster:
  • Quick glance: “Are my trend, oracle and HTF all aligned?”
  • Great for streaming / screenshots: everything important is visible in one place without reading the code.


Graphic (lower right of chart [can be moved])
https://www.tradingview.com/x/PvVy2xla/

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.