ProRealCode - Trading & Coding with ProRealTime™
This is my last one to convert. I’m still looking for similar without converting, but no luck yet. I use it as a confirmation of other signals. Its a doozy:
TOS script:
declare lower;
script PhiSmoother {
input Source = close;
input length = 10;
input Phase = 3.7;
def pi = Double.Pi;
def SQRT_PIx2 = Sqrt(2.0 * pi);
def MULTIPLIER = -0.5 / 0.93;
def sma2 = Average(Source, 2);
def length_2 = length * 0.52353;
def W = fold i = 0 to length with p do
p + sma2[i] * if ((i + Phase – length_2) * MULTIPLIER) < 0.0 then
(1.0 - ((Exp(Power(((i + Phase - length_2) * MULTIPLIER), 2) * -0.5)
* -0.39894228) * (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 0.319381530 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-0.356563782 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 1.781477937 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-1.821255978 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0))
* 1.330274429)))) + 1.011)) / SQRT_PIx2 else
(((Exp(Power(((i + Phase - length_2) * MULTIPLIER), 2) * -0.5)
* -0.39894228) * (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 0.31938153 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-0.356563782 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 1.781477937 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-1.821255978 + (1.0 / (0.2316419 * AbsValue(((i + Phase - length_2) * MULTIPLIER)) + 1.0))
* 1.330274429)))) + 1.011)) / SQRT_PIx2;
def E = fold j = 0 to length with q do
q + if ((j + Phase - length_2) * MULTIPLIER) < 0.0 then
(1.0 - ((Exp(Power(((j + Phase - length_2) * MULTIPLIER), 2) * -0.5)
* -0.39894228) * (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 0.31938153 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-0.356563782 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 1.781477937 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-1.821255978 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0))
* 1.330274429)))) + 1.011)) / SQRT_PIx2 else
(((Exp(Power(((j + Phase - length_2) * MULTIPLIER), 2) * -0.5)
* -0.39894228) * (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 0.31938153 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-0.356563782 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
( 1.781477937 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0)) *
(-1.821255978 + (1.0 / (0.2316419 * AbsValue(((j + Phase - length_2) * MULTIPLIER)) + 1.0))
* 1.330274429)))) + 1.011)) / SQRT_PIx2;
def PhiSmoother = W / E;
plot out = PhiSmoother;
}
script filter {
input source = close;
input length = 10;
input phase = 3.7;
input filterType = "PhiSmoother";
input rank = 0;
input trimUp = 0;
input trimDn = 0;
def phiFilter = PhiSmoother(source, length, phase);
def filter = if filterType== "EMA" then ExpAverage(source, length) else
if filterType== "DEMA" then DEMA(source, length) else
if filterType== "TEMA" then TEMA(source, length) else
if filterType== "WMA" then WMA(source, length) else
if filterType== "SMA" then Average(source, length) else phiFilter;
def return = if length > 1 and !isNaN(filter) then filter else source;
def cond = (rank >= trimUp) and ((16 – rank) >= trimDn);
plot out = if cond then return else 0;
}
#Hint CompositeClusterMode: Trend Strength visualizes the directionality of the filter cluster. Volatility weights the score to the bandwidth of the cluster.
#hint ClusterFilter: Choose a filter to build the moving average cluster with.
#Hint PhiSmootherPhase: This allows for subtle adjustment (tweaking) of the phase/lag for PhiSmoother.
#Hint ClusterDispersion: Choose the separation between the moving averages in the cluster.
#Hint upper_trim: Adjusts the shortest period of the moving averages. Increasing the upper value reduces sensitivity.
#Hint lower_trim: Adjusts the longest period of the moving averages. Increasing the lower value heightens sensitivity.
#Hint signal_length: Period of the momentum signal plot.
#Hint transition_easing: Adjust the sensitivity to ranging conditions.
input timeframe = {Default “Chart”, “Custom”};
input customTimeframe = AggregationPeriod.FIFTEEN_MIN;
input price = FundamentalType.CLOSE; # “Source”
input CompositeClusterMode = {default “Trend Strength”, “Volatility”}; # “Composite Cluster Mode”
input ClusterFilter = {default “PhiSmoother”, “EMA”, “DEMA”, “TEMA”, “WMA”, “SMA”}; # “Cluster Filter”
input PhiSmootherPhase = 3.7; # “???PhiSmoother Phase”
input ClusterDispersion = 3; # “Cluster Dispersion”
input upper_trim = 0; # “Cluster Trim – Upper:”
input lower_trim = 0; # “??Lower:”
input PostSmoothFilter = {default “PhiSmoother”, “EMA”, “DEMA”, “TEMA”, “WMA”, “SMA”}; # “PostSmooth – Filter:”
input PostSmoothLength = 1; #, “??Length:”, group=output, inline=”post”, minval=1, tooltip=”Period of the clu
input signal_filter = {default “PhiSmoother”, “EMA”, “DEMA”, “TEMA”, “WMA”, “SMA”}; #]”Signal – Filter:”
input signal_length = 20; #, “??Length:”
input upperLevel = 75.00; #, “Levels – Upper:”,
input lowerLevel = -75.00; #, “??Lower:”
input candle_color = no; # “Candle Coloring”
input transition_easing = 50.0; #, “Transition Easing”
def source;
Switch (timeframe) {
Case “Custom” : source = Fundamental(FundamentalType = price, Period = customTimeframe);
Default : source = Fundamental(FundamentalType = price);
}
def na = Double.NaN;
def last = IsNaN(close);
def Phase = PhiSmootherPhase;
def spacing = Min(Max(ClusterDispersion, 1), 10);
def VOLATILITY_MODE_ON = CompositeClusterMode == CompositeClusterMode.”Volatility”;
def upper = Min(Max(upper_trim, 0), 15);
def lower = Min(Max(lower_trim, 0), 15);
def trimUp = if (upper + lower) > 15 then if upper > lower then upper – lower else upper else upper;
def trimDn = if (upper + lower) > 15 then if upper > lower then lower else lower – upper else lower;
#– Colors
DefineGlobalColor(“rising_bullish”, CreateColor(255, 204, 0)); # “Bullish Color”
DefineGlobalColor(“falling_bullish”, CreateColor(253, 240, 185)); # “bull”)
DefineGlobalColor(“falling_bearish”, CreateColor(85, 0, 204)); # “bear”
DefineGlobalColor(“rising_bearish”, CreateColor(181, 128, 255)); #”bear”
script z {
input cluster = close;
def pos = Double.POSITIVE_INFINITY;
def cond = cluster <= 0;
def z = if cond then pos else cluster;
plot out = z;
}
script getScore {
input vv = 0;
input v0 = 0;
input v1 = 0;
input v2 = 0;
input v3 = 0;
input v4 = 0;
input v5 = 0;
input v6 = 0;
input v7 = 0;
input v8 = 0;
input v9 = 0;
input v10 = 0;
input v11 = 0;
input v12 = 0;
input v13 = 0;
input v14 = 0;
input v15 = 0;
input v16 = 0;
input i = 0;
def r0 = (if i == 0 or v0 == 0 then 0 else (if vv > v0 then (if i < 0 then 1 else -1) else (if i < 0 then -1 else 1)));
def r1 = r0 + (if i == 1 or v1 == 0 then 0 else (if vv > v1 then (if i < 1 then 1 else -1) else (if i < 1 then -1 else 1)));
def r2 = r1 + (if i == 2 or v2 == 0 then 0 else (if vv > v2 then (if i < 2 then 1 else -1) else (if i < 2 then -1 else 1)));
def r3 = r2 + (if i == 3 or v3 == 0 then 0 else (if vv > v3 then (if i < 3 then 1 else -1) else (if i < 3 then -1 else 1)));
def r4 = r3 + (if i == 4 or v4 == 0 then 0 else (if vv > v4 then (if i < 4 then 1 else -1) else (if i < 4 then -1 else 1)));
def r5 = r4 + (if i == 5 or v5 == 0 then 0 else (if vv > v5 then (if i < 5 then 1 else -1) else (if i < 5 then -1 else 1)));
def r6 = r5 + (if i == 6 or v6 == 0 then 0 else (if vv > v6 then (if i < 6 then 1 else -1) else (if i < 6 then -1 else 1)));
def r7 = r6 + (if i == 7 or v7 == 0 then 0 else (if vv > v7 then (if i < 7 then 1 else -1) else (if i < 7 then -1 else 1)));
def r8 = r7 + (if i == 8 or v8 == 0 then 0 else (if vv > v8 then (if i < 8 then 1 else -1) else (if i < 8 then -1 else 1)));
def r9 = r8 + (if i == 9 or v9 == 0 then 0 else (if vv > v9 then (if i < 9 then 1 else -1) else (if i < 9 then -1 else 1)));
def r10 = r9 + (if i == 10 or v10 == 0 then 0 else (if vv > v10 then (if i < 10 then 1 else -1) else (if i < 10 then -1 else 1)));
def r11 = r10+ (if i == 11 or v11 == 0 then 0 else (if vv > v11 then (if i < 11 then 1 else -1) else (if i < 11 then -1 else 1)));
def r12 = r11+ (if i == 12 or v12 == 0 then 0 else (if vv > v12 then (if i < 12 then 1 else -1) else (if i < 12 then -1 else 1)));
def r13 = r12+ (if i == 13 or v13 == 0 then 0 else (if vv > v13 then (if i < 13 then 1 else -1) else (if i < 13 then -1 else 1)));
def r14 = r13+ (if i == 14 or v14 == 0 then 0 else (if vv > v14 then (if i < 14 then 1 else -1) else (if i < 14 then -1 else 1)));
def r15 = r14+ (if i == 15 or v15 == 0 then 0 else (if vv > v15 then (if i < 15 then 1 else -1) else (if i < 15 then -1 else 1)));
def r16 = r15+ (if i == 16 or v16 == 0 then 0 else (if vv > v16 then (if i < 16 then 1 else -1) else (if i < 16 then -1 else 1)));
plot result = if IsNaN(r16) then 0 else if vv == 0 then 0 else r16;
}
def cluste0 = if trimUp > 0 then 0 else source;
def cluste1 = filter(source, 1 * spacing, phase, ClusterFilter, 1, trimUp, trimDn);
def cluste2 = filter(source, 2 * spacing, phase, ClusterFilter, 2, trimUp, trimDn);
def cluste3 = filter(source, 3 * spacing, phase, ClusterFilter, 3, trimUp, trimDn);
def cluste4 = filter(source, 4 * spacing, phase, ClusterFilter, 4, trimUp, trimDn);
def cluste5 = filter(source, 5 * spacing, phase, ClusterFilter, 5, trimUp, trimDn);
def cluste6 = filter(source, 6 * spacing, phase, ClusterFilter, 6, trimUp, trimDn);
def cluste7 = filter(source, 7 * spacing, phase, ClusterFilter, 7, trimUp, trimDn);
def cluste8 = filter(source, 8 * spacing, phase, ClusterFilter, 8, trimUp, trimDn);
def cluste9 = filter(source, 9 * spacing, phase, ClusterFilter, 9, trimUp, trimDn);
def cluste10 = filter(source, 10 * spacing, phase, ClusterFilter, 10, trimUp, trimDn);
def cluste11 = filter(source, 11 * spacing, phase, ClusterFilter, 11, trimUp, trimDn);
def cluste12 = filter(source, 12 * spacing, phase, ClusterFilter, 12, trimUp, trimDn);
def cluste13 = filter(source, 13 * spacing, phase, ClusterFilter, 13, trimUp, trimDn);
def cluste14 = filter(source, 14 * spacing, phase, ClusterFilter, 14, trimUp, trimDn);
def cluste15 = filter(source, 15 * spacing, phase, ClusterFilter, 15, trimUp, trimDn);
def cluste16 = filter(source, 16 * spacing, phase, ClusterFilter, 16, trimUp, trimDn);
def cluster0 = (cluste0);
def cluster1 = (cluste1);
def cluster2 = (cluste2);
def cluster3 = (cluste3);
def cluster4 = (cluste4);
def cluster5 = (cluste5);
def cluster6 = (cluste6);
def cluster7 = (cluste7);
def cluster8 = (cluste8);
def cluster9 = (cluste9);
def cluster10 = (cluste10);
def cluster11 = (cluste11);
def cluster12 = (cluste12);
def cluster13 = (cluste13);
def cluster14 = (cluste14);
def cluster15 = (cluste15);
def cluster16 = (cluste16);
def luster0 = z(cluster0);
def luster1 = z(cluster1);
def luster2 = z(cluster2);
def luster3 = z(cluster3);
def luster4 = z(cluster4);
def luster5 = z(cluster5);
def luster6 = z(cluster6);
def luster7 = z(cluster7);
def luster8 = z(cluster8);
def luster9 = z(cluster9);
def luster10 = z(cluster10);
def luster11 = z(cluster11);
def luster12 = z(cluster12);
def luster13 = z(cluster13);
def luster14 = z(cluster14);
def luster15 = z(cluster15);
def luster16 = z(cluster16);
def score0 = getScore(cluster0 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 0);
def score1 = getScore(cluster1 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 1);
def score2 = getScore(cluster2 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 2);
def score3 = getScore(cluster3 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 3);
def score4 = getScore(cluster4 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 4);
def score5 = getScore(cluster5 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 5);
def score6 = getScore(cluster6 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 6);
def score7 = getScore(cluster7 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 7);
def score8 = getScore(cluster8 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 8);
def score9 = getScore(cluster9 , cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 9);
def score10 = getScore(cluster10, cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 10);
def score11 = getScore(cluster11, cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 11);
def score12 = getScore(cluster12, cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 12);
def score13 = getScore(cluster13, cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 13);
def score14 = getScore(cluster14, cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 14);
def score15 = getScore(cluster15, cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 15);
def score16 = getScore(cluster16, cluster0 , cluster1 , cluster2 , cluster3 , cluster4 , cluster5 , cluster6 , cluster7 ,
cluster8 , cluster9 , cluster10, cluster11, cluster12, cluster13, cluster14, cluster15, cluster16, 16);
def max1 = Max(cluster0, Max(cluster1, Max(cluster2, Max(cluster3, Max(cluster4, Max(cluster5, Max(cluster6, cluster7)))))));
def max2 = Max(cluster8, Max(cluster9, Max(cluster10,Max(cluster11,Max(cluster12,Max(cluster13,Max(cluster14, cluster15)))))));
def max5 = Max(cluster16,Max(max1, max2));
def min1 = Min(luster0, Min(luster1, Min(luster2, Min(luster3, Min(luster4, Min(luster5, Min(luster6, luster7)))))));
def min2 = Min(luster8, Min(luster9, Min(luster10,Min(luster11,Min(luster12,Min(luster13,Min(luster14, luster15)))))));
def min5 = Min(luster16,Min(min1, min2));
def ribbon_max = max5;
def ribbon_min = min5;
def ribbon_width = ribbon_max – ribbon_min;
def avg = (ribbon_max + ribbon_min) / 2;
def ribbon_Avg = (ribbon_width / avg);
def rib_Avg = if IsNaN(ribbon_Avg) then 0 else ribbon_Avg;
def ribbon_rank = if VOLATILITY_MODE_ON then rib_Avg else 1;
def avgNetScore1 = score0 + score1 + score2 + score3 + score4 + score5 + score6 + score7 + score8;
def avgNetScore2 = score9 + score10 + score11 + score12 + score13 + score14 + score15 + score16;
def score = avgNetScore1 + avgNetScore2;
def NetSco1 = !cluster0 + !cluster1 + !cluster2 + !cluster3 + !cluster4 + !cluster5 + !cluster6 + !cluster7 + !cluster8 + !cluster9;
def NetSco2 = !cluster10+ !cluster11+ !cluster12+ !cluster13+ !cluster14+ !cluster15+ !cluster16;
def value = 16 – (NetSco1 + NetSco2);
def avgNetScore = score / (value + 1);
def netScore = ((avgNetScore + value) / (value * 2.0) – 0.5) * 200.0;
def net_score = filter(netScore * ribbon_rank, PostSmoothLength, 3.7, PostSmoothFilter);
def avg_net_score = Average(net_score, 2);
def signal_value = if signal_length < 2 then na else filter(avg_net_score, signal_length, 3.7, signal_filter);
#-- Colors
def bar = AbsValue(BarNumber());
def delta = net_score - If(IsNaN(net_score[1]), net_score, net_score[1]);
def bullish = if delta >= 0.0 then 3 else 2;
def bearish = if delta > 0.0 then -2 else -3;
def transit = if net_score > 0.0 then (if delta >= 0.0 then 1 else -1)
else (if delta >= 0.0 then -1 else 1);
def easing = 0.01 * transition_easing;
def absVal = if bar > 0 then absVal[1] + Sqr(AbsValue(net_score)) else 1;
def crm = AbsValue(net_score)*100 + easing * Sqrt(absVal / (bar + 1 ));
def crms = if IsNaN(crm) then 0 else if crm > 100 then 100 else if crm < 0 then 0 else crm;
def grad;
if VOLATILITY_MODE_ON {
grad = if net_score > 0.0 then
if transition_easing > 0.0 then 5 else bullish else
if transition_easing > 0.0 then -5 else bearish;
} else {
grad = if net_score > 0.0 then
if transition_easing > 0.0 then 4 else bullish else
if transition_easing > 0.0 then -4 else bearish;
}
def col = if IsNaN(net_score) then 0 else if net_score > 100 then 100 else if net_score < -100 then -100 else net_score;
def col1 = if col > upperLevel then 100 else if col < lowerLevel then 100 else absValue(col); #if col > 0 then col else -col;
def nCol = 100 – col1;
def eCol = col1 * 2.54 + nCol;
def nCrms = 100 – crms;
def eCrms = crms * 2.54 + nCrms;
#– plots
plot SignalLine = if last then na else signal_value;
plot ScoreLine = if last then na else HullMovingAvg(net_score, 5);
plot top = if last or VOLATILITY_MODE_ON then na else 100.0; # “Top”
plot upperLvl = if last or VOLATILITY_MODE_ON then na else upperLevel; # “+Level”, rising_bullish, hline.style_dotted, 2)
plot Center = if last then na else 0;
plot lowerLvl = if last or VOLATILITY_MODE_ON then na else lowerLevel; # “+Level”, falling_bearish, hline.style_dotted, 2)
plot bottom = if last or VOLATILITY_MODE_ON then na else -100.0; # “Bottom”
AddCloud(ScoreLine, SignalLine, Color.DARK_GREEN, Color.PLUM);
ScoreLine.AssignValueColor(if grad == 5 then CreateColor(nCrms, eCrms, nCrms) else
if grad == 4 then CreateColor(nCol, eCol, eCol) else
if grad ==-5 then CreateColor(eCrms, nCrms, nCrms) else
if grad ==-4 then CreateColor(eCol, nCol, eCol) else
if grad == 3 then GlobalColor(“rising_bullish”) else
if grad == 2 then GlobalColor(“falling_bullish”) else
if grad ==-3 then GlobalColor(“falling_bearish”) else
if grad ==-2 then GlobalColor(“rising_bearish”) else Color.GRAY);
ScoreLine.SetLineWeight(2);
SignalLine.AssignValueColor(if transition_easing > 0 then Color.DARK_ORANGE else Color.DOWNTICK);
top.SetDefaultColor(Color.RED);
Center.SetDefaultColor(Color.GRAY);
bottom.SetDefaultColor(Color.GREEN);
upperLvl.SetStyle(Curve.SHORT_DASH);
upperLvl.SetDefaultColor(Color.RED);
lowerLvl.SetStyle(Curve.SHORT_DASH);
lowerLvl.SetDefaultColor(Color.GREEN);
AddCloud(top, top – (top – upperLvl)/2, Color.DARK_RED);
AddCloud(lowerLvl – (lowerLvl – bottom)/2, bottom, Color.DARK_GREEN);
DefineGlobalColor(“rising_transition”, CreateColor(149, 152, 161)); # “range”
DefineGlobalColor(“falling_transition”, CreateColor(204, 204, 204)); # “range”
AssignPriceColor(if !candle_color then Color.CURRENT else
if grad == 5 then CreateColor(nCrms, eCrms, nCrms) else
if grad == 4 then CreateColor(nCol, eCol, eCol) else
if grad ==-5 then CreateColor(eCrms, nCrms, nCrms) else
if grad ==-4 then CreateColor(eCol, nCol, eCol) else
if grad == 3 then GlobalColor(“rising_bullish”) else
if grad == 2 then GlobalColor(“falling_bullish”) else
if grad ==-3 then GlobalColor(“falling_bearish”) else
if grad ==-2 then GlobalColor(“rising_bearish”) else Color.GRAY);
#– END of CODE
I included a pic of settings window, and indicator. It’s the bottom indicator. I included pic with chart as well to see how well it aligns with price action.
Thanks!
Also, I don’y need the shading, just the lines for the trends/crossovers.
Good afternoon. I've been thinking about it, but without the ability to create functions, it's impossible for me to program it. I will be able to do so in the next version of PRT (v13).
SOrry I’m just now getting back to this, but thank you> I’m looking forward to version13!
what is the name of this indicator
Trend Oscillator TOS to PRC
This topic contains 4 replies,
has 3 voices, and was last updated by j102491
9 months, 1 week ago.
| Forum: | ProBuilder: Indicators & Custom Tools |
| Language: | English |
| Started: | 02/16/2025 |
| Status: | Active |
| Attachments: | 1 files |
The information collected on this form is stored in a computer file by ProRealCode to create and access your ProRealCode profile. This data is kept in a secure database for the duration of the member's membership. They will be kept as long as you use our services and will be automatically deleted after 3 years of inactivity. Your personal data is used to create your private profile on ProRealCode. This data is maintained by SAS ProRealCode, 407 rue Freycinet, 59151 Arleux, France. If you subscribe to our newsletters, your email address is provided to our service provider "MailChimp" located in the United States, with whom we have signed a confidentiality agreement. This company is also compliant with the EU/Swiss Privacy Shield, and the GDPR. For any request for correction or deletion concerning your data, you can directly contact the ProRealCode team by email at privacy@prorealcode.com If you would like to lodge a complaint regarding the use of your personal data, you can contact your data protection supervisory authority.