Fadior

Strategy CCT Bollinger Band Oscillator

This strategy buy when ema crossover CCT BB oscillator and sell when crossunder. No SL neither TP only trailling stop at 1$. CCT BB oscillator is LaztBear indicator. Thanks to him.
สคริปต์โอเพนซอร์ซ

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถเข้าใจและตรวจสอบได้ ต้องขอบคุณผู้เขียน! ที่ให้คุณใช้ได้ฟรี แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//@version=2
strategy(title="Strategy CCT Bollinger Band Oscillator", shorttitle="Hornkild", calc_on_order_fills=true, default_qty_type=strategy.percent_of_equity, default_qty_value=50, overlay=false)

length=input(65)
lengthMA=input(30)
src=close
cctbbo=100 * ( src + 2*stdev( src, length) - sma( src, length ) ) / ( 4 * stdev( src, length ) )

//ul=hline(100, color=gray, editable=true)
//ll=hline(0, color=gray)
//hline(50, color=gray)
//fill(ul,ll, color=blue)
//plot(cctbbo, color=blue, linewidth=2)
//plot(ema(cctbbo, lengthMA), color=red)

TP = input(0) * 10
SL = input(0) * 10
TS = input(1) * 10
TO = input(10) * 10
CQ = 100

TPP = (TP > 0) ? TP : na
SLP = (SL > 0) ? SL : na
TSP = (TS > 0) ? TS : na
TOP = (TO > 0) ? TO : na

longCondition = crossover(cctbbo, ema(cctbbo, lengthMA))
if (longCondition)
    strategy.entry("Long", strategy.long)


shortCondition = crossunder(cctbbo, ema(cctbbo, lengthMA))
if (shortCondition)
    strategy.entry("Short", strategy.short)

strategy.exit("Close Short", "Short", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP, trail_offset=TOP)
strategy.exit("Close Long", "Long", qty_percent=CQ, profit=TPP, loss=SLP, trail_points=TSP, trail_offset=TOP)