Francesco78

Mean reverting strategy FOREX - AUDCAD

Category: Strategies By: Francesco78 Created: March 18, 2018, 6:13 PM
March 18, 2018, 6:13 PM
Strategies
1 Comment
Mean reverting strategy FOREX - AUDCAD

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

 

Download
Filename: WFtest-1.png
Downloads: 235
Download
Filename: WF-non-anchored-1.png
Downloads: 272
Download
Filename: audcadmrh-1519740014c4pl8.png
Downloads: 233
Download
Filename: AUDCAD-Mean-Reverting-1h.itf
Downloads: 700
Francesco78
Francesco78 Master
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

apachx
9 years ago
#

Hi. Please, describe the algorithm in words. I want to understand how it works, but for now I do not know this programming language. Thank you.

ProRealCode ProRealCode
Loading...