cristian.d

CamarillaStrategy -V1 - H4 and L4 breakout - exits added

Exits added using trailing stops.
2.6 Profit Factor and 76% Profitable on SPY , 5M - I think it's a pretty good number for an automated strategy that uses Pivots . I don't think it's possible to add volume and day open price in relation to pivot levels -- that's what I do manually ..

Still trying to add EMA for exits.. it will increase profitability. You can play in pinescript with trailing stops entries..
즐겨찾기 스크립트에서 빼기 즐겨찾기 스크립트에 넣기
//@version=2
//Created by CristianD
strategy(title="CamarillaStrategyV1", shorttitle="CD_Camarilla_StrategyV1", overlay=true) 
//sd = input(true, title="Show Daily Pivots?")
EMA = ema(close,8)

//Camarilla
pivot = (high + low + close ) / 3.0 
range = high - low
h5 = (high/low) * close 
h4 = close + (high - low) * 1.1 / 2.0
h3 = close + (high - low) * 1.1 / 4.0
h2 = close + (high - low) * 1.1 / 6.0
h1 = close + (high - low) * 1.1 / 12.0
l1 = close - (high - low) * 1.1 / 12.0
l2 = close - (high - low) * 1.1 / 6.0
l3 = close - (high - low) * 1.1 / 4.0
l4 = close - (high - low) * 1.1 / 2.0
h6 = h5 + 1.168 * (h5 - h4) 
l5 = close - (h5 - close)
l6 = close - (h6 - close)

// Daily line breaks
//sopen = security(tickerid, "D", open [1])
//shigh = security(tickerid, "D", high [1])
//slow = security(tickerid, "D", low [1])
//sclose = security(tickerid, "D", close [1])
//
// Color
//dcolor=sopen != sopen[1] ? na : black
//dcolor1=sopen != sopen[1] ? na : red
//dcolor2=sopen != sopen[1] ? na : green

//Daily Pivots 
dtime_pivot = security(tickerid, 'D', pivot[1]) 
dtime_h6 = security(tickerid, 'D', h6[1]) 
dtime_h5 = security(tickerid, 'D', h5[1]) 
dtime_h4 = security(tickerid, 'D', h4[1]) 
dtime_h3 = security(tickerid, 'D', h3[1]) 
dtime_h2 = security(tickerid, 'D', h2[1]) 
dtime_h1 = security(tickerid, 'D', h1[1]) 
dtime_l1 = security(tickerid, 'D', l1[1]) 
dtime_l2 = security(tickerid, 'D', l2[1]) 
dtime_l3 = security(tickerid, 'D', l3[1]) 
dtime_l4 = security(tickerid, 'D', l4[1]) 
dtime_l5 = security(tickerid, 'D', l5[1]) 
dtime_l6 = security(tickerid, 'D', l6[1]) 

//offs_daily = 0
//plot(sd and dtime_pivot ? dtime_pivot : na, title="Daily Pivot",color=dcolor, linewidth=2)
//plot(sd and dtime_h6 ? dtime_h6 : na, title="Daily H6", color=dcolor2, linewidth=2)
//plot(sd and dtime_h5 ? dtime_h5 : na, title="Daily H5",color=dcolor2, linewidth=2)
//plot(sd and dtime_h4 ? dtime_h4 : na, title="Daily H4",color=dcolor2, linewidth=2)
//plot(sd and dtime_h3 ? dtime_h3 : na, title="Daily H3",color=dcolor1, linewidth=3)
//plot(sd and dtime_h2 ? dtime_h2 : na, title="Daily H2",color=dcolor2, linewidth=2)
//plot(sd and dtime_h1 ? dtime_h1 : na, title="Daily H1",color=dcolor2, linewidth=2)
//plot(sd and dtime_l1 ? dtime_l1 : na, title="Daily L1",color=dcolor2, linewidth=2)
//plot(sd and dtime_l2 ? dtime_l2 : na, title="Daily L2",color=dcolor2, linewidth=2)
//plot(sd and dtime_l3 ? dtime_l3 : na, title="Daily L3",color=dcolor1, linewidth=3)
//plot(sd and dtime_l4 ? dtime_l4 : na, title="Daily L4",color=dcolor2, linewidth=2)
//plot(sd and dtime_l5 ? dtime_l5 : na, title="Daily L5",color=dcolor2, linewidth=2)
//plot(sd and dtime_l6 ? dtime_l6 : na, title="Daily L6",color=dcolor2, linewidth=2)

longCondition = close >dtime_h4 and open < dtime_h4 and EMA < close
if (longCondition)
    strategy.entry("Long", strategy.long)
    strategy.exit ("Exit Long","Long",  trail_points = 40,trail_offset = 1, loss =70) 
    //trail_points = 40, trail_offset = 3, loss =70 and


shortCondition = close <dtime_l4 and open >dtime_l4 and EMA > close
if (shortCondition)
    strategy.entry("Short", strategy.short)
    strategy.exit ("Exit Short","Short", trail_points = 10,trail_offset = 1, loss =20)
    
Nice one! Does this strategy repaint?
+1 응답
코멘트 지워졌음
코멘트 지워졌음
코멘트 지워졌음
코멘트 지워졌음
cristian.d mynmi16
No repainting
응답
Great stuff! Thanks for sharing!
응답
Hi, thx for share!
a question is it possible to delete the trailing stops and using only fixed limit and stop loss?
in case yes, can you share the script for this? greetings
응답
홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 하우스룰(내부규정) 모더레이터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 Help Center 기능 개발/개선 요청 블로그 & 뉴스 잦은물음 위키 트위터
프로화일 프로화일설정 계정 및 빌링 트레이딩뷰 코인 나의 서포트 티켓 Help Center 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