Three steps, a few minutes. Connect your AI once, paste your code with the prompt FNOTrader builds for you, and your strategy is on the chart — checked on real bars before it is saved. Free on every account.
How it works
1 · Connect your AI
- One time, from mcp.fnotrader.com/mcp/connect
- Works with Claude, ChatGPT, Cursor, Gemini and any MCP client
- Free on every account, trials included
2 · Paste your code
- On the chart: Indicators → ⇪ Import code
- Pick the language, paste the code, choose strategy or indicator
- Copy prompt — your code plus exact instructions for the AI
3 · Your AI does the rest
- Converts it to an FNOTrader script with Buy/Sell signals
- Runs it on real bars and fixes every error first
- Saves it to My scripts and gives you a link that opens it on the chart

On the chart: Buy/Sell signals and a Strategy Tester
Every strategy draws its trades as Buy and Sell markers, with its lines and shaded trend areas, and fills the Strategy Tester — net profit, win rate, profit factor, drawdown and every trade. Change an input and it recalculates on the spot. Below: a Supertrend strategy on NIFTY 15-minute.

Backtest, forward test, then trade it live
In the Algo app, add an External Signal condition to a strategy and choose chart script as its source. Your script decides when; the strategy decides what to trade — an option, a future or a stock, with its own stop-loss, target and position size.
Backtest
- Pick the script, the symbol it runs on and its timeframe
- Its signals for those exact dates drive the strategy
- Each signal is taken at the close of the bar it was decided on — never earlier
Forward test
- Signals page → Fired by: Chart script
- Route to a demo account to run it on live markets with paper money
- Checked at every bar close during market hours
Live
- Route the same Signal to your broker account
- Same signals as the backtest — no rewrite
- Stale signals (seen more than 10 minutes late) are logged, never traded

Above: the Supertrend script's short signals selling a weekly NIFTY call, 3 Aug – 1 Oct 2026, with ₹20 per order costs and 0.5% slippage — 37 trades, ₹8,725 net. A backtest, not a promise; past results do not guarantee future returns.

