Binary Options Safety
Binary Options Safety
src = close[0]
zero = 0.00
block = 'QUANDL:BCHAIN/AVBLS'
bsize = 'QUANDL:BCHAIN/BLCHS'
// MINERS REVENUE
minrev = 'QUANDL:BCHAIN/MIREV'
// HASH RATE
hrate = 'QUANDL:BCHAIN/HRATE'
cptra = 'QUANDL:BCHAIN/CPTRA'
trvou = 'QUANDL:BCHAIN/TRVOU'
ntrat = 'QUANDL:BCHAIN/NTRAT'
// CHANGE
tangentdiff(_src) =>
nz((_src - _src[1]) / _src[1])
ActivationFunctionTanh(v) =>
(1 - math.exp(-2 * v)) / (1 + math.exp(-2 * v))
// DEEP LEARNING
// INPUTS :
input_1 = tangentdiff(_indicator1)
input_2 = tangentdiff(_indicator2)
input_3 = tangentdiff(_indicator3)
input_4 = tangentdiff(_indicator4)
input_5 = tangentdiff(_indicator5)
input_6 = tangentdiff(_indicator6)
input_7 = tangentdiff(_indicator7)
// LAYERS :
// Input Layers
n_0 = ActivationFunctionTanh(input_1 + 0)
n_1 = ActivationFunctionTanh(input_2 + 0)
n_2 = ActivationFunctionTanh(input_3 + 0)
n_3 = ActivationFunctionTanh(input_4 + 0)
n_4 = ActivationFunctionTanh(input_5 + 0)
n_5 = ActivationFunctionTanh(input_6 + 0)
n_6 = ActivationFunctionTanh(input_7 + 0)
// Hidden Layer 1 Node :
// OUTPUT
// Plot data
// MACD : SEED
fastLength = 12
slowlength = 26
signalLength = 9
//---------------------------------------------------------------------------------
------------------------//
//Range&Trend Filter
// —————————————————————————————————————————————————————————————————————————————
// —————————— SuperTrend
var up = 1
up := up != 1 and close > (showRange ? downRange : downTrend) ? 1 : up == 1 and
close < upTrend ? -1 : up
var down = 1
down := down != 1 and close < (showRange ? upRange : upTrend) ? 1 : down == 1 and
close > downTrend ? -1 : down
// —————————————————————————————————————————————————————————————————————————————
// —————————— Plot
lengthzx = input(50)
srczx = input(close)
//----
azx = 0.
bzx = 0.
azx := math.max(srczx, nz(azx[1])) - nz(azx[1] - bzx[1]) / lengthzx
bzx := math.min(srczx, nz(bzx[1])) + nz(azx[1] - bzx[1]) / lengthzx
avgzx = math.avg(azx, bzx)
//----
crossup = bzx[1] < close[1] and bzx > close
crossdn = azx[1] < close[1] and azx > close
bullish = ta.barssince(crossdn) <= ta.barssince(crossup)
czx = bullish ? color.lime : color.red
//--------------------//
// Next candle//
periodKcc = input.int(5, title='%K', minval=1)
smoothKcc = input.int(1, title='Smooth', minval=1)
kcc = ta.sma(ta.stoch(close, high, low, periodKcc), smoothKcc)
/////////////////////////////////////
/// Params
shape_loc = location.belowbar
shape_style = shape.labelup
////////////////////////////////////
/// Patterns
// Inside bars
ibar_0 = high < high[1] and low > low[1] and bullish
ibar_1 = high < high[2] and low > low[2] and high[1] < high[2] and low[1] > low[2]
and bullish
ibar_2 = high < high[3] and low > low[3] and high[1] < high[3] and low[1] > low[3]
and high[2] < high[3] and low[2] > low[3] and bullish
// Outside bars
obar_0 = high > high[1] and low < low[1] and bullish
obar_1 = high > high[2] and low < low[2] and high[1] > high[2] and low[1] < low[2]
and bullish
obar_2 = high > high[3] and low < low[3] and high[1] > high[3] and low[1] < low[3]
and high[2] > high[3] and low[2] < low[3] and bullish
////////////////////////////////////
/// Plot patterns
plotshape(ibar_0, title='Inside_bar', location=shape_loc, color=color.new(#013220,
0), style=shape.labelup, textcolor=color.new(#ffffff, 0), text='Call')
//--------------------//
// Conditions :
bullishPSAR = psar < high and psar[1] > low and hist < 0 and upTrend and bullish
and kcc > rsicc
bearishPSAR = psar > low and psar[1] < high and hist > 0 and downTrend and not
bullish and rsicc > kcc