How can I use this script to create scan in TOS?Here is the scan code for this indicator... I recommend saving two separate scans, one for Longs and one for Shorts... I have tested against my main Watchlist using various timeframes with successful results... Enjoy...
Ruby:# Heikin_Ashi_Trend_Dots_Scan # Finds potential trend reversals based on Heikin Ashi trend transition direction. # Created by rad14733 for usethinkscript.com # v1.0 : 2021-08-13 : Initial release # v1.1 " 2021-08-17 : Added ability to scan for "unconfirmed" (Yellow) signals def haClose = ohlc4; def haOpen = (haOpen[1] + haClose[1]) / 2; def haTrendUp = if haClose >= haOpen then 1 else 0; def haTrendDn = if haClose < haOpen then 1 else 0; def haSignal = if haTrendUp == 1 and haTrendUp[1] == 1 then 1 else if haTrendDn == 1 and haTrendDn[1] == 1 then -1 else 0 ; # NOTE: ONLY ONE PLOT ALLOWED PER SCAN. # Comment out the unwanted plots and Un-Comment the desired plot # Long trend transition plot long = haSignal[1] == 0 and haSignal == 1; # Short trend transition plot short = haSignal[1] == 0 and haSignal == -1; # Unconfirmed trend transition plot unconfirmed = if (haTrendUp == 1 and haTrendUp[1] == 0) or (haTrendDn == 1 and haTrendDn[1] == 0) and haSignal != haSignal[1] then 1 else Double.NaN; # END - Heikin_Ashi_Trend_Dots_Scan
How can I use this script to create scan in TOS?
Apologies as IM new to inputting the thinkscript into TOS. I was able to input the actual Study script and that works great. But when I cut n paste each of your LONG and SHORT and UNCONFIRMED line text for the Scan I'm confused about where to place the line for LONG and then in a separate but similar scan where to insert the line for SHORT ...and ...which existing lineHere is the scan code for this indicator... I recommend saving two separate scans, one for Longs and one for Shorts... I have tested against my main Watchlist using various timeframes with successful results... Enjoy...
UPDATES:
# v1.0 : 2021-08-13 : Initial release.
# v1.1 : 2021-08-17 : Added ability to scan for "unconfirmed" (Yellow) signals.
# v1.2 : 2021-08-25 : Fixed logic for proper scan results and added more usage comments.
Ruby:# Heikin_Ashi_Trend_Dots_Scan # Finds potential trend reversals based on Heikin Ashi trend transition direction. # Created by rad14733 for usethinkscript.com # v1.0 : 2021-08-13 : Initial release. # v1.1 : 2021-08-17 : Added ability to scan for "unconfirmed" (Yellow) signals. # v1.2 : 2021-08-25 : Fixed logic for proper scan results and added more usage comments. def haClose = ohlc4; def haOpen = (haOpen[1] + haClose[1]) / 2; def haTrendUp = if haClose >= haOpen then 1 else 0; def haTrendDn = if haClose < haOpen then 1 else 0; def haSignal = if haTrendUp == 1 and haTrendUp[1] == 1 then 1 else if haTrendDn == 1 and haTrendDn[1] == 1 then -1 else 0 ; # NOTE: ONLY ONE PLOT ALLOWED PER SCAN. # When Pasting into the TOS Scanners you must comment out the unwanted plots and Un-Comment the desired plot. # When referencing the Study from within the TOS Scanners, simply select the desired plot. # Long trend transition (GREEN) plot long = haSignal == 1; # Short trend transition (RED) plot short = haSignal == -1; # Unconfirmed trend transition (YELLOW) plot unconfirmed = haSignal == 0; # END - Heikin_Ashi_Trend_Dots_Scan
The only Plot I get in the drop-down is "haDot" in the scan tab referencing the study. What am I missing. The study was cut and pasted....?
I was just referencing post #37 and attempting to do it that way..... Went Back to #8 and got it loaded correctly. ThanksYou have the wrong code... Check Post #8 for the Scan code... The only plots in the code are long, short, and unconfirmed... I understand the possibility for confusion... I have been trying to get caught up so I can split this single topic into individual topics for each script...
Rad, would it be possible to remove the dots from sub but keep the paint bar?
Yes it was added to lower indicator. I was thinking about a loop, fold statement that you could input the number of down signals to calculate the reversal of the trend. So seeing let say 10 down signals and then start turning up which usually means a stronger up trend. Not just looking at down signals but lower and lower down signals. down and lower closes.
The Heiken-ashi scan is in post#8Hello!
Trying to see if it is possible to create a scanner with the following parameters:
Chart Type Heikin Ashi, daily
MACD parameters: 20,26,9
Chart colors: Green up, red down
Two Types of scans:
BUY
SELL
BUY parameters:
First green bar after a red bar AND MACD line crossing over the signal line (both conditions have to match)
Return results for any tickets that match the above criteria within the last 3 bars
SELL parameters
First red bar after a green bar AND MACD line crossing BELOW the signal line (both conditions have to match)
Return results for any tickets that match the above criteria within the last 3 bars
I looked at the following thread but was not able to create what I'm looking for.
https://usethinkscript.com/threads/heiken-ashi-scan.7501/page-2#post-74073
That pattern is not appropriate for use with HA candlesJust looking for an inside bar scanner for heiken ashi candles. There's a plethora of inside bar scanners and the TOS built in scanners would do even I just need to know how to convert that to find them for HA candles instead. Thanks for any help in advance.
have you able to convert this to scanner?@rad14733
I noted that after a long red period it transitions yellow then green, helps isolate significant trend changes
# Added to detect significant trend change
def UpTrend = if haSignal[5] == -1 and haSignal[4] == -1 and haSignal[3] == -1 and haSignal[2] == -1 and ( haSignal[1] != -1 and haSignal[1] != 1) and haSignal[0] == 1 then 1 else 0;
AddVerticalLine(UpTrend,"Bull",Color.Green);
Changing:have you able to convert this to scanner?
To:def UpTrend
makes it scannableplot UpTrend
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
J | Lower Chart Heiken Ashi With Candles | Questions | 1 | |
E | Heiken Ashi Overlay Displaced | Questions | 1 | |
I | MTF Dashboard Heiken Ashi Labels | Questions | 0 | |
Heiken Ashi Upper Indicator | Questions | 4 | ||
B | Heiken Ashi signal change | Questions | 0 |
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.