2 Hull Ma's Long Hull MA FIB Lines It will Sell when reaches upper 0.618 Fib and Hull(short_period)has crossed over to selling it will close sell by TP or SL or when reaches lower 0.618 Fib Buy is opposite that
I've been using the .618 upper fib for so long its not even funny its incredibly valuable. The lower one is rarely broken but when price recovers above it it is good for a scalp play even if it fails to break above mean. Nice I could imagine this could go much further.
// the HULL_FIB Strategy by SeaSide420
//
strategy("HULL_FIB Strategy", overlay=true,commission_type=strategy.commission.percent, commission_value=0.075, default_qty_type=strategy.percent_of_equity, max_bars_back=200, default_qty_value=100, calc_on_order_fills= true, calc_on_every_tick=true)
HMAlengthShort = input(42, minval=1)
HMAlengthLong = input(180, minval=1)
SL = input(defval=-10000, title="Stop Loss in $", type=float, step=1)
TP = input(defval=10000, title="Target Point in $", type=float, step=1)
FromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
FromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
FromYear = input(defval = 2017, title = "From Year", minval = 2017)
ToMonth = input(defval = 1, title = "To Month", minval = 1, maxval = 12)
ToDay = input(defval = 1, title = "To Day", minval = 1, maxval = 31)
ToYear = input(defval = 9999, title = "To Year", minval = 2017)
start = timestamp(FromYear, FromMonth, FromDay, 00, 00)
finish = timestamp(ToYear, ToMonth, ToDay, 23, 59)
window() => time >= start and time <= finish ? true : false
price = input(ohlc4, title="Source")
func_hma(style, HMAlength)=>
return = wma((2 * wma(style, HMAlength / 2)) - wma(style, HMAlength), round(sqrt(HMAlength)))
double_smooth(price, long, short) =>
fist_smooth = ema(price, long)
func_hma(fist_smooth, short)
pc = change(price)
mult = input(3.0, minval=0.001, maxval=50)
basis = func_hma(price, HMAlengthLong)
dev = mult * stdev(price, HMAlengthLong)
upper_1= basis + (0.236*dev)
upper_2= basis + (0.382*dev)
upper_3= basis + (0.5*dev)
upper_4= basis + (0.618*dev)
upper_5= basis + (0.764*dev)
upper_6= basis + (1*dev)
lower_1= basis - (0.236*dev)
lower_2= basis - (0.382*dev)
lower_3= basis - (0.5*dev)
lower_4= basis - (0.618*dev)
lower_5= basis - (0.764*dev)
lower_6= basis - (1*dev)
plot(basis, color=orange, linewidth=2)
p1 = plot(upper_1, color=gray, linewidth=1, title="0.236")
p2 = plot(upper_2, color=gray, linewidth=1, title="0.382")
p3 = plot(upper_3, color=gray, linewidth=1, title="0.5")
p4 = plot(upper_4, color=black, linewidth=2, title="0.618")
p5 = plot(upper_5, color=gray, linewidth=1, title="0.764")
p6 = plot(upper_6, color=red, linewidth=2, title="1")
p13 = plot(lower_1, color=gray, linewidth=1, title="0.236")
p14 = plot(lower_2, color=gray, linewidth=1, title="0.382")
p15 = plot(lower_3, color=gray, linewidth=1, title="0.5")
p16 = plot(lower_4, color=black, linewidth=2, title="0.618")
p17 = plot(lower_5, color=gray, linewidth=1, title="0.764")
p18 = plot(lower_6, color=green, linewidth=2, title="1")
keh = price>func_hma(price, HMAlengthShort)?lime:red
plot(func_hma(price, HMAlengthShort), color=keh, linewidth=3)
strategy.close_all(when = strategy.openprofit<SL or strategy.openprofit>TP)
if (price>upper_4)
strategy.close("BUY")
if (price<lower_4)
strategy.close("SELL")
longCondition = price>func_hma(price, HMAlengthShort) and price<lower_4
shortConditi