yesInteresting chart... do the upper reversal indicator repaint?
yesInteresting chart... do the upper reversal indicator repaint?
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
may i ask to see how we can get assignbackgroundcolor when the accdist is greater then upperlr or below lowerlr thanksCode:declare lower; def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0; plot AccDist = TotalSum(data); AccDist.SetDefaultColor(GetColor(1)); def price = accdist; input deviations = 1.68; input fullRange = Yes; input length = 20; input widthOfChannel = 80.0; plot MiddleLR; if (fullRange) then { MiddleLR = InertiaAll(price); } else { MiddleLR = InertiaAll(price, length); } def dist = HighestAll(AbsValue(MiddleLR - price)) * (widthOfChannel / 100.0); plot UpperLR = MiddleLR + dist; plot LowerLR = MiddleLR - dist;
may i ask to see how we can get assignbackgroundcolor when the accdist is greater then upperlr or below lowerlr thanks
declare lower;
def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;
plot AccDist = TotalSum(data);
AccDist.SetDefaultColor(GetColor(1));
def price = accdist;
input deviations = 1.68;
input fullRange = Yes;
input length = 20;
input widthOfChannel = 80.0;
plot MiddleLR;
if (fullRange)
then {
MiddleLR = InertiaAll(price);
} else {
MiddleLR = InertiaAll(price, length);
}
def dist = HighestAll(AbsValue(MiddleLR - price)) * (widthOfChannel / 100.0);
plot UpperLR = MiddleLR + dist;
plot LowerLR = MiddleLR - dist;
DefineGlobalColor("Bottom", CreateColor(0, 75, 100));
DefineGlobalColor("Top", CreateColor(80, 50, 0));
input paintBackground = yes;
AssignBackgroundColor(if paintBackground and accdist > upperlr then GlobalColor("Top") else
if paintBackground and accdist < lowerlr then GlobalColor("Bottom") else color.current );
Any way to use candles on this rather then the accdist?Not to take anything away from what @horserider put together, but here's an alternative. It WILL keep itself pegged if higher highs continue to be made. It will drop from 1 when the price is no longer making a higher high. Same goes for Lower Lows. This is because I chose to normalize the data over the range of 0 to 1. If you make a higher high, it's still 1 and everything before gets compressed.
I did not take time to put inputs on this. everything is hard coded. Feel free to adapt as you see fit.
Of course, I'm not party to the VIP chat, but just combining two indicators can be done this way.
Code:declare lower; def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0; def AD = TotalSum(data); plot AccDist = (AD - lowestall(AD)) /(highestall(AD) - lowestall(AD)); AccDist.SetDefaultColor(GetColor(1)); def stoch = StochasticSlow("over bought" = 100, "over sold" = 0, "k period" = 14, "d period" = 1).SlowD; plot SlowD = (stoch - lowestall(stoch)) /(highestall(stoch) - lowestall(stoch)); plot one = 1; plot zero = 0;
Happy Trading
-mashume
def AD = CLOSE;
plot AccDist = (AD - lowestall(AD)) /(highestall(AD) - lowestall(AD));
def AD = TotalSum(data);
plot AccDist = (OPEN - lowestall(CLOSE)) /(highestall(HIGH) - lowestall(LOW));
declare lower;
def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;
def AD = TotalSum(data);
plot AccDist = (AD - lowestall(AD)) /(highestall(AD) - lowestall(AD));
AccDist.SetDefaultColor(GetColor(1));
def stoch = StochasticSlow("over bought" = 100, "over sold" = 0, "k period" = 14, "d period" = 1).SlowD;
plot SlowD = (stoch - lowestall(stoch)) /(highestall(stoch) - lowestall(stoch));
plot one = 1;
plot zero = 0;
declare lower;
def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;
def AD = TotalSum(data);
def stoch = StochasticSlow("over bought" = 100, "over sold" = 0, "k period" = 14, "d period" = 1).SlowD;
plot AccDist = RoundDown((AD - lowestall(AD)) /(highestall(AD) - lowestall(AD)),2);
AccDist.SetDefaultColor(GetColor(1));
plot SlowD = RoundDown((stoch - lowestall(stoch)) /(highestall(stoch) - lowestall(stoch)),2);;
plot one = 1;
plot zero = 0;
plot BothZero = if !AccDist and !SlowD then 0 else double.nan;
BothZero.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
Is there any way possible to add a couple other deviation lines to this or mtf this indicator i know it repaints ; however if another deviation may be an area to add too @samer800 . Also knowing it repaints is there any human possibility not to make it repaint? i was in deafdaytrader's discord room and this guy . may he rest in peace now . made a living doing SPX puts and calls from this setup . Thank you in advanceCode:declare lower; def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0; plot AccDist = TotalSum(data); AccDist.SetDefaultColor(GetColor(1)); def price = accdist; input deviations = 1.68; input fullRange = Yes; input length = 20; input widthOfChannel = 80.0; plot MiddleLR; if (fullRange) then { MiddleLR = InertiaAll(price); } else { MiddleLR = InertiaAll(price, length); } def dist = HighestAll(AbsValue(MiddleLR - price)) * (widthOfChannel / 100.0); plot UpperLR = MiddleLR + dist; plot LowerLR = MiddleLR - dist;
check the below for MTFIs there any way possible to add a couple other deviation lines to this or mtf this indicator i know it repaints ; however if another deviation may be an area to add too @samer800 . Also knowing it repaints is there any human possibility not to make it repaint? i was in deafdaytrader's discord room and this guy . may he rest in peace now . made a living doing SPX puts and calls from this setup . Thank you in advance
declare lower;
input useChartTimeframe = {default "Yes", "No"};
input ManualTimeframe = AggregationPeriod.FIFTEEN_MIN; # "Resolution"
input smoothing = yes;
input source = FundamentalType.CLOSE;
input deviations1 = 0.236;
input deviations2 = 0.500;
input fullRange = Yes;
input length = 200;
input widthOfChannel = 80.0;
def tfSrc = Fundamental(FundamentalType = source);
def tfH = high;
def tfL = low;
def mtfSrc = Fundamental(FundamentalType = source, Period = ManualTimeframe);
def mtfH = high(Period = ManualTimeframe);
def mtfL = low(Period = ManualTimeframe);
def c;
def h;
def l;
switch (useChartTimeframe) {
case "No":
c = mtfSrc;
h = mtfH;
l = mtfL;
Default :
c = tfSrc;
h = tfH;
l = tfL;
}
def data = if c > c[1] then c - Min(c[1], l) else
if c < c[1] then c - Max(c[1], h) else 0;
def src = data;
def smoothPrice = EhlersSuperSmootherFilter(src);
def price = if smoothing then smoothPrice else src;
plot AccDist;
plot MiddleLR;
if (fullRange)
then {
AccDist = TotalSum(price);
MiddleLR = InertiaAll(AccDist);
} else {
AccDist = sum(price, length);
MiddleLR = InertiaAll(AccDist);#, length);
}
def dist = HighestAll(AbsValue(MiddleLR - AccDist)) * (widthOfChannel / 100.0);
plot UpperLR1 = MiddleLR + dist;
plot LowerLR1 = MiddleLR - dist;
plot UpperLR2 = MiddleLR + dist * deviations1;
plot LowerLR2 = MiddleLR - dist * deviations1;
plot UpperLR3 = MiddleLR + dist * deviations2;
plot LowerLR3 = MiddleLR - dist * deviations2;
AccDist.SetLineWeight(2);
AccDist.SetDefaultColor(GetColor(1));
MiddleLR.SetStyle(Curve.SHORT_DASH);
MiddleLR.SetDefaultColor(Color.GRAY);
UpperLR1.SetDefaultColor(Color.GREEN);
LowerLR1.SetDefaultColor(Color.RED);
UpperLR2.SetDefaultColor(Color.DARK_GREEN);
LowerLR2.SetDefaultColor(Color.DARK_RED);
UpperLR3.SetDefaultColor(Color.DARK_GREEN);
LowerLR3.SetDefaultColor(Color.DARK_RED);
#-- END of CODE
This is a prolific repainting indicator. The logic in this study is written to continuously trigger false signals until it goes back and finally repaints the one good signal.Also knowing it repaints is there any human possibility not to make it repaint?
Thank you @samer800check the below for MTF
CSS:declare lower; input useChartTimeframe = {default "Yes", "No"}; input ManualTimeframe = AggregationPeriod.FIFTEEN_MIN; # "Resolution" input smoothing = yes; input source = FundamentalType.CLOSE; input deviations1 = 0.236; input deviations2 = 0.500; input fullRange = Yes; input length = 200; input widthOfChannel = 80.0; def tfSrc = Fundamental(FundamentalType = source); def tfH = high; def tfL = low; def mtfSrc = Fundamental(FundamentalType = source, Period = ManualTimeframe); def mtfH = high(Period = ManualTimeframe); def mtfL = low(Period = ManualTimeframe); def c; def h; def l; switch (useChartTimeframe) { case "No": c = mtfSrc; h = mtfH; l = mtfL; Default : c = tfSrc; h = tfH; l = tfL; } def data = if c > c[1] then c - Min(c[1], l) else if c < c[1] then c - Max(c[1], h) else 0; def src = data; def smoothPrice = EhlersSuperSmootherFilter(src); def price = if smoothing then smoothPrice else src; plot AccDist; plot MiddleLR; if (fullRange) then { AccDist = TotalSum(price); MiddleLR = InertiaAll(AccDist); } else { AccDist = sum(price, length); MiddleLR = InertiaAll(AccDist);#, length); } def dist = HighestAll(AbsValue(MiddleLR - AccDist)) * (widthOfChannel / 100.0); plot UpperLR1 = MiddleLR + dist; plot LowerLR1 = MiddleLR - dist; plot UpperLR2 = MiddleLR + dist * deviations1; plot LowerLR2 = MiddleLR - dist * deviations1; plot UpperLR3 = MiddleLR + dist * deviations2; plot LowerLR3 = MiddleLR - dist * deviations2; AccDist.SetLineWeight(2); AccDist.SetDefaultColor(GetColor(1)); MiddleLR.SetStyle(Curve.SHORT_DASH); MiddleLR.SetDefaultColor(Color.GRAY); UpperLR1.SetDefaultColor(Color.GREEN); LowerLR1.SetDefaultColor(Color.RED); UpperLR2.SetDefaultColor(Color.DARK_GREEN); LowerLR2.SetDefaultColor(Color.DARK_RED); UpperLR3.SetDefaultColor(Color.DARK_GREEN); LowerLR3.SetDefaultColor(Color.DARK_RED); #-- END of CODE
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
H | Bill Williams Green, Squat, Fade, Fake Bars and Zone Bars for ThinkorSwim | Indicators | 30 | |
Y | Bill Williams Fractal Indicator for ThinkorSwim | Indicators | 27 | |
Z-Score Probability Indicator for ThinkOrSwim | Indicators | 29 | ||
HTF PO3 Indicator For ThinkOrSwim | Indicators | 31 | ||
N | RSI - TSI Indicator For ThinkOrSwim | Indicators | 33 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.