@mashume What does it look like? Do you have a picture?I turned this one into a candle-colouring upper study. Seems an interesting approach.
@mashume What does it look like? Do you have a picture?
ITF Stochastic on the left y axis.Very interesting. What are the 2 lines @mashume?
# Beep Boop
# Converted from TradingView
# v1 - 20210115 barbaros
# v2 - 20210117 barbaros - Added filter to show only in long term direction
# v3 - 20210122 barbaros - Added price bar painting
declare lower;
declare zerobase;
input FastLength = 12; # Fast Length
input SlowLength = 26; # Slow Length
input EMATrend = 50; # EMA Trend
input EMAFilter = no; # Only show in the direction of the trend
input EMAFilterPeriod = 200; # EMA Filter Trend Period
input Source = close; # Source
input SignalLength = 9; # Signal Smoothing, minval = 1, maxval = 50
input SMASource = no; # Simple MA(Oscillator)
input SMASignal = no; # Simple MA(Signal Line)
input ShowLabel = yes; # Show indicator label
input PaintBars = no; # Paints the price bars
def fast_ma = if SMASource then SimpleMovingAvg(Source, FastLength) else MovAvgExponential(Source, FastLength);
def slow_ma = if SMASource then SimpleMovingAvg(Source, SlowLength) else MovAvgExponential(Source, SlowLength);
def macd = fast_ma - slow_ma;
def signal = if SMASignal then SimpleMovingAvg(macd, SignalLength) else MovAvgExponential(macd, SignalLength);
def histVal = macd - signal;
def fastMA = MovAvgExponential(Source, EMATrend);
def longtermMA = MovAvgExponential(Source, EMAFilterPeriod);
plot hist = if histVal > 0 and (!EMAFilter or low > longtermMA) then 0.1
else if histVal < 0 and (!EMAFilter or high < longtermMA) then 0.09
else if EMAFilter then Double.NaN else histVal;
hist.defineColor("col_grow_above", CreateColor(38, 166, 154));
hist.defineColor("col_grow_below", CreateColor(255, 0, 0));
hist.defineColor("col_fall_above", CreateColor(255, 255, 255));
hist.defineColor("col_fall_below", CreateColor(255, 255, 255));
hist.defineColor("col_macd", CreateColor(0, 148, 255));
hist.defineColor("col_signal", CreateColor(255, 106, 0));
hist.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
hist.assignValueColor(if hist == 0.1 then
if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
hist.Color("col_grow_above")
else
hist.Color("col_fall_above")
else
if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
hist.Color("col_grow_below")
else
hist.Color("col_fall_below"));
AssignPriceColor(
if PaintBars then
if hist == 0.1 then
if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
hist.Color("col_grow_above")
else
hist.Color("col_fall_above")
else
if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
hist.Color("col_grow_below")
else
hist.Color("col_fall_below")
else
Color.CURRENT
);
AddLabel(ShowLabel,
if hist == 0.1 then
if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
"Grow Above"
else
"Fall Above"
else
if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
"Grow Below"
else
"FallBelow",
if hist == 0.1 then
if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
hist.Color("col_grow_above")
else
hist.Color("col_fall_above")
else
if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
hist.Color("col_grow_below")
else
hist.Color("col_fall_below")
);
I’m not familiar with it. Is it custom?ITF Stochastic on the left y axis.
I don't believe so. I've modded it a bit:I’m not familiar with it. Is it custom?
#
# TD Ameritrade IP Company, Inc. (c) 2012-2020
# Modded Mashume 2020
#
declare zerobase;
input price = close;
input threshold = 0.5;
input length = 30;
input slowingLength = 5;
input over_bought = 90;
input over_sold = 60;
def rainbow = reference RainbowAverage(price = price, averageType = AverageType.WEIGHTED);
plot Stochastic = sum(rainbow - Lowest(rainbow, length), slowingLength) / (sum(Highest(rainbow, length) - Lowest(rainbow, length), slowingLength) + 0.0001) * 100;
def normStochRainbow = 0.1 * (Stochastic - 50);
plot IFT = 100 / (1 + exp(-2 * normStochRainbow));
plot OverBought = over_bought;
plot OverSold = over_sold;
Stochastic.SetDefaultColor(GetColor(2));
IFT.SetDefaultColor(GetColor(1));
OverBought.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));
def smalldip = if
IFT > IFT[1]
and IFT[1] < IFT[2]
and IFT - IFT[1] >= threshold
and IFT[7] > IFT
and IFT[7] > 95
and IFT[1] <= 92.5
and IFT > over_sold
then IFT ELSE DOUBLE.NAN;
plot small_dip = smalldip;
small_dip.SetPaintingStrategy(paintingStrategy = PaintingStrategy.ARROW_UP);
small_dip.SetDefaultColor(getColor(3));
Make sure you have the same parameters selected for both. It is the same code that paints the bars on both.@barbaros I ran the candle-coded version and I noticed a difference between the colored candles and the version I originally downloaded. I just wanted to let that be known.
@barbaros I did...I think I used the very first versionMake sure you have the same parameters selected for both. It is the same code that paints the bars on both.
It's a trend trade above or below the 50EMA. It resonates well with me on 5 minute.I've been trying to apply to Futures /NQ, /YM, /GC, /HG, etc.. Doesn't seem to work well, at least with my calibrations. Any suggestions? I guess for forex it seems fairly justified
# Beep Boop MTF
# Converted from TradingView
# v1 - 20210115 barbaros
# v2 - 20210117 barbaros - Added filter to show only in long term direction
# v3 - 20210121 barbaros - Added MTF, Removed Source
declare lower;
declare zerobase;
declare once_per_bar;
input FastLength = 12; # Fast Length
input SlowLength = 26; # Slow Length
input EMATrend = 50; # EMA Trend
input EMAFilter = no; # Only show in the direction of the trend
input EMAFilterPeriod = 200; # EMA Filter Trend Period
input Agg = AggregationPeriod.FIVE_MIN; # Aggregation Period
input SignalLength = 9; # Signal Smoothing, minval = 1, maxval = 50
input SMASource = no; # Simple MA(Oscillator)
input SMASignal = no; # Simple MA(Signal Line)
input ShowLabel = yes; # Show indicator label
def fast_ma = if SMASource then SimpleMovingAvg(close(period = Agg), FastLength) else MovAvgExponential(close(period = Agg), FastLength);
def slow_ma = if SMASource then SimpleMovingAvg(close(period = Agg), SlowLength) else MovAvgExponential(close(period = Agg), SlowLength);
def macd = fast_ma - slow_ma;
def signal = if SMASignal then SimpleMovingAvg(macd, SignalLength) else MovAvgExponential(macd, SignalLength);
def histVal = macd - signal;
def fastMA = MovAvgExponential(close(period = Agg), EMATrend);
def longtermMA = MovAvgExponential(close(period = Agg), EMAFilterPeriod);
#plot asdf = RSI(200);
def histResult = if histVal > 0 and (!EMAFilter or low > longtermMA) and (close > fastMA) and (open > fastMA) and (low > fastMA) then 10
else if histVal < 0 and (!EMAFilter or high < longtermMA)and (close < fastMA) and (open < fastMA) and (high < fastMA) then 9
# else if EMAFilter then Double.NaN else histVal;
else 8;
plot hist = histResult;
hist.defineColor("col_grow_above", CreateColor(38, 166, 154));
hist.defineColor("col_grow_below", CreateColor(255, 0, 0));
hist.defineColor("col_fall_above", CreateColor(255, 255, 255));
hist.defineColor("col_fall_below", CreateColor(255, 255, 255));
hist.defineColor("col_macd", CreateColor(0, 148, 255));
hist.defineColor("col_signal", CreateColor(255, 106, 0));
hist.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
hist.assignValueColor(if hist == 10 then
hist.Color("col_grow_above")
else if (hist == 9) then
hist.Color("col_grow_below")
else
hist.Color("col_fall_below"));
AddLabel(ShowLabel,
if hist == 10 then
if (hist == 10) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
"Grow Above"
else
"Fall Above"
else
if (hist == 9) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
"Grow Below"
else
"FallBelow",
if hist == 10 then
if (hist == 10) and (close > fastMA) and (open > fastMA) and (low > fastMA) then
hist.Color("col_grow_above")
else
hist.Color("col_fall_above")
else
if (hist == 9) and (close < fastMA) and (open < fastMA) and (high < fastMA) then
hist.Color("col_grow_below")
else
hist.Color("col_fall_below")
);
def fall = 1;
plot pFall = fall;
pFall.SetDefaultColor(Color.WHITE);
def upLine = 1;
plot pUp = upLine;
pUp.SetDefaultColor(Color.GREEN);
def downLine = 1;
plot pDown = downLine;
pDown.SetDefaultColor(Color.RED);
def countUp = hist == 10; #color changed
def countDOWN = hist == 9; #color changed
def countFALL = hist == 8; #color changed
def barCount = CompoundValue(1,
if countFALL and hist[1] != 8 then barCount[1] - barCount[1] + 1 else if countFALL and hist[1] == 8 then barCount[1] + 1
else if CountDOWN and hist[1] != 9 then barCount[1] - barCount[1] + 1 else if countDOWN and hist[1] == 9 then barCount[1] + 1
else if CountUP and hist[1] != 10 then barCount[1] - barCount[1] + 1 else if countUP and hist[1] == 10 then barCount[1] + 1
else 0, 0);
plot pBarDownCount = barCount;
pBarDownCount.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
pBarDownCount.AssignValueColor(Color.YELLOW);
Hi @barbaros instead of using all of the lower real estate up is it feasible to set up a MTF label for this? Thanks in advance!Here you go.
Python:# Beep Boop MTF # Converted from TradingView # v1 - 20210115 barbaros # v2 - 20210117 barbaros - Added filter to show only in long term direction # v3 - 20210121 barbaros - Added MTF, Removed Source declare lower; declare zerobase; input FastLength = 12; # Fast Length input SlowLength = 26; # Slow Length input EMATrend = 50; # EMA Trend input EMAFilter = no; # Only show in the direction of the trend input EMAFilterPeriod = 200; # EMA Filter Trend Period input Agg = AggregationPeriod.FIVE_MIN; # Aggregation Period input SignalLength = 9; # Signal Smoothing, minval = 1, maxval = 50 input SMASource = no; # Simple MA(Oscillator) input SMASignal = no; # Simple MA(Signal Line) input ShowLabel = yes; # Show indicator label def fast_ma = if SMASource then SimpleMovingAvg(close(period = Agg), FastLength) else MovAvgExponential(close(period = Agg), FastLength); def slow_ma = if SMASource then SimpleMovingAvg(close(period = Agg), SlowLength) else MovAvgExponential(close(period = Agg), SlowLength); def macd = fast_ma - slow_ma; def signal = if SMASignal then SimpleMovingAvg(macd, SignalLength) else MovAvgExponential(macd, SignalLength); def histVal = macd - signal; def fastMA = MovAvgExponential(close(period = Agg), EMATrend); def longtermMA = MovAvgExponential(close(period = Agg), EMAFilterPeriod); plot hist = if histVal > 0 and (!EMAFilter or low > longtermMA) then 0.1 else if histVal < 0 and (!EMAFilter or high < longtermMA) then 0.09 else if EMAFilter then Double.NaN else histVal; hist.defineColor("col_grow_above", CreateColor(38, 166, 154)); hist.defineColor("col_grow_below", CreateColor(255, 0, 0)); hist.defineColor("col_fall_above", CreateColor(255, 255, 255)); hist.defineColor("col_fall_below", CreateColor(255, 255, 255)); hist.defineColor("col_macd", CreateColor(0, 148, 255)); hist.defineColor("col_signal", CreateColor(255, 106, 0)); hist.setPaintingStrategy(PaintingStrategy.HISTOGRAM); hist.assignValueColor(if hist == 0.1 then if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then hist.Color("col_grow_above") else hist.Color("col_fall_above") else if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then hist.Color("col_grow_below") else hist.Color("col_fall_below")); AddLabel(ShowLabel, if hist == 0.1 then if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then "Grow Above" else "Fall Above" else if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then "Grow Below" else "FallBelow", if hist == 0.1 then if (hist == 0.1) and (close > fastMA) and (open > fastMA) and (low > fastMA) then hist.Color("col_grow_above") else hist.Color("col_fall_above") else if (hist == 0.09) and (close < fastMA) and (open < fastMA) and (high < fastMA) then hist.Color("col_grow_below") else hist.Color("col_fall_below") );
Sure, you can drag it up to the upper chart and hide all the plot.Hi @barbaros instead of using all of the lower real estate up is it feasible to set up a MTF label for this? Thanks in advance!
Hi @barbaros, Awesome worked like a charm thanks for taking the time appreciate it!Sure, you can drag it up to the upper chart and hide all the plot.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Repaints Cup and Handle Indicator for ThinkorSwim | Indicators | 24 | ||
The Ultimate Buy and Sell Indicator for ThinkOrSwim | Indicators | 5 | ||
Z-Score Probability Indicator for ThinkOrSwim | Indicators | 26 | ||
HTF PO3 Indicator For ThinkOrSwim | Indicators | 42 | ||
Market Bias (CEREBR) Indicator for ThinkOrSwim | Indicators | 15 |
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.