Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Yeah you and me both. meh. Thank you for helping me!@MBF I do not
switch (calculationMode) {
case Normal:
FastLine = Average(price, 3) - Average(price, 10);
case Alternate:
FastLine = Average(price - Average(price[3], 3), 2);
}
Hi @tomsk
Yeah I don't know anything about coding. I have managed some codes on my own but with little else to do to them but a tweak here or there. I took out input and put in define instead but it came out red. I mashed the two into one and changed those but thats it. It's for a class.
LOL not a coding class, a trading workshop. My brain would pop. I do understand what you're saying. Before this room I would look at other codes that were similar to what Id want and try that. It worked maybe %20 of the time.@MBF Happy to help with your "coding" journey, the TOS editor is never wrong as it parses through the code that users enter. I have learnt to spot coding inconsistencies by first formatting complicated looking code to a "standard" format that makes it easy to read. Additionally I do all my code development directly in Notepad and once complete I then copy and paste from my NotePad directly to the editor. I still have the occasional error but thank goodness it is perhaps around 2-3% of the time! Have fun out there!
Well hi you! Thought you fell into a hole.@MBF Please post the tradestation codes here in a separate thread. Someone will be able to port the code.
# LBR Three Ten Signal Arrows
# tomsk
# 12.11.2019
# 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 "high_low", Alternate};
def FastLine;
switch (calculationMode) {
case high_low:
FastLine = Average(price, 2) - Average(price, 9);
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.995 * close 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.005 * close else Double.NaN;
#crossDn.SetpaintingStrategy(PaintingStrategy.ARROW_DOWN);
#crossDn.SetDefaultColor(Color.CYAN);
#crossDn.SetLineWeight(4);
# End LBR Three Ten Signal Arrows
# LBR Three Ten Signal Arrows
# tomsk
# 12.11.2019
# 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 "high_low", Alternate};
def FastLine;
switch (calculationMode) {
case high_low:
FastLine = Average(price, 2) - Average(price, 9);
case Alternate:
FastLine = Average(price - Average(price[3], 3), 2);
}
def SlowLine = Average(FastLine, 16);
def crossUp = if showCrossUp and FastLine crosses above SlowLine then 0.995 * close else Double.NaN;
def crossDn = if showCrossDn and FastLine crosses below SlowLine then 1.005 * close else Double.NaN;
AssignBackgroundColor(if crossUp then color.dark_green else if crossDn then color.dark_red else color.gray);
plot static = 1;
input price = close;
input calculationMode = {default high_low, "Alternate"};
def fastLine;
switch (calculationMode) {
case high_low:
fastLine = Average(price, 3) - Average(price, 10);
case Alternate:
fastLine = Average(price - Average(price[3], 3), 2);
}
def slowLine = Average(fastLine, 16);
#def crossAbove = fastLine[1] < slowLine[1] and fastLine #> slowLine;
#def crossBelow = fastLine[1] > slowLine[1] and fastLine #< slowLine;
Def hist = fastline - slowline;
Def crossAbove = hist[1] < fastLine[1] and hist > fastLine;
Def crossBelow= hist [1] > fastLine[1] and hist < fastLine;
plot data = if crossAbove then 1 else if crossBelow then -1 else 0;
data.AssignValueColor(if data <> 0 then Color.BLACK else Color.CURRENT);
AssignBackgroundColor(if data > 0 then Color.GREEN else if data < 0 then Color.RED else Color.CURRENT);
Did you know that clicking on a member's avatar will allow you to see when a member was last seen on the uTS forum? @MBF has not been seen in a while.Show your chart or a link please
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.