Translate from TC2000 to scan for Patterns


Category:
0
0

Hi Pete,

Please translate below TC2000 scan to specifically search for Pop-Out-Of-The-Box-Patterns:

MAXC4 > (MINC20.4 * 1.12) AND C > (MAXC20.4 * 0.98) AND ( ((MAXC4 < MINC4 * 1.015) OR (MAXH4 < MINH4 * 1.015) ) AND ((MAXO4 < MINO4 * 1.015) OR (MAXL4 < MINL4 * 1.015) ) )

 

Marked as spam
Posted by (Questions: 23, Answers: 57)
Asked on October 4, 2017 7:46 pm
500 views
0
Private answer

Take this for a spin and let me know how it works. I retained the exact same structure that is taken from the TC2000 code. I did this by defining variables, named for each element in the original code. I had to change a couple ‘.’ to ‘_’ because thinkscript does not permit decimal points in variable names.

def maxC4 = Highest(close, 4);
def minC20_4 = Lowest(close[4], 20);
def maxC20_4 = Highest(close[4], 20);
def minC4 = Lowest(close, 4);
def maxH4 = Highest(high, 4);
def minH4 = Lowest(high, 4);
def maxO4 = Highest(open, 4);
def minO4 = Lowest(open, 4);
def maxL4 = Highest(low, 4);
def minL4 = Lowest(low, 4);
def c = close;
def signal = C > (MAXC20_4 * 0.98) AND ( ((MAXC4 < MINC4 * 1.015) OR (MAXH4 < MINH4 * 1.015) ) AND ((MAXO4 < MINO4 * 1.015) OR (MAXL4 < MINL4 * 1.015) ) );
plot scan = signal;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on October 5, 2017 9:23 am
0

Thanks, Pete! It works!

( at October 6, 2017 11:11 am)