FractalScript

The Art of Algorithmic Intelligence

← Return to Dashboard

Welcome to the Engine

FractalScript is an independent, high-performance interpreter designed to unlock the full potential of your trading strategies. Fully compatible with Pine Script® v5 syntax, it allows you to run industry-standard indicators while leveraging exclusive AI Extensions native to the Fractal AI Agent platform.

1. The Golden Cross Sniper Core Basics

A classic trend-following strategy using Exponential Moving Averages. This demonstrates the standard f. (Fractal) alias for technical analysis functions.

//@version=5 indicator("Golden Cross", overlay=true) fast = f.ema(close, 50) slow = f.ema(close, 200) plot(fast, color=color.aqua, linewidth=2, title="Fast EMA") plot(slow, color=color.orange, linewidth=2, title="Slow EMA") buySignal = ta.crossover(fast, slow) plotshape(buySignal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.large, text="BUY")
2. AI Sentiment Filter Exlusive AI

Learn to integrate our proprietary AI sentiment analysis. This script only plots signals when the ai.sentiment() engine confirms the market "vibe" matches the price action.

//@version=5 indicator("AI Filter", overlay=true) // Get AI Market Sentiment (-1 to 1) vibe = ai.sentiment() // Plot sentiment as background intensity bgcolor(vibe > 0.8 ? color.new(color.green, 90) : vibe < -0.8 ? color.new(color.red, 90) : na) // Signal: Price crosses SMA but ONLY if AI is bullish ma = f.sma(close, 20) plot(ma, color=color.yellow) long = ta.crossover(close, ma) and vibe > 0 plotshape(long, style=shape.labelup, location=location.belowbar, color=color.green, text="AI CONFIRMED")
3. Dynamic Liquidity Zones Structure

Uses lookback functions to identify key "Liquidity Pools" (Highest/Lowest prices). This helps you see where big money might be hunting stop losses.

//@version=5 indicator("Liquidity Zones", overlay=true) // Find high/low over last 50 bars top = ta.highest(high, 50) bot = ta.lowest(low, 50) // Plot as levels hline(top, "Resistance", color=color.red, linewidth=1) hline(bot, "Support", color=color.green, linewidth=1) // Color zones when price is near extreme bgcolor(close > top * 0.99 ? color.new(color.red, 85) : close < bot * 1.01 ? color.new(color.green, 85) : na)
4. Volatility regime Switch Risk Management

Uses the Average True Range (ATR) to detect "Expansion" vs "Compression" regimes. Perfect for timing entries when the market is about to explode.

//@version=5 indicator("Volatility Sniper", overlay=true) atr = ta.atr(14) ma_atr = f.sma(atr, 20) // High volatility = Red highlight, Low = Blue is_volatile = atr > ma_atr bgcolor(is_volatile ? color.new(color.red, 95) : color.new(color.aqua, 95)) plot(f.sma(close, 50), color=is_volatile ? color.red : color.aqua, linewidth=2)