Oil 10min "hammernegated" pattern strategy

Category: Strategies By: Francesco78 Created: July 3, 2017, 8:58 AM
July 3, 2017, 8:58 AM
Strategies
65 Comments

Dear all,

I found this nice strategy by playing with candlestickpatterns with 2 candles.

Basically I considered the “hammer negated” pattern, where you have first an hammer candle (body on the upper or lower 25% of the candle) and then a candle which negate the hammer so in case we have a bullish hammer, then we have a candle whose body is within yesterday candle shadow. I hope it is clear as I have no idea how to draw candles on the laptop.

I added then a few moving average that identifies momentum, and opted for trailing stops.

The only thing I have optimized here are trailing stops level. All the moving average period, the parameter that defines the candlestick pattern are not optimized, no target profit either. Thats why WF results are pretty impressive.

Only downside as usual is that I dont have more than 100K history.

Enjoy

Francesco

defparam cumulateorders = false

av1 = average[5](close)
av2 = average[10](close)
av3 = average[50](close)
x = 0.5
bull = close> av1 and close >av2 and close > av3
bear = close <av1 and close <av2 and close <av3
//n= 1

hammerup = min(open[1],close[1])>high[1]-(high[1]-low[1])/3 //and timeok
hammerupnegated= max(open,close)<min(open[1],close[1]) and abs(open-close)/(high-low)>x
cs = hammerup and hammerupnegated and bear
hammerdown = max(open[1],close[1])<low[1]+(high[1]-low[1])/3 //and timeok
hammerdownnegated = min(open,close)>max(open[1],close[1]) and abs(open-close)/(high-low)>x
cl = hammerdown and hammerdownnegated and bull

if cs then
 sellshort 1 contract at market
endif

if cl then
 buy 1 contract at market
endif


//TRAILING STOP
TGL =18
TGS= 24
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

//set target pprofit n*averagetruerange[14]
//set stop ploss m*averagetruerange[14]

 

Download
Filename: oil_10min_wf_results.png
Downloads: 442
Download
Filename: oil_10mins_results.png
Downloads: 673
Download
Filename: hammernegated_oil_10min.itf
Downloads: 1036
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...