Scanning Candlestick Patterns


Category:
0
0

Hello Peter,

1.On TOS scan I see only patters, classic pattern (triangle, rectangle, had and shoulder..) scan but on no candlestick pattern (doji, hammer…). Is there any way I can add these 2 candlestick: Hamari, ThreeInsideUp, ThreeOutsideUp in a weekly scan on TOS?

2. Can I scan OBV and AccDist studies when they all reach 10 percent or less?

Marked as spam
Posted by (Questions: 5, Answers: 2)
Asked on April 23, 2020 1:49 pm
1020 views
0
Private answer

When you get to the section of the platform where you can add candlestick patterns to a chart you will find that you can open the code editor and view the source code. Copy the source code and you should be able to paste that into a new Study Filter to build a scan for the selected candlestick pattern.

Case in point, the code that runs the Hamari candlestick pattern. Here is the code I copied from that pattern. I have removed the style statements and converted the existing plot statements to def. I then added two plot statements you should be able to use for scans:

input length = 20;
input trendSetup = 3;
input bodyFactor = 0.3;
assert(bodyFactor >= 0, "'body factor' must not be negative: " + bodyFactor);
def BodyHeight = BodyHeight();
def IsShort = BodyHeight < bodyFactor * Average(BodyHeight, length);
def BodyMax = Max(open, close);
def BodyMin = Min(open, close);
def IsEngulfing = BodyMax < BodyMax[1] and BodyMin > BodyMin[1];
def Bearish = IsAscending(close, trendSetup)[1] and
IsLongWhite(length)[1] and
IsEngulfing and
IsShort;
def Bullish = IsDescending(close, trendSetup)[1] and
IsLongBlack(length)[1] and
IsEngulfing and
IsShort;
plot scan = Bearish;
#plot scan = Bullish;

I have not tested this. So I have not confirmed that this actually works. But this is the best we can do. if it does not work there is nothing we can do about it.

For the OnBalanceVolume and AccDist indicators. You can build this using the Condition Wizard:

https://www.hahn-tech.com/thinkorswim-condition-wizard/

The problem is these studies use a function named "TotalSum()". This function computes the sum for every bar on the chart. When you change the amount of data on the chart you change it's values. These sort of chart studies are mostly useless, if not downright harmful. Because folks will spend a great deal of time trying to build a strategy based on these studies not realizing the values will change depending how much data you have loaded on the chart.

So these studies are only useful when evaluating which direction they are moving. But the actual values themselves are completely meaningless. Any scan you construct using these indicators will never match the results you get on the charts. Because the amount of historical data used in the scan can never be replicated on the chart.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 23, 2020 5:28 pm