CAC 40 strategy with reversal-signal-threelinebreak indicator

Category: Strategies By: Francesco78 Created: June 25, 2017, 12:23 PM
June 25, 2017, 12:23 PM
Strategies
7 Comments

Hello everyone.

This is a strategy I found by playing around with the indicator posted by Nicolas

https://www.prorealcode.com/prorealtime-indicators/reversal-signal-threelinebreak/

I applied to cac 40 and I used in the counterintuitive way (buy with a sell signal / sell with a buy signal).

In line with what Andrea Ungher teaches on DAX I applied a condition on the “fullness” of the prevous day bar as a filter.

In order to make it work pls download also the indicator.

walk forward analysis is attached

//CAC 40 daily strategy spread 3

DEFPARAM CumulateOrders = False // Cumulating positions deactivated


atr = averagetruerange[14]
c = 0.5//parameter to define dojiness

///profit parameters for trailing dynamic target
k = 1 //profit parameters for long
j = 7 //profit parameters for shorts

///fulness definition
if opendayofweek <>1 then
 fullness = abs(dopen(1)-dclose(1))/abs(dhigh(1)-dlow(1))
endif

if opendayofweek = 1 then
 fullness = abs(dopen(2)-dclose(2))/abs(dhigh(2)-dlow(2))
endif
ydayok = fullness<c

// signal def
trendsig = CALL "PRC_RevertSignal_cac"
cl = trendsig=-1
cs = trendsig=1


IF cs and ydayok THEN
 sellshort 2 contract AT  MARKET
ENDIF

IF cl and ydayok THEN
 buy 2 PERPOINT AT  MARKET
ENDIF


//TRAILING STOP
PFL = k*atr
PFS = j*atr
TGL =10
TGS=10
if not onmarket then
 MAXPRICE = 0
 MINPRICE = close
 PREZZOUSCITA = 0
ENDIF
if longonmarket then
 MAXPRICE = MAX(MAXPRICE,close)
 if MAXPRICE-tradeprice(1)>=TGL*pointsize then
  PREZZOUSCITA = MAXPRICE-TGL*pointsize
 ENDIF
ENDIF
if shortonmarket then
 MINPRICE = MIN(MINPRICE,close)
 if tradeprice(1)-MINPRICE>=TGS*pointsize then
  PREZZOUSCITA = MINPRICE+TGS*pointsize
 ENDIF
ENDIF
if onmarket and PREZZOUSCITA>0 then
 EXITSHORT AT PREZZOUSCITA STOP
 SELL AT PREZZOUSCITA STOP
ENDIF


if longonmarket then
 set target pprofit PFL
endif
if shortonmarket then
 set stop ploss PFS
endif

Have fun.

Download
Filename: cac40_wf.png
Downloads: 397
Download
Filename: cac40_daily_dynamic_tgt.itf
Downloads: 690
Download
Filename: PRC_RevertSignal_cac.itf
Downloads: 598
Francesco78 Master
Code artist, my biography is a blank page waiting to be scripted. Imagine a bio so awesome it hasn't been coded yet.
Author’s Profile

Comments

Logo Logo
Loading...