TradingView
cristian.d
2015年10月16日午前5時12分

Camarilla Strategy - breakouts of H4 and L4 

Apple Inc.NASDAQ

詳細

Breakout strategy of H4 and L4 levels. Manual entries and exits - higher profits BUT because I am a novice in pinescript,
Can someone please:

1. Show me how to add exit strategy lines : close> ema(close,3) for exit short and opposite for long. I added myself but I can't make it to work in relation to camarilla entries; instead it shows all ema crossings..
2.Why some entries over/above my pivots are not shown.. Example:11.15 AM (short) and 13.10 PM (long) AAPL, October 15, today? Today would've been 3 signals, not one..

Thank you in advance for any advice. I am a strong Camarilla follower, but I am not a coder.
コメント
nivasdhina
Hii how is it working...... different in different timeframe...how can i make it for short term or intraday...
soulstar
sir , this repaint?
Hareesha
Hi Cristian.D,

Great strategy from you & I have studied your camarilla strategy. For "exits based on EMA" (instead of stop loss...etc) below is what worked for me:

if longCondition
strategy.entry("Long", strategy.long)
//strategy.exit("Exit Long", "Long", trail_points=40, trail_offset=1, loss=70)
strategy.close_all(when = EMA > close)

You have to move "strategy.close_all(when = EMA > close)" out of "if" statement. Else, the "exit will be in the same bar". Also, "strategy.close_all" is the only one I could get to work. Hope this gives you something to improve on.

Thanks a lot.

Hareesha C
Hareesha
the code should look as below (spaces at the beginning are important):

if longCondition
strategy.entry("Long", strategy.long)
//strategy.exit("Exit Long", "Long", trail_points=40, trail_offset=1, loss=70)
strategy.close_all(when = EMA > close)
Hareesha
sorry, again this comment section automatically removes spaces at the beginning automatically after posting comment.
RenanPaivaSiqueira
Does it repaint?
waytonavneet
RenanPaivaSiqueira
@waytonavneet, sadly repaints... when i tested forward, gave me wrong signals
Asahilca
@RenanPaivaSiqueira, yes, it repaints
詳細