Join useThinkScript to post your question to a community of 21,000+ developers and traders.
This is very useful! Is it possible to move the arrows to give a little space between the high or low of the price bar?
# LBR Three Ten Signal Arrows
# tomsk
# 12.14.2019
# V1.0 - 12.11.2019 - tomsk - Initial release of LBR Three Ten Signal Arrows
# V1.1 - 12.14.2019 - tomsk - Adjusted buy/sell arrows to display outside daily range
# Displays signals when the FastLine crosses the SlowLine.
# Configure your preferences to display CrossUp/CrossDn signals
input showCrossUp = yes;
input showCrossDn = no;
input price = close;
input calculationMode = {default Normal, Alternate};
def FastLine;
switch (calculationMode) {
case Normal:
FastLine = Average(price, 3) - Average(price, 10);
case Alternate:
FastLine = Average(price - Average(price[3], 3), 2);
}
def SlowLine = Average(FastLine, 16);
plot crossUp = if showCrossUp and FastLine crosses above SlowLine then 0.998 * low else Double.NaN;
crossUp.SetpaintingStrategy(PaintingStrategy.ARROW_UP);
crossUp.SetDefaultColor(Color.YELLOW);
crossUp.SetLineWeight(4);
plot crossDn = if showCrossDn and FastLine crosses below SlowLine then 1.002 * high else Double.NaN;
crossDn.SetpaintingStrategy(PaintingStrategy.ARROW_DOWN);
crossDn.SetDefaultColor(Color.CYAN);
crossDn.SetLineWeight(4);
# End LBR Three Ten Signal Arrows
# LBR Three Ten Watchlist Xup-Xdn
# Paris
# 12.19.2019
# Based on initial work by tomsk/markos, December 2019
# Watchlist column to display crossUp/Dn signals of FastLine over or under SlowLine
#
# Ordinarily I like one single marketwatch column to display a single condition
# Suggest that you implement the crossUp/Dn via a single column instead of two
# You can achieve this via different colors.
input price = close;
input calculationMode = {default Normal, Alternate};
def FastLine;
switch (calculationMode) {
case Normal:
FastLine = Average(price, 3) - Average(price, 10);
case Alternate:
FastLine = Average(price - Average(price[3], 3), 2);
}
def SlowLine = Average(FastLine, 16);
def crossUp = CompoundValue(1, FastLine crosses above SlowLine, 0);
def crossDn = CompoundValue(1, FastLine crosses below SlowLine, 0);
AddLabel(1, if crossUp then "XUP" else if crossDn then "XDN" else "", Color.BLACK);
AssignBackgroundColor(if crossUp then Color.CYAN
else if crossDn then Color.YELLOW
else Color.BLACK);
# End Code
@Sully Absolutely, here is version 1.1 of the code with the adjusted arrows as requested
Code:# LBR Three Ten Signal Arrows # tomsk # 12.14.2019 # V1.0 - 12.11.2019 - tomsk - Initial release of LBR Three Ten Signal Arrows # V1.1 - 12.14.2019 - tomsk - Adjusted buy/sell arrows to display outside daily range # Displays signals when the FastLine crosses the SlowLine. # Configure your preferences to display CrossUp/CrossDn signals input showCrossUp = yes; input showCrossDn = no; input price = close; input calculationMode = {default Normal, Alternate}; def FastLine; switch (calculationMode) { case Normal: FastLine = Average(price, 3) - Average(price, 10); case Alternate: FastLine = Average(price - Average(price[3], 3), 2); } def SlowLine = Average(FastLine, 16); plot crossUp = if showCrossUp and FastLine crosses above SlowLine then 0.998 * low else Double.NaN; crossUp.SetpaintingStrategy(PaintingStrategy.ARROW_UP); crossUp.SetDefaultColor(Color.YELLOW); crossUp.SetLineWeight(4); plot crossDn = if showCrossDn and FastLine crosses below SlowLine then 1.002 * high else Double.NaN; crossDn.SetpaintingStrategy(PaintingStrategy.ARROW_DOWN); crossDn.SetDefaultColor(Color.CYAN); crossDn.SetLineWeight(4); # End LBR Three Ten Signal Arrows
@MBF Here is a Watchlist Column for you to load & try out. I think it looks good. Many thanks to our friend, Paris!
You can put the "LBR Three Ten Signal Arrows" study on an upper that @tomsk created.
Code:# LBR Three Ten Watchlist Xup-Xdn # Paris # 12.19.2019 # Based on initial work by tomsk/markos, December 2019 # Watchlist column to display crossUp/Dn signals of FastLine over or under SlowLine # # Ordinarily I like one single marketwatch column to display a single condition # Suggest that you implement the crossUp/Dn via a single column instead of two # You can achieve this via different colors. input price = close; input calculationMode = {default Normal, Alternate}; def FastLine; switch (calculationMode) { case Normal: FastLine = Average(price, 3) - Average(price, 10); case Alternate: FastLine = Average(price - Average(price[3], 3), 2); } def SlowLine = Average(FastLine, 16); def crossUp = CompoundValue(1, FastLine crosses above SlowLine, 0); def crossDn = CompoundValue(1, FastLine crosses below SlowLine, 0); AddLabel(1, if crossUp then "XUP" else if crossDn then "XDN" else "", Color.BLACK); AssignBackgroundColor(if crossUp then Color.CYAN else if crossDn then Color.YELLOW else Color.BLACK); # End Code
@MBF save what you have here. It is a good start for a crossover alert.Hi everyone,
I have been working on this for a while. Ive managed to get the color columns but I can't figure out the crossings since I believe both the 3, 10 are the same. I think. Anyway this is as far as I got. I want the 3/10 crossing above the slow 16. HELP! Driving me bonkers.
Here is the script for the indicator: and below that is what Ive made so far. I dont know how to script but I managed a few things.
Code:# TD Ameritrade IP Company, Inc. (c) 2011-2019 declare lower; input price = close; input calculationMode = {default Normal, Alternate}; plot FastLine; switch (calculationMode) { case Normal: FastLine = Average(price, 3) - Average(price, 10); case Alternate: FastLine = Average(price - Average(price[3], 3), 2); } plot SlowLine = Average(FastLine, 16); plot Hist = FastLine; plot ZeroLine = 0; FastLine.SetDefaultColor(GetColor(1)); SlowLine.SetDefaultColor(GetColor(8)); Hist.DefineColor("Positive", Color.UPTICK); Hist.DefineColor("Negative", Color.DOWNTICK); Hist.AssignValueColor(if Hist >= 0 then Hist.color("Positive") else Hist.color("Negative")); Hist.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); Hist.HideTitle(); ZeroLine.SetDefaultColor(GetColor(7));
So far:
Code:INPUT ma1 = 3; INPUT ma2 = 16; DEF ALERT =SimpleMovingAvg("length" = ma1)."SMA" crosses SimpleMovingAvg("length" = ma2)."SMA"; Alert(ALERT, "MA CROSSES MA2", Alert.BAR, Sound.Ring); # WILL CHANGE THE COLOR OF THE TEXT INSIDE THE COLUMN BOX AddLabel(yes, IF SimpleMovingAvg("length" = ma1)."SMA" > SimpleMovingAvg("length" = ma2)."SMA" THEN ma1 ELSE ma2 ,IF SimpleMovingAvg("length" = ma1)."SMA" < SimpleMovingAvg("length" = ma2)."SMA" then color.RED else color.GREEN); #WILL CHANGE THE COLOR OF THE COLUMN BOX AssignBackgroundColor (IF SimpleMovingAvg("length" = ma1)."SMA" < SimpleMovingAvg("length" = ma2)."SMA" then color.RED else color.Light_GREEN); #ALERT.AssignValueColor(if CLOSE > ma1 then Color.DARK_GREEN else Color.Orange);
@MBF I've got a couple of comments. Firstly this might not be the most appropriate thread to ask about follow up questions on the LBR. Suggest that you repost your query under the LBR thread to enable ease of searches. Otherwise @BenTen would be kept busy by moving posts around to more appropriate threads to facilitate easier searches by folks interested in that topic
Secondly your query is unclear, so when you do repost to the LBR thread, post the actual study/scan you are using and state explicitly what you're looking for, aggregation periods, etc so that readers can get up to speed rather than have to second guess or make assumptions about the request. A golden rule I keep is when in doubt OVER communicate rather than under communicate
@tomsk I understand this post may make you question my questions but, I am doing the best I can at that moment and I do get overwhelmed sometimes. Due to that, I might be coming in here to get answers and a break from thinking. I know its an inconvenience to your time and I sincerely apologize and truly appreciate that you always try to come to my rescue.
#
# TD Ameritrade IP Company, Inc. (c) 2011-2019
#
#LBR
declare lower;
def price = close;
def calculationMode = {default Normal, Alternate};
FastLine = Average(price, 3) - Average(price, 10);
case Alternate:
FastLine = Average(price - Average(price[3], 3), 2);
}
plot SlowLine = Average(FastLine, 16);
plot Hist = FastLine;
plot ZeroLine = 0;
FastLine.SetDefaultColor(GetColor(1));
SlowLine.SetDefaultColor(GetColor(8));
Hist.DefineColor("Positive", Color.UPTICK);
Hist.DefineColor("Negative", Color.DOWNTICK);
Hist.AssignValueColor(if Hist >= 0 then Hist.Color("Positive") else Hist.Color("Negative"));
Hist.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Hist.HideTitle();
ZeroLine.SetDefaultColor(GetColor(7));
#end LBR
#ROC
declare lower;
def length = 14;
def colorNormLength = 14;
def price = close;
Assert(length > 0, "'length' must be positive: " + length);
plot ROC = if price[length] != 0 then (price / price[length] - 1) * 100 else 0;
plot ZeroLine = 0;
ROC.DefineColor("Highest", Color.YELLOW);
ROC.DefineColor("Lowest", Color.LIGHT_RED);
ROC.AssignNormGradientColor(colorNormLength, ROC.Color("Lowest"), ROC.Color("Highest"));
ZeroLine.SetDefaultColor(GetColor(5));
#End ROC
OH Im going to look!@MBF Interesting. Will take a look. Did you see the ROC RSI that I posted in the Warehouse? Is it the same as the one you're looking for?
Thats it! I am using the hl/2 setting, thats comparable to a ROC period 1?@MBF Interesting. Will take a look. Did you see the ROC RSI that I posted in the Warehouse? Is it the same as the one you're looking for?
I have the RSI on 3 OB/OS 70/30 and the ROC on Simple HL/2, I cant change ROC to 1@MBF The ROC/RSI I shared in the Warehouse uses the default settings from both original indicators. You would have to change the length according to your liking.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Repaints Cup and Handle Indicator for ThinkorSwim | Indicators | 23 | ||
Z-Score Probability Indicator for ThinkOrSwim | Indicators | 29 | ||
HTF PO3 Indicator For ThinkOrSwim | Indicators | 37 | ||
N | RSI - TSI Indicator For ThinkOrSwim | Indicators | 33 | |
Turtle Trade Channels Indicator(TuTCI) for ThinkOrSwim | Indicators | 32 |
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.