Supported languages
| Bring | Converts well | Can't convert exactly |
|---|---|---|
| AmiBroker AFL | Buy / Sell / Short / Cover, Cross, Ref, HHV/LLV, ApplyStop, Param | Positive Ref (future bars), portfolio-level ranking |
| Python | pandas / TA-Lib indicators, rolling windows, signal columns, backtrader next() | ML models, outside data and files, multi-symbol ranking |
| MT4 / MT5 | iMA, iRSI, iATR, iBands, buffers, OrderSend entries, SL/TP | Tick-level and order-book logic, grids and martingales |
| NinjaTrader | OnBarUpdate, CrossAbove/Below, EnterLong/Short, SetStopLoss/ProfitTarget | Tick replay and order-flow-specific logic |
| TradingView Pine | Pine v4/v5/v6 indicators and strategies, usually as-is | Libraries (import), lower-timeframe requests |
| Others | thinkorswim ThinkScript, MetaStock, TC2000, EasyLanguage | US-only symbols (mapped to NIFTY or the index you name) |
Your code, converted — four real examples
Each of these was converted the same way, then run on real NIFTY 15-minute bars (13 Jul – 1 Oct 2026) by the checker your AI uses before saving. The results show the script runs and trades; they are not a recommendation.
Your AmiBroker AFL
// AmiBroker AFL - EMA crossover with RSI filter and 2% stop Fast = EMA(C, 9); Slow = EMA(C, 21); Buy = Cross(Fast, Slow) AND RSI(14) > 50; Sell = Cross(Slow, Fast); ApplyStop(stopTypeLoss, stopModePercent, 2); Plot(Fast, "EMA 9", colorBlue); Plot(Slow, "EMA 21", colorOrange);
FNOTrader script
//@version=6
strategy("EMA 9/21 + RSI (from AFL)", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
fastLen = input.int(9, "Fast EMA")
slowLen = input.int(21, "Slow EMA")
stopPct = input.float(2.0, "Stop loss %")
fast = ta.ema(close, fastLen)
slow = ta.ema(close, slowLen)
rsi = ta.rsi(close, 14)
buyCond = ta.crossover(fast, slow) and rsi > 50
sellCond = ta.crossover(slow, fast)
if buyCond
strategy.entry("Long", strategy.long)
if sellCond
strategy.close("Long")
strategy.exit("SL", "Long", stop=strategy.position_avg_price * (1 - stopPct / 100))
plot(fast, "Fast EMA", color.blue)
plot(slow, "Slow EMA", color.orange)Checked on NIFTY 15m: 29 trades · each Buy and Sell taken at the close of its bar.
Can't convert exactly: Positive Ref() reads a future bar — there is no honest equivalent · Portfolio-level ranking across many symbols (PositionScore) · Custom backtester (CBT) code.
Your Python (pandas)
# Python (pandas) - Donchian breakout import pandas as pd df["upper"] = df["high"].rolling(20).max().shift(1) df["lower"] = df["low"].rolling(10).min().shift(1) df["buy"] = (df["close"] > df["upper"]) & ~(df["close"].shift(1) > df["upper"].shift(1)) df["exit"] = (df["close"] < df["lower"]) & ~(df["close"].shift(1) < df["lower"].shift(1))
FNOTrader script
//@version=6
indicator("Donchian breakout (from Python)", overlay=true)
upper = ta.highest(high, 20)[1]
lower = ta.lowest(low, 10)[1]
plot(upper, "Upper", color.green)
plot(lower, "Lower", color.red)
buy = close > upper
sell = close < lower
plotshape(buy and not buy[1], "Buy", shape.triangleup, location.belowbar, color.green)
plotshape(sell and not sell[1], "Exit Long", shape.xcross, location.abovebar, color.red)
alertcondition(buy and not buy[1], "Buy", "Close broke the 20-bar high")
alertcondition(sell and not sell[1], "Exit Long", "Close broke the 10-bar low")Checked on NIFTY 15m: 40 Buy signals with their exits · usable in Algo as entry/exit signals.
Can't convert exactly: Machine-learning models (scikit-learn, TensorFlow) · Outside data — APIs, files, fundamentals, news · Ranking or rotating a basket of symbols.
Your MT4 / MT5 (MQL5)
// MT5 Expert Advisor - SMA 50 trend with ATR stop and target
#include <Trade\Trade.mqh>
CTrade trade;
int hMA, hATR;
int OnInit() { hMA = iMA(_Symbol, PERIOD_CURRENT, 50, 0, MODE_SMA, PRICE_CLOSE);
hATR = iATR(_Symbol, PERIOD_CURRENT, 14); return INIT_SUCCEEDED; }
void OnTick() {
double ma[2], atr[1]; CopyBuffer(hMA, 0, 1, 2, ma); CopyBuffer(hATR, 0, 1, 1, atr);
double c1 = iClose(_Symbol, PERIOD_CURRENT, 1), c2 = iClose(_Symbol, PERIOD_CURRENT, 2);
if (PositionsTotal() == 0 && c2 < ma[0] && c1 > ma[1])
trade.Buy(1, _Symbol, 0, c1 - 1.5 * atr[0], c1 + 3.0 * atr[0]);
if (PositionsTotal() == 0 && c2 > ma[0] && c1 < ma[1])
trade.Sell(1, _Symbol, 0, c1 + 1.5 * atr[0], c1 - 3.0 * atr[0]);
}FNOTrader script
//@version=6
strategy("SMA 50 trend + ATR exits (from MT5)", overlay=true)
maLen = input.int(50, "SMA length")
atrMult = input.float(1.5, "Stop (x ATR)")
tpMult = input.float(3.0, "Target (x ATR)")
ma = ta.sma(close, maLen)
atr = ta.atr(14)
plot(ma, "SMA", color.blue)
if ta.crossover(close, ma) and strategy.position_size == 0
strategy.entry("Long", strategy.long)
if ta.crossunder(close, ma) and strategy.position_size == 0
strategy.entry("Short", strategy.short)
if strategy.position_size > 0
strategy.exit("L exit", "Long", stop=strategy.position_avg_price - atrMult * atr, limit=strategy.position_avg_price + tpMult * atr)
if strategy.position_size < 0
strategy.exit("S exit", "Short", stop=strategy.position_avg_price + atrMult * atr, limit=strategy.position_avg_price - tpMult * atr)Checked on NIFTY 15m: 46 trades, long and short, with the ATR stop and target.
Can't convert exactly: Tick-by-tick logic in OnTick (scripts run once per closed bar) · Order-book / DOM reads, grids and martingales that depend on broker fills · Multi-symbol baskets in one Expert Advisor.
Your NinjaTrader 8 (NinjaScript)
// NinjaTrader 8 (NinjaScript) - MACD cross with a tick stop
public class MacdCross : Strategy {
protected override void OnStateChange() {
if (State == State.Configure) SetStopLoss(CalculationMode.Ticks, 400);
}
protected override void OnBarUpdate() {
if (CurrentBar < 26) return;
if (CrossAbove(MACD(12, 26, 9), MACD(12, 26, 9).Avg, 1)) EnterLong();
if (CrossBelow(MACD(12, 26, 9), MACD(12, 26, 9).Avg, 1)) ExitLong();
}
}FNOTrader script
//@version=6
strategy("MACD cross (from NinjaTrader)", overlay=false)
stopTicks = input.int(400, "Stop (ticks; 1 tick = 0.05)")
[macd, sig, hist] = ta.macd(close, 12, 26, 9)
plot(macd, "MACD", color.blue)
plot(sig, "Signal", color.orange)
plot(hist, "Histogram", color.gray, style=plot.style_columns)
if ta.crossover(macd, sig)
strategy.entry("Long", strategy.long)
if ta.crossunder(macd, sig)
strategy.close("Long")
strategy.exit("Stop", "Long", loss=stopTicks)Checked on NIFTY 15m: 57 trades with the 400-tick stop.
Can't convert exactly: Tick Replay and order-flow-specific logic · Unmanaged orders (SubmitOrderUnmanaged) · Custom drawing tools and add-ons.
Common questions
Which languages can I bring?
AmiBroker AFL, Python (pandas, TA-Lib, backtrader-style), MT4 and MT5 (MQL4 / MQL5), NinjaTrader (NinjaScript), TradingView Pine Script and thinkorswim ThinkScript. MetaStock, TC2000 and EasyLanguage formulas usually convert too.
Who does the conversion?
Your own AI assistant — Claude, ChatGPT, Cursor, Gemini or any MCP client — connected to your FNOTrader account. It reads FNOTrader's conversion guide, writes the script, checks it on real market bars and saves it to My scripts. Your code goes only to the AI you paste it into.
How do I know the converted script is right?
Before saving, the script is compiled and run on real bars of the symbol and timeframe you choose. Your AI gets back every compile error with its line number, or what the script actually did — how many Buy and Sell signals fired and when. A script that fails the check is not saved.
What can't be converted?
Logic that needs data FNOTrader does not have (fundamentals, outside APIs, files), machine-learning models, code that reads future bars, and tick-level or order-book logic in MT5 Expert Advisors. Your AI tells you what it could not convert exactly instead of guessing.
Can I trade the converted strategy automatically?
Yes. In the Algo app, a strategy with an External Signal condition can take its entries and exits from your chart script. Backtest it, run it on a demo (paper) account as a forward test, then route it to your broker. Signals are acted on only after the bar they were decided on has closed, so live trading behaves like the backtest.
What does it cost?
Connecting your AI and building chart scripts is free on every FNOTrader account, trials included. Backtests, forward tests and live trading in the Algo app follow your Algo plan or credits — see Pricing.
Related
Algo & Backtesting · Charts · Connect your AI · Options backtesting
Start a 7-day free trial No card needed. Bringing your code is free on every account.
