UpTwoBucks
Active member
My Custom Watchlist and Gap Scans.
There are many codes below. Make sure to only copy the one mentioned in the video.
IMPORTANT NOTE: I made an error in the 1 minute, 5 minute and the 15 minute chart. In the video I say to use the same code for each one. This is not correct. Each one has it's own code. I have pasted them below.
%VSpike Code Below:
###Begin Code###
# Set the percentage threshold for the spike
def spike_percentage_threshold = 0.0;
# Calculate the relative volume for the current bar
def rel_vol = volume / Average(volume, 50);
# Calculate the percentage change in volume relative to the average volume
def vol_change_pct = (rel_vol - 1.0) * 100.0;
# Determine if the current bar has a volume spike
def is_spike = vol_change_pct >= spike_percentage_threshold;
# Define the label value as the percentage change in volume if it is a spike, otherwise NaN
def label_value = if is_spike then vol_change_pct else Double.NaN;
# Determine if the current bar is bullish or bearish based on the close price
def is_bullish = close > open;
def is_bearish = close < open;
# Add the label to the watch list
AddLabel(yes,
if is_spike and is_bullish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bullish")
else if is_spike and is_bearish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bearish")
else "",
if is_spike and is_bullish then Color.GREEN
else if is_spike and is_bearish then Color.LIGHT_RED
else Color.BLACK);
###End Code###
Gap and Run Code Below:
###Begin Code####
def price = close;
plot GapandRun = if (open - close[1])>0 and close > open then 100*(close/high) else 0;
###End Code###
1 Minute Chart Below:
###Begin Code###
input length = 14;
input ADXLevels = 20;
input averageType = AverageType.WILDERS;
def MinPlus;
def MinMinus;
def MinAdx;
def MinBullishSignal;
def MinBearishSignal;
def MinBullishZone;
def MinBearishZone;
def MinNeutralZone;
def MinHiDiff;
def MinLoDiff;
def MinPlusDM;
def MinMinusDM;
def MinDX;
if GetAggregationPeriod() <= AggregationPeriod.Min{
MinHiDiff = high(period = "1 Min") - high(period = "1 Min")[1];
MinLoDiff = low(period = "1 Min")[1] - low(period = "1 Min");
MinPlusDM = if MinHiDiff > MinLoDiff and MinHiDiff > 0 then MinHiDiff else 0;
MinMinusDM = if MinLoDiff > MinHiDiff and MinLoDiff > 0 then MinLoDiff else 0;
MinPlus = 100 * MovingAverage(averageType, MinPlusDM, length);
MinMinus = 100 * MovingAverage(averageType, MinMinusDM, length);
MinBullishSignal = MinPlus crosses above MinMinus;
MinBearishSignal = MinPlus crosses below MinMinus;
MinDX = if (MinPlus + MinMinus > 0) then 100 * AbsValue(MinPlus - MinMinus) / (MinPlus + MinMinus) else 0;
MinAdx = MovingAverage(averageType, MinDX, length);
MinBullishZone = MinPlus > MinMinus and MinADX >= ADXLevels;
MinBearishZone = MinPlus < MinMinus and MinADX >= ADXLevels;
MinNeutralZone = !MinBullishZone and !MinBearishZone;
}
else {
MinPlus = 0;
MinMinus = 0;
MinAdx = 0;
MinPlusDM = 0;
MinMinusDM = 0;
MinBullishSignal = 0;
MinBearishSignal = 0;
MinDX = 0;
MinBullishZone = 0;
MinBearishZone = 0;
MinNeutralZone = 0;
MinHiDiff = 0;
MinLoDiff = 0;
}
AddLabel(MinBullishZone, "1m", color.green); AddLabel(MinBearishZone, "1m", color.red); AddLabel(MinNeutralZone, "1m", color.yellow);
###End Code###
5 Minute Chart
###Begin Code###
input length = 14;
input ADXLevels = 20;
input averageType = AverageType.WILDERS;
def fiveMinPlus;
def fiveMinMinus;
def fiveMinAdx;
def fiveMinBullishSignal;
def fiveMinBearishSignal;
def fiveMinBullishZone;
def fiveMinBearishZone;
def fiveMinNeutralZone;
def fiveMinHiDiff;
def fiveMinLoDiff;
def fiveMinPlusDM;
def fiveMinMinusDM;
def fiveMinDX;
if GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN {
fiveMinHiDiff = high(period = "5 Min") - high(period = "5 Min")[1];
fiveMinLoDiff = low(period = "5 Min")[1] - low(period = "5 Min");
fiveMinPlusDM = if fiveMinHiDiff > fiveMinLoDiff and fiveMinHiDiff > 0 then fiveMinHiDiff else 0;
fiveMinMinusDM = if fiveMinLoDiff > fiveMinHiDiff and fiveMinLoDiff > 0 then fiveMinLoDiff else 0;
fiveMinPlus = 100 * MovingAverage(averageType, fiveMinPlusDM, length);
fiveMinMinus = 100 * MovingAverage(averageType, fiveMinMinusDM, length);
fiveMinBullishSignal = fiveMinPlus crosses above fiveMinMinus;
fiveMinBearishSignal = fiveMinPlus crosses below fiveMinMinus;
fiveMinDX = if (fiveMinPlus + fiveMinMinus > 0) then 100 * AbsValue(fiveMinPlus - fiveMinMinus) / (fiveMinPlus + fiveMinMinus) else 0;
fiveMinAdx = MovingAverage(averageType, fiveMinDX, length);
fiveMinBullishZone = fiveMinPlus > fiveMinMinus and fiveMinAdx >= ADXLevels;
fiveMinBearishZone = fiveMinPlus < fiveMinMinus and fiveMinAdx >= ADXLevels;
fiveMinNeutralZone = !fiveMinBullishZone and !fiveMinBearishZone;
}
else {
fiveMinPlus = 0;
fiveMinMinus = 0;
fiveMinAdx = 0;
fiveMinPlusDM = 0;
fiveMinMinusDM = 0;
fiveMinBullishSignal = 0;
fiveMinBearishSignal = 0;
fiveMinDX = 0;
fiveMinBullishZone = 0;
fiveMinBearishZone = 0;
fiveMinNeutralZone = 0;
fiveMinHiDiff = 0;
fiveMinLoDiff = 0;
}
AddLabel(fiveMinBullishZone, "5m", Color.GREEN);
AddLabel(fiveMinBearishZone, "5m", Color.RED);
AddLabel(fiveMinNeutralZone, "5m", Color.YELLOW);
###End Code###
15 Minute Chart
###Begin Code###
input length = 14;
input ADXLevels = 20;
input averageType = AverageType.WILDERS;
def fifteenMinPlus;
def fifteenMinMinus;
def fifteenMinAdx;
def fifteenMinBullishSignal;
def fifteenMinBearishSignal;
def fifteenMinBullishZone;
def fifteenMinBearishZone;
def fifteenMinNeutralZone;
def fifteenMinHiDiff;
def fifteenMinLoDiff;
def fifteenMinPlusDM;
def fifteenMinMinusDM;
def fifteenMinDX;
if GetAggregationPeriod() <= AggregationPeriod.fifteen_Min{
fifteenMinHiDiff = high(period = "15 Min") - high(period = "15 Min")[1];
fifteenMinLoDiff = low(period = "15 Min")[1] - low(period = "15 Min");
fifteenMinPlusDM = if fifteenMinHiDiff > fifteenMinLoDiff and fifteenMinHiDiff > 0 then fifteenMinHiDiff else 0;
fifteenMinMinusDM = if fifteenMinLoDiff > fifteenMinHiDiff and fifteenMinLoDiff > 0 then fifteenMinLoDiff else 0;
fifteenMinPlus = 100 * MovingAverage(averageType, fifteenMinPlusDM, length);
fifteenMinMinus = 100 * MovingAverage(averageType, fifteenMinMinusDM, length);
fifteenMinBullishSignal = fifteenMinPlus crosses above fifteenMinMinus;
fifteenMinBearishSignal = fifteenMinPlus crosses below fifteenMinMinus;
fifteenMinDX = if (fifteenMinPlus + fifteenMinMinus > 0) then 100 * AbsValue(fifteenMinPlus - fifteenMinMinus) / (fifteenMinPlus + fifteenMinMinus) else 0;
fifteenMinAdx = MovingAverage(averageType, fifteenMinDX, length);
fifteenMinBullishZone = fifteenMinPlus > fifteenMinMinus and fifteenMinADX >= ADXLevels;
fifteenMinBearishZone = fifteenMinPlus < fifteenMinMinus and fifteenMinADX >= ADXLevels;
fifteenMinNeutralZone = !fifteenMinBullishZone and !fifteenMinBearishZone;
}
else {
fifteenMinPlus = 0;
fifteenMinMinus = 0;
fifteenMinAdx = 0;
fifteenMinPlusDM = 0;
fifteenMinMinusDM = 0;
fifteenMinBullishSignal = 0;
fifteenMinBearishSignal = 0;
fifteenMinDX = 0;
fifteenMinBullishZone = 0;
fifteenMinBearishZone = 0;
fifteenMinNeutralZone = 0;
fifteenMinHiDiff = 0;
fifteenMinLoDiff = 0;
}
AddLabel(fifteenMinBullishZone, "15m", color.green); AddLabel(fifteenMinBearishZone, "15m", color.red); AddLabel(fifteenMinNeutralZone, "15m", color.yellow);
###End Code###
Relative Volume Code Below:
###Begin Code###
def rVol = volume / Average(volume, 50)[1];
AddLabel(yes, round(rVol,2));
###End Code###
Gap and Run Scan (Shared Link): https://tos.mx/m31lIxC
Gap and Run Watchlist (Shared Link): https://tos.mx/ltsXYEK
My Desktop: http://tos.mx/5fykLmv
There are many codes below. Make sure to only copy the one mentioned in the video.
IMPORTANT NOTE: I made an error in the 1 minute, 5 minute and the 15 minute chart. In the video I say to use the same code for each one. This is not correct. Each one has it's own code. I have pasted them below.
%VSpike Code Below:
###Begin Code###
# Set the percentage threshold for the spike
def spike_percentage_threshold = 0.0;
# Calculate the relative volume for the current bar
def rel_vol = volume / Average(volume, 50);
# Calculate the percentage change in volume relative to the average volume
def vol_change_pct = (rel_vol - 1.0) * 100.0;
# Determine if the current bar has a volume spike
def is_spike = vol_change_pct >= spike_percentage_threshold;
# Define the label value as the percentage change in volume if it is a spike, otherwise NaN
def label_value = if is_spike then vol_change_pct else Double.NaN;
# Determine if the current bar is bullish or bearish based on the close price
def is_bullish = close > open;
def is_bearish = close < open;
# Add the label to the watch list
AddLabel(yes,
if is_spike and is_bullish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bullish")
else if is_spike and is_bearish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bearish")
else "",
if is_spike and is_bullish then Color.GREEN
else if is_spike and is_bearish then Color.LIGHT_RED
else Color.BLACK);
###End Code###
Gap and Run Code Below:
###Begin Code####
def price = close;
plot GapandRun = if (open - close[1])>0 and close > open then 100*(close/high) else 0;
###End Code###
1 Minute Chart Below:
###Begin Code###
input length = 14;
input ADXLevels = 20;
input averageType = AverageType.WILDERS;
def MinPlus;
def MinMinus;
def MinAdx;
def MinBullishSignal;
def MinBearishSignal;
def MinBullishZone;
def MinBearishZone;
def MinNeutralZone;
def MinHiDiff;
def MinLoDiff;
def MinPlusDM;
def MinMinusDM;
def MinDX;
if GetAggregationPeriod() <= AggregationPeriod.Min{
MinHiDiff = high(period = "1 Min") - high(period = "1 Min")[1];
MinLoDiff = low(period = "1 Min")[1] - low(period = "1 Min");
MinPlusDM = if MinHiDiff > MinLoDiff and MinHiDiff > 0 then MinHiDiff else 0;
MinMinusDM = if MinLoDiff > MinHiDiff and MinLoDiff > 0 then MinLoDiff else 0;
MinPlus = 100 * MovingAverage(averageType, MinPlusDM, length);
MinMinus = 100 * MovingAverage(averageType, MinMinusDM, length);
MinBullishSignal = MinPlus crosses above MinMinus;
MinBearishSignal = MinPlus crosses below MinMinus;
MinDX = if (MinPlus + MinMinus > 0) then 100 * AbsValue(MinPlus - MinMinus) / (MinPlus + MinMinus) else 0;
MinAdx = MovingAverage(averageType, MinDX, length);
MinBullishZone = MinPlus > MinMinus and MinADX >= ADXLevels;
MinBearishZone = MinPlus < MinMinus and MinADX >= ADXLevels;
MinNeutralZone = !MinBullishZone and !MinBearishZone;
}
else {
MinPlus = 0;
MinMinus = 0;
MinAdx = 0;
MinPlusDM = 0;
MinMinusDM = 0;
MinBullishSignal = 0;
MinBearishSignal = 0;
MinDX = 0;
MinBullishZone = 0;
MinBearishZone = 0;
MinNeutralZone = 0;
MinHiDiff = 0;
MinLoDiff = 0;
}
AddLabel(MinBullishZone, "1m", color.green); AddLabel(MinBearishZone, "1m", color.red); AddLabel(MinNeutralZone, "1m", color.yellow);
###End Code###
5 Minute Chart
###Begin Code###
input length = 14;
input ADXLevels = 20;
input averageType = AverageType.WILDERS;
def fiveMinPlus;
def fiveMinMinus;
def fiveMinAdx;
def fiveMinBullishSignal;
def fiveMinBearishSignal;
def fiveMinBullishZone;
def fiveMinBearishZone;
def fiveMinNeutralZone;
def fiveMinHiDiff;
def fiveMinLoDiff;
def fiveMinPlusDM;
def fiveMinMinusDM;
def fiveMinDX;
if GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN {
fiveMinHiDiff = high(period = "5 Min") - high(period = "5 Min")[1];
fiveMinLoDiff = low(period = "5 Min")[1] - low(period = "5 Min");
fiveMinPlusDM = if fiveMinHiDiff > fiveMinLoDiff and fiveMinHiDiff > 0 then fiveMinHiDiff else 0;
fiveMinMinusDM = if fiveMinLoDiff > fiveMinHiDiff and fiveMinLoDiff > 0 then fiveMinLoDiff else 0;
fiveMinPlus = 100 * MovingAverage(averageType, fiveMinPlusDM, length);
fiveMinMinus = 100 * MovingAverage(averageType, fiveMinMinusDM, length);
fiveMinBullishSignal = fiveMinPlus crosses above fiveMinMinus;
fiveMinBearishSignal = fiveMinPlus crosses below fiveMinMinus;
fiveMinDX = if (fiveMinPlus + fiveMinMinus > 0) then 100 * AbsValue(fiveMinPlus - fiveMinMinus) / (fiveMinPlus + fiveMinMinus) else 0;
fiveMinAdx = MovingAverage(averageType, fiveMinDX, length);
fiveMinBullishZone = fiveMinPlus > fiveMinMinus and fiveMinAdx >= ADXLevels;
fiveMinBearishZone = fiveMinPlus < fiveMinMinus and fiveMinAdx >= ADXLevels;
fiveMinNeutralZone = !fiveMinBullishZone and !fiveMinBearishZone;
}
else {
fiveMinPlus = 0;
fiveMinMinus = 0;
fiveMinAdx = 0;
fiveMinPlusDM = 0;
fiveMinMinusDM = 0;
fiveMinBullishSignal = 0;
fiveMinBearishSignal = 0;
fiveMinDX = 0;
fiveMinBullishZone = 0;
fiveMinBearishZone = 0;
fiveMinNeutralZone = 0;
fiveMinHiDiff = 0;
fiveMinLoDiff = 0;
}
AddLabel(fiveMinBullishZone, "5m", Color.GREEN);
AddLabel(fiveMinBearishZone, "5m", Color.RED);
AddLabel(fiveMinNeutralZone, "5m", Color.YELLOW);
###End Code###
15 Minute Chart
###Begin Code###
input length = 14;
input ADXLevels = 20;
input averageType = AverageType.WILDERS;
def fifteenMinPlus;
def fifteenMinMinus;
def fifteenMinAdx;
def fifteenMinBullishSignal;
def fifteenMinBearishSignal;
def fifteenMinBullishZone;
def fifteenMinBearishZone;
def fifteenMinNeutralZone;
def fifteenMinHiDiff;
def fifteenMinLoDiff;
def fifteenMinPlusDM;
def fifteenMinMinusDM;
def fifteenMinDX;
if GetAggregationPeriod() <= AggregationPeriod.fifteen_Min{
fifteenMinHiDiff = high(period = "15 Min") - high(period = "15 Min")[1];
fifteenMinLoDiff = low(period = "15 Min")[1] - low(period = "15 Min");
fifteenMinPlusDM = if fifteenMinHiDiff > fifteenMinLoDiff and fifteenMinHiDiff > 0 then fifteenMinHiDiff else 0;
fifteenMinMinusDM = if fifteenMinLoDiff > fifteenMinHiDiff and fifteenMinLoDiff > 0 then fifteenMinLoDiff else 0;
fifteenMinPlus = 100 * MovingAverage(averageType, fifteenMinPlusDM, length);
fifteenMinMinus = 100 * MovingAverage(averageType, fifteenMinMinusDM, length);
fifteenMinBullishSignal = fifteenMinPlus crosses above fifteenMinMinus;
fifteenMinBearishSignal = fifteenMinPlus crosses below fifteenMinMinus;
fifteenMinDX = if (fifteenMinPlus + fifteenMinMinus > 0) then 100 * AbsValue(fifteenMinPlus - fifteenMinMinus) / (fifteenMinPlus + fifteenMinMinus) else 0;
fifteenMinAdx = MovingAverage(averageType, fifteenMinDX, length);
fifteenMinBullishZone = fifteenMinPlus > fifteenMinMinus and fifteenMinADX >= ADXLevels;
fifteenMinBearishZone = fifteenMinPlus < fifteenMinMinus and fifteenMinADX >= ADXLevels;
fifteenMinNeutralZone = !fifteenMinBullishZone and !fifteenMinBearishZone;
}
else {
fifteenMinPlus = 0;
fifteenMinMinus = 0;
fifteenMinAdx = 0;
fifteenMinPlusDM = 0;
fifteenMinMinusDM = 0;
fifteenMinBullishSignal = 0;
fifteenMinBearishSignal = 0;
fifteenMinDX = 0;
fifteenMinBullishZone = 0;
fifteenMinBearishZone = 0;
fifteenMinNeutralZone = 0;
fifteenMinHiDiff = 0;
fifteenMinLoDiff = 0;
}
AddLabel(fifteenMinBullishZone, "15m", color.green); AddLabel(fifteenMinBearishZone, "15m", color.red); AddLabel(fifteenMinNeutralZone, "15m", color.yellow);
###End Code###
Relative Volume Code Below:
###Begin Code###
def rVol = volume / Average(volume, 50)[1];
AddLabel(yes, round(rVol,2));
###End Code###
Gap and Run Scan (Shared Link): https://tos.mx/m31lIxC
Gap and Run Watchlist (Shared Link): https://tos.mx/ltsXYEK
My Desktop: http://tos.mx/5fykLmv
Last edited: