Oil 15 minutes meanreverting strategy

Category: Strategies By: Francesco78 Created: June 28, 2017, 2:28 PM
June 28, 2017, 2:28 PM
Strategies
24 Comments

Hello,

I found this nice and simple strategy playing with the “average fullness of last 5 candles” . I added a simple moving average oscillator, with 5 and 50 period and I considered mean reverting long/short condition by setting a threshold to the “average fullnes”

The strategy is really minimally optimized, I only optimized the threshold and the profit and stop target.

Results of  backtest and  WF are attached

Regards

Francesco

//crude oil 15 min strategy

DEFPARAM cumulateOrders = False // Cumulating positions deactivated
///parameter definition
period = 5
fastav = average[5](close)
slowav = average[50](close)
maoscillator = fastav-slowav

fullness = (Dclose(0)-Dopen(0))/abs(Dhigh(0)-Dlow(0))
avfullness = summation[period](fullness)/period

pr = 50
pl = 40
avfullnessthreshold = 0.2

cl = maoscillator > 0
cl = cl and avfullness < -avfullnessthreshold
// Conditions to enter long positions

cs = maoscillator<0
cs = cs and avfullness > avfullnessthreshold

IF cl THEN
 BUY 1 PERPOINT AT MARKET
ENDIF

if cs then
 sellshort 1 perpoint at market
endif

set target pprofit pr
set stop ploss pl

Download
Filename: oil_15min.itf
Downloads: 416
Download
Filename: oil_15min_wf.png
Downloads: 238
Francesco78 Master
I usually let my code do the talking, which explains why my bio is as empty as a newly created file. Bio to be initialized...
Author’s Profile

Comments

Logo Logo
Loading...