This is a mean reverting strategy that I currently run live on AUDCAD, on a 1 hour timeframe.
It is based on Bollinger Bands piercing and accumulation of same direction candlesticks in a single row.
WalkForward analysis attached.
Enjoy, comment and improve 🙂
Discussions about the strategy in the automatic trading forum: https://www.prorealcode.com/topic/reverting-strategy-audcad-h1-timeframe/
//-------------------------------------------------------------------------
// Main code : audcad_meanrevert_v2
//-------------------------------------------------------------------------
defparam cumulateorders = false
n = 1
m = 3
l = 90
cs= summation[n](close>open) = n
cs = cs and close>bollingerup[20](close) and close>dlow(2)
cl= summation[m](close<open) = m
cl = cl and close<bollingerdown[20](close) and close<Dhigh(2)
size = 2
//entry conditions
if cs then
sellshort size contract at market
endif
if cl then
buy size contract at market
endif
//exit conditions
if shortonmarket and close<average[l](close) then
exitshort at market
endif
if longonmarket and close>average[l](close) then
sell at market
endif