0bps

Strategy vault / Mean reversion

Renko Reversal Alert

Pine Script strategy by Zer3192.

Pine ScriptMean reversion
Author
Zer3192
Complexity
Starter · 46 lines
Parameters
0
Backtest bar
4h · intraday
Tested on
BTC/USDT · futures

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

Source Pine Script

/*backtest
start: 2021-05-08 00:00:00
end: 2022-05-07 23:59:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
study("Renko Reversal alert", overlay=true) 
//Buy entry if a bearish renko brick is followed by a bullish brick
//Sell entry if a bullish brick is followed by a bearish brick
long = close > open[1] and close[1] < open[2]
short = close < open[1] and close[1] > open[2]

//Use these alerts to create server-side alerts (right-click on one of the buy or sell arrows on the chart and choose "add alert")
alertcondition(long, title='Long opportunity', message='Renko reversal')
alertcondition(short, title='Short opportunity', message='Renko reversal')

//Use this to customize the look of the arrows to suit your needs.
plotshape(long, location=location.belowbar, color=lime, style=shape.arrowup, text="Buy")
plotshape(short, location=location.abovebar, color=red, style=shape.arrowdown, text="Sell")
if long
   strategy.entry("buy", strategy.long)
else if short
    strategy.entry("sell", strategy.short)    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

Published by Zer3192 on the FMZ strategy square · last modified 2022-06-12. 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/Renko-Reversal-Alert.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