How to add a pattern into a scanner or to a watchlist?


Category:
0
0

After applying the ZIGZAGSTEPPATTERN on think or swim, I was truly amazed. On the daily and minute chart one can see the scanner showing a buy signal in the form of an arrow. It worked for recent breakouts such as FNBC, MTBC, PED, etc. It would be great if there was a way to add it to our scanners, however, the editor did not allow me since it disclaimed that the code was “too complex”.

I have a question Mr. Hahn, lately I have been using an extremely effective pattern in the thinkorswim platform, its the ZIGZAGSTEPPATTERN, and I really really wish I could get a way to add it to a scanner or to a watchlist reflecting when the arrow has made the move within a certain number of bars so we can still buy that stock before its too late. The pattern is quite simple is just an arrow, however, I tried adding it to my scanner and it said that it was too complex to add it to a scanner, is there any way we can add it to a watchlist?

input priceH = high;
input priceL = low;
input percentageReversal = 5.0;
input absoluteReversal = 0.0;
input atrLength = 5;
input atrReversal = 1.5;

def zigZag = reference ZigZagHighLow(priceH, priceL, percentageReversal, absoluteReversal, atrLength, atrReversal).ZZ;

def step1 = open[1] >= open and open >= close[1] and open[1] > close[1];
def step2 = open[1] close[1];
def downStep1 = step1 and close < close[1]; def downStep2 = step2 and close < open[1]; plot UpStep = (upStep1 or upStep1[-1] or upStep2 or upStep2[-1]) and zigZag == low; plot DownStep = (downStep1 or downStep1[-1] or downStep2 or downStep2[-1]) and zigZag == high; UpStep.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); UpStep.SetDefaultColor(GetColor(0)); UpStep.SetLineWeight(2); DownStep.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); DownStep.SetDefaultColor(GetColor(1)); DownStep.SetLineWeight(2);

 

 

If there is any way you can help me Mr. Hahn I would greatly appreciate it.

 

Marked as spam
Posted by (Questions: 6, Answers: 14)
Asked on May 10, 2017 3:00 pm
2581 views
0

Couple things. First, when I copy and paste the code you provided there appears to be some lines missing. So I am not able to test it on my platform. Second thing to mention is that the ZigZag indicator is almost never useful for trading on a live chart. This is because it must be able to read the future in order to plot the lines and signals. Not saying that is the case in your specific code. I will need a fully functioning code in order to know for sure. Have you been trading these signals on a live chart or have you just been back testing the signals it generates?

( at May 10, 2017 4:30 pm)
0

Thank you for your quick response Mr. Hahn, I have tested it live, it does work, I would say that one out of five times it gives a false signal but I have seen it and used it in live charts. The code that I provided I just directly copied and pasted it from the patterns section on TOS, its under ZIGZAGSTEPPATTERN, however, it did not work to set as a scanner.

( at May 10, 2017 11:43 pm)
0
Private answer

After receiving additional details I was able to copy the code from the candlestick pattern in the charts tab. After configuring the code for the scan (delete the last six lines and comment out one of the plots). The compiler gave an error that the expression was too complex to evaluate. So I took the ZigZag indicator out of the logic and the error cleared up. The code for this pattern cannot be run in the scan engine or a watchlist. Neither will work, as long as the ZigZagHighLow is part of the signals.

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on May 11, 2017 8:28 am
0

Thank you for the attempt Pete, you should try this pattern, is quite accurate for entries (:

( at May 12, 2017 1:35 am)