sticks
New member
Yes but I tried many different variations to no avail.@Sticks-N-Bones Ummm... Didn't you forget the = sign between length and 40...???
Yes but I tried many different variations to no avail.@Sticks-N-Bones Ummm... Didn't you forget the = sign between length and 40...???
@Sticks-N-Bones So..... You are looking for something like one of these columns?
Ruby:# Code for the 1st column def signal = close / MovAvgExponential("length" = 40)."AvgExp" *100 ; AddLabel(yes, " "); AssignBackgroundColor(if signal > 100 then color.green else color.red);
HTHRuby:# code for the 2nd column plot signal = close / MovAvgExponential("length" = 40)."AvgExp" *100 ; AssignBackgroundColor(if signal > 100 then color.green else color.red);
# WalkingBallista EMA Lookback Cross
# https://usethinkscript.com/d/119-moving-average-crossover-watchlist-column-for-thinkorswim
declare lower;
input lookback = 5;
input ema1_len = 9;
input ema2_len = 20;
input averageType = AverageType.EXPONENTIAL;
def ema1 = MovAvgExponential(length = ema1_len);
def ema2 = MovAvgExponential(length = ema2_len);
def bull_cross = ema1 crosses above ema2;
def bear_cross = ema1 crosses below ema2;
def bull_lookback = Highest(bull_cross, lookback);
def bear_lookback = Highest(bear_cross, lookback);
plot signal = if bull_lookback then 2 else if bear_lookback then 1 else 0;
signal.AssignValueColor(if signal == 2 then Color.DARK_GREEN else if signal == 1 then Color.DARK_RED else Color.DARK_ORANGE);
AssignBackgroundColor(if signal == 2 then Color.DARK_GREEN else if signal == 1 then Color.DARK_RED else Color.DARK_ORANGE);
Hi @rad14733, that must be it then. Last nite, I was testing it out through the ondemand feature. I am guessing this type of ondemand replay data doesn't go through the proper route, that's why the column did not update for me last night. It works great this morning except the lag. So your explanation make sense.@alucarrd Just be aware that Custom Wartchlist Columns only update every 3 - 7 minutes rather than instantaneously like Standard Watchlist Columns and Charts...
Hi @MerryDay,@alucarrd
I found that your code works fine. If you think you are getting bad results, plot 9ema and 20ema on a chart. If the chart shows one thing and the watchlist shows another, post marked-up screenshots of the chart and watchlist and we will help you troubleshoot further.
declare upper;
input fastPeriod = 3;
input slowPeriod = 10;
input signalPeriod = 5;
input price = close;
def fastEma = ExpAverage(price, fastPeriod);
def slowEma = ExpAverage(price, slowPeriod);
def _ppo = ((fastEma - slowEma) / slowEma) * 100;
def _signal = ExpAverage(_ppo, signalPeriod);
plot BUY = Crosses(_ppo, _signal, CrossingDirection.ABOVE);
plot SELL = Crosses(_ppo, _signal, CrossingDirection.BELOW);
BUY.setpaintingstrategy(paintingstrategy.BOOLEAN_ARROW_UP);
SELL.setpaintingstrategy(paintingstrategy.BOOLEAN_ARROW_DOWN);
##End
@Madhu Just change the values from the original code to 8 and 50.
How would ema8 be greater than ema50 and not greater than ema21...??? But if you need the logic it would be ema8 > ema21 and ema21 > ema50...Hi Ben,
I am not sure if my earlier question was clear
I am using 8,21,and 50 Ema.i want to take trade when 8 ema is above the 21 ema and 21 is above the 50 ema. All these conditions are met then show them in watch list .
Yes Ben, I am looking for ema8 > ema21 and ema21 > ema50...How would ema8 be greater than ema50 and not greater than ema21...??? But if you need the logic it would be ema8 > ema21 and ema21 > ema50...
Hi Ben, i need to show if they moving avg are showing in a order - 8 , 8 below 21 ,21 below 50. If these three conditions are met show in a watch list with some me color indication. Could you please help me on this?Yes Ben, I am looking for ema8 > ema21 and ema21 > ema50...
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
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.