//@version=5
indicator(title="Gaussian Signals & Candle [AlgoPoint]", overlay=true)
//Filter function
title = 'AlgoPoint'
//text positioning
textVPosition = 'middle'
textHPosition = 'center'
//symbol info positioning
symVPosition = 'top'
symHPosition = 'left'
//cell size
width = 0
height = 0
//title settings
c_title = [Link]([Link], 50)
s_title = 'large'
a_title = 'center'
//subtitle settings
c_subtitle = [Link]([Link], 50)
s_subtitle = 'normal'
a_subtitle = 'center'
f_filt9x (_a, _s, _i) =>
int _m2 = 0, int _m3 = 0, int _m4 = 0, int _m5 = 0, int _m6 = 0,
int _m7 = 0, int _m8 = 0, int _m9 = 0, float _f = .0, _x = (1 - _a)
// Weights.
// Initial weight _m1 is a pole number and equal to _i
_m2 := _i == 9 ? 36 : _i == 8 ? 28 : _i == 7 ? 21 : _i == 6 ? 15 : _i == 5 ?
10 : _i == 4 ? 6 : _i == 3 ? 3 : _i == 2 ? 1 : 0
_m3 := _i == 9 ? 84 : _i == 8 ? 56 : _i == 7 ? 35 : _i == 6 ? 20 : _i == 5 ?
10 : _i == 4 ? 4 : _i == 3 ? 1 : 0
_m4 := _i == 9 ? 126 : _i == 8 ? 70 : _i == 7 ? 35 : _i == 6 ? 15 : _i == 5 ? 5
: _i == 4 ? 1 : 0
_m5 := _i == 9 ? 126 : _i == 8 ? 56 : _i == 7 ? 21 : _i == 6 ? 6 : _i == 5 ? 1
: 0
_m6 := _i == 9 ? 84 : _i == 8 ? 28 : _i == 7 ? 7 : _i == 6 ? 1 : 0
_m7 := _i == 9 ? 36 : _i == 8 ? 8 : _i == 7 ? 1 : 0
_m8 := _i == 9 ? 9 : _i == 8 ? 1 : 0
_m9 := _i == 9 ? 1 : 0
// filter
_f := [Link](_a, _i) * nz(_s) +
_i * _x * nz(_f[1]) - (_i >= 2 ?
_m2 * [Link](_x, 2) * nz(_f[2]) : 0) + (_i >= 3 ?
_m3 * [Link](_x, 3) * nz(_f[3]) : 0) - (_i >= 4 ?
_m4 * [Link](_x, 4) * nz(_f[4]) : 0) + (_i >= 5 ?
_m5 * [Link](_x, 5) * nz(_f[5]) : 0) - (_i >= 6 ?
_m6 * [Link](_x, 6) * nz(_f[6]) : 0) + (_i >= 7 ?
_m7 * [Link](_x, 7) * nz(_f[7]) : 0) - (_i >= 8 ?
_m8 * [Link](_x, 8) * nz(_f[8]) : 0) + (_i == 9 ?
_m9 * [Link](_x, 9) * nz(_f[9]) : 0)
//9 var declaration fun
f_pole (_a, _s, _i) =>
_f1 = f_filt9x(_a, _s, 1), _f2 = (_i >= 2 ? f_filt9x(_a, _s, 2)
: 0), _f3 = (_i >= 3 ? f_filt9x(_a, _s, 3) : 0)
_f4 = (_i >= 4 ? f_filt9x(_a, _s, 4) : 0), _f5 = (_i >= 5 ? f_filt9x(_a, _s, 5)
: 0), _f6 = (_i >= 6 ? f_filt9x(_a, _s, 6) : 0)
_f7 = (_i >= 2 ? f_filt9x(_a, _s, 7) : 0), _f8 = (_i >= 8 ? f_filt9x(_a, _s, 8)
: 0), _f9 = (_i == 9 ? f_filt9x(_a, _s, 9) : 0)
_fn = _i == 1 ? _f1 : _i == 2 ? _f2 : _i == 3 ? _f3 :
_i == 4 ? _f4 : _i == 5 ? _f5 : _i == 6 ? _f6 :
_i == 7 ? _f7 : _i == 8 ? _f8 : _i == 9 ? _f9 : na
[_fn, _f1]
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
//Inputs
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
subtitle = 'All Leaked Algos | IG: algopoint'
//Poles
int N = title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG: algopoint' and
textVPosition == 'middle' and textHPosition == 'center' and c_title ==
[Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' ? [Link](defval=6, title="Factor", minval=1, maxval=9) : na
//Period
int per = title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG: algopoint'
and textVPosition == 'middle' and textHPosition == 'center' and c_title ==
[Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' ? [Link](defval=55, title="Agility %", minval=2) : na
//True Range Multiplier
float mult = title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG:
algopoint' and textVPosition == 'middle' and textHPosition == 'center' and c_title
== [Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' ? [Link](defval=28, title="Sensitivity", minval=0) : na
//Lag Reduction
bool modeLag = title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG:
algopoint' and textVPosition == 'middle' and textHPosition == 'center' and c_title
== [Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' ? [Link](defval=false, title="2nd Calculation Method (Not
Recommended)") : na
bool modeFast = title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG:
algopoint' and textVPosition == 'middle' and textHPosition == 'center' and c_title
== [Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' ? [Link](defval=false, title="Fast Response Mode (Not
Recommended)") : na
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
//Definitions
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
src = low
//Beta and Alpha Components
beta = (1 - [Link](4*[Link](1)/per)) / ([Link](1.414, 2/N) - 1)
alpha = - beta + [Link]([Link](beta, 2) + 2*beta)
//Lag
lag = (per - 1)/(2*N)
//Data
srcdata = modeLag ? src + (src - src[lag]) : src
trdata = modeLag ? [Link](true) + ([Link](true) - [Link](true)[lag]) : [Link](true)
//Filtered Values
[filtn, filt1] = f_pole(alpha, srcdata, N)
[filtntr, filt1tr] = f_pole(alpha, trdata, N)
//Lag Reduction
filt = modeFast ? (filtn + filt1)/2 : filtn
filttr = modeFast ? (filtntr + filt1tr)/2 : filtntr
//Bands
hband = filt + filttr*((mult + 14) / 31)
lband = filt - filttr*((mult + 14) / 31)
// Colors
barcolor = close > hband and title == 'AlgoPoint' and subtitle == 'All Leaked Algos
| IG: algopoint' and textVPosition == 'middle' and textHPosition == 'center' and
c_title == [Link]([Link], 50) and s_title == 'large' and a_title ==
'center' and c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal'
and a_subtitle == 'center' ? #00cf4b : open < lband and close < lband and title ==
'AlgoPoint' and subtitle == 'All Leaked Algos | IG: algopoint' and textVPosition ==
'middle' and textHPosition == 'center' and c_title == [Link]([Link], 50)
and s_title == 'large' and a_title == 'center' and c_subtitle ==
[Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle == 'center' ?
#ff1100 : title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG: algopoint'
and textVPosition == 'middle' and textHPosition == 'center' and c_title ==
[Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' ? #56328f : na
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
//Outputs
//---------------------------------------------------------------------------------
--------------------------------------------------------------------------------
//Bar Color
barcolor(barcolor)
// buy and sell signals
var alrBuy = false
var alrSell = false
buyCond = open < filt ? [Link](close, filt) and not alrBuy :
[Link](close, hband) and not alrBuy
sellCond = open > hband ? [Link](close, hband) and not alrSell :
[Link](close, lband) and not alrSell
if buyCond
alrBuy := true
alrSell := false
if sellCond
alrBuy := false
alrSell := true
plotshape(buyCond and title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG:
algopoint' and textVPosition == 'middle' and textHPosition == 'center' and c_title
== [Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center', text = "BUY", color = [Link](#00f00c, 35), textcolor = #ffffff,
size = [Link], location = [Link], style = [Link])
plotshape(sellCond and title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG:
algopoint' and textVPosition == 'middle' and textHPosition == 'center' and c_title
== [Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' , text = "SELL", color = [Link](#ff1000, 35), textcolor = #ffffff,
size = [Link], location = [Link], style = [Link])
//
// title == 'AlgoPoint' and subtitle == 'All Leaked Algos | IG: algopoint' and
textVPosition == 'middle' and textHPosition == 'center' and c_title ==
[Link]([Link], 50) and s_title == 'large' and a_title == 'center' and
c_subtitle == [Link]([Link], 50) and s_subtitle == 'normal' and a_subtitle
== 'center' ?
//text inputs
//symbol info
symInfoCheck = false
symInfo = [Link] + ' | ' + [Link] + ([Link] ? 'M' :
na)
date = [Link](dayofmonth(time_close)) + '/' + [Link](month(time_close))
+ '/' + [Link](year(time_close))
//symbol settings
c_symInfo = [Link]([Link], 50)
s_symInfo = 'normal'
a_symInfo = 'center'
c_bg = [Link]([Link], 100)
//text watermark creation
textWatermark = [Link](textVPosition + '_' + textHPosition, 1, 3)
[Link](textWatermark, 0, 0, title, width, height, c_title, a_title,
text_size=s_title, bgcolor=c_bg)
[Link](textWatermark, 0, 1, subtitle, width, height, c_subtitle, a_subtitle,
text_size=s_subtitle, bgcolor=c_bg)
//symbol info watermark creation
symWatermark = [Link](symVPosition + '_' + symHPosition, 5, 5)
if symInfoCheck == true
[Link](symWatermark, 0, 1, symInfo, width, height, c_symInfo, a_symInfo,
text_size=s_symInfo, bgcolor=c_bg)
[Link](symWatermark, 0, 0, date, width, height, c_symInfo, a_symInfo,
text_size=s_symInfo, bgcolor=c_bg)