Hi,Quick analysis
How is it possible to change the indicator parameters for the SPXL ticker?
Hi,Quick analysis
Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Quick analysis
#
# TD Ameritrade IP Company, Inc. (c) 2012-2020
#
input length = 21;
input paintBars = yes;
def EMA = ExpAverage(close, length);
def MACD = ExpAverage(close, 12) - ExpAverage(close, 26);
def MACDHist = MACD - ExpAverage(MACD, 9);
def GreenPrice = EMA > EMA[1] and MACDHist > MACDHist[1];
def RedPrice = EMA < EMA[1] and MACDHist < MACDHist[1];
plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;
Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();
DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then GlobalColor("Bullish") else if RedPrice then GlobalColor("Bearish") else GlobalColor("Neutral"));
AddOrder(OrderType.BUY_AUTO, Bullish);
AddOrder(OrderType.SELL_TO_CLOSE, Neutral);
AddOrder(OrderType.SELL_AUTO, Bearish);
AddOrder(OrderType.BUY_TO_CLOSE, Neutral);
input AudibleAlerts = yes;
Alert(AudibleAlerts and OrderType.BUY_AUTO, GetSymbol() + "buy", Alert.BAR, Sound.Ring);
Alert(AudibleAlerts and OrderType.SELL_TO_CLOSE, GetSymbol() + "buy", Alert.BAR, Sound.Ring);
Alert(AudibleAlerts and OrderType.SELL_AUTO, GetSymbol() + "sell", Alert.BAR, Sound.Ring);
Alert(AudibleAlerts and OrderType.BUY_TO_CLOSE, GetSymbol() + "buy", Alert.BAR, Sound.Ring);
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.