Daniel7895
New member
I'm having troubles with scanning a customized indicator, on chart the indicator works just fine but the scanner can not seem to scan for it when extended hours is checked off.
Demonstration.
The code for this indicator:
It is based on an indicator from this article: https://traders.com/Documentation/FEEDbk_docs/2024/01/TradersTips.html
And further investigated on Tradingview: https://www.tradingview.com/script/52wKLj6P-TASC-2024-01-Gap-Momentum-System/
Demonstration.
The code for this indicator:
Code:
input Period = 300;
input SignalPeriod = 150;
def Gap = open - close[1];
def gapUp;
if Gap > 0
then {
gapUp = Gap;
} else {
gapUp = 0;
}
def gapDn;
if Gap < 0
then {
gapDn = 0 - Gap;
} else {
gapDn = 0;
}
def gapsUp = Sum(gapUp, Period);
def gapsDn = Sum(gapDn, Period);
def gapRatio;
if gapsDn == 0
then {
gapRatio = 1;
} else {
gapRatio = 100.0 * gapsUp / gapsDn;
}
def Signal;
if close > 0
then {
Signal = SimpleMovingAvg(gapRatio, SignalPeriod);
} else {
Signal = double.NaN;
}
def Ratio;
if close > 0
then {
Ratio = gapRatio;
} else {
Ratio = double.NaN;
}
plot Buy = Signal > Signal[1];
It is based on an indicator from this article: https://traders.com/Documentation/FEEDbk_docs/2024/01/TradersTips.html
And further investigated on Tradingview: https://www.tradingview.com/script/52wKLj6P-TASC-2024-01-Gap-Momentum-System/