0bps

Strategy vault / Other

RAVI FX Fisher

Pine Script strategy by ChaoZhang.

Pine ScriptOtherATR
Author
ChaoZhang
Complexity
Starter · 39 lines
Parameters
5
Backtest bar
1d · swing
Tested on
BTC/USDT · futures

The original spec has no written description. Read the source below.

Parameters

NameDefaultWhat it controls
v_input_source_1_close0(?Basic Settings)Source: close | high | low | open | hl2 | hlc3 | hlcc4 | ohlc4
v_input_int_14Fast MA Length
v_input_int_249Slow MA Length
v_input_float_10.07Trigger
v_input_bool_1false(?UI Options)Color bars?

Source Pine Script

/*backtest
start: 2021-06-15 00:00:00
end: 2022-06-14 23:59:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © loxx

//@version=5
indicator("RAVI FX Fisher [Loxx]", shorttitle="RAVIFXF [Loxx]", timeframe="", overlay = false, timeframe_gaps=true, max_bars_back = 3000)

greencolor = #2DD204  
redcolor = #D2042D 

src = input.source(close, "Source", group = "Basic Settings")
maf = input.int(4, "Fast MA Length", minval = 1, group = "Basic Settings")
mas = input.int(49, "Slow MA Length", minval = 1, group = "Basic Settings")
trigger = input.float(0.07, "Trigger", minval = 0, group = "Basic Settings")

colorbars = input.bool(false, "Color bars?", group = "UI Options")

maval = (ta.wma(src, maf) - ta.wma(src, mas)) * ta.atr(maf) / ta.wma(src, mas) / ta.atr(mas)
maval := 100 * maval
fish = (math.exp(2 * maval) - 1) / (math.exp(2 * maval) + 1)

plot(fish,color = fish >=0 ? greencolor : redcolor, style = plot.style_histogram, linewidth = 2)

plot(trigger, color = color.white, linewidth = 1 )
plot(-trigger, color = color.white, linewidth = 1 )

barcolor(colorbars ? fish >=0 ? greencolor : redcolor : na)

if fish >=0
    strategy.entry("Enter Long", strategy.long)
else
    strategy.entry("Enter Short", strategy.short)

Published by ChaoZhang on the FMZ strategy square · last modified 2022-06-16. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.

Build this with AgenKit

A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/RAVI-FX-Fisher.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. Get tests, backtest, risk controls and a paper-trading switch

Understand it first

Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.

Related specs

esc

Try , , or .

↑↓ move↵ open