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)