TC2000 scan for 4% breakouts


Category:
0
0

Hello,

I am trying to convert this TC2000 scan I use for a 4% breakout scan to be used in the Think Or Swim scanner. Can you take a look at this and let me know what I am doing wrong and need to change?

PCF: C >= AVGC10 + (0.8) * SQR((((C – AVGC10) ^ 2 + (C1 – AVGC10) ^ 2 + (C2 – AVGC10) ^ 2 + (C3 – AVGC10) ^ 2 + (C4 – AVGC10) ^ 2 + (C5 – AVGC10) ^ 2 + (C6 – AVGC10) ^ 2 + (C7 – AVGC10) ^ 2 + (C9 – AVGC10) ^ 2 + (C10 – AVGC10) ^ 2 ) / 10) ) AND C1 <= AVGC10 + (0.8) * SQR((((C1 – AVGC10.1) ^ 2 + (C2 – AVGC10.1) ^ 2 + (C3 – AVGC10.1) ^ 2 + (C4 – AVGC10.1) ^ 2 + (C5 – AVGC10.1) ^ 2 + (C6 – AVGC10.1) ^ 2 + (C7 – AVGC10.1) ^ 2 + (C9 – AVGC10.1) ^ 2 + (C10 – AVGC10.1) ^ 2 + (C11 – AVGC10.1) ^ 2 ) / 10) )

 

Thank you

Marked as spam
Posted by (Questions: 6, Answers: 12)
Asked on November 9, 2017 6:31 pm
1427 views
1
Private answer

Finally got around to this. I have no idea how you would use this to build a scan. Your code merely does a bunch of number crunching and assigns the final value to a variable named “PFC”. For this reason I added a plot scan statement at the very end that does not do anything. I have it set to 0 so it will return no results. You will have to replace the number zero with some logic that uses PFC as the result of a true/false test.

For this one, I decided it was best to keep the original source code in tact with minimal changes. This reduces the chance for typographical errors. To facilitate this I merely created defined variables for each of the TC2000 formula codes.


def C = close;
def AVGC10 = Average(close, 10);
def C1 = close[1];
def C2 = close[2];
def C3 = close[3];
def C4 = close[4];
def C5 = close[5];
def C6 = close[6];
def C7 = close[7];
# we skip C8????
def C9 = close[9];
def C10 = close[10];
def C11 = close[11];
def PCF = C >= AVGC10 + (0.8) * Sqrt(((Power(C – AVGC10, 2) + Power(C1 – AVGC10, 2) + Power(C2 – AVGC10, 2) + Power(C3 – AVGC10, 2) + Power(C4 – AVGC10, 2) + Power(C5 – AVGC10, 2) + Power(C6 – AVGC10, 2) + Power(C7 – AVGC10, 2) + Power(C9 – AVGC10, 2) + Power(C10 – AVGC10, 2) ) / 10) ) AND C1 <= AVGC10 + (0.8) * Sqrt(((Power(C1 – AVGC10[1], 2) + Power(C2 – AVGC10[1], 2) + Power(C3 – AVGC10[1], 2) + Power(C4 – AVGC10[1], 2) + Power(C5 – AVGC10[1], 2) + Power(C6 – AVGC10[1], 2) + Power(C7 – AVGC10[1], 2) + Power(C9 – AVGC10[1], 2) + Power(C10 – AVGC10[1], 2) + Power(C11 – AVGC10[1], 2) ) / 10) );
plot scan = 0;

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on November 13, 2017 7:05 pm
0

Thank you, Pete. I will look at the code I originally posted to make sure I didn’t miss anything. I the meantime, thank you for looking this over.

( at November 13, 2017 8:23 pm)
0

Hello Pete,

Like you said there is a portion that got missed. So in saying that, the less complicated version is:
PCF: (((C1/C2) *100) < 104) AND (((C2/C3) *100) < 104) AND (((C3/C4) *100) < 104) AND (((C4/C5) *100) < 104) AND (((C5/C6) *100) < 104) AND (((C6/C7) *100) < 104) AND (((C7/C8) *100) < 104) AND (((C8/C9) *100) < 104) AND (((C9/C10) *100) < 104) AND (((C10/C11) *100) < 104) Scan made easy :1. Common stocks 2. 4% breakout PCF = true 3. No 4% breakout in previous 10 days PCF = true Thank you for looking at this.

( at November 17, 2017 3:30 pm)
0

yeah, well. That is not LESS complicated. Tough to interpret your bullet points 1-3. Somewhere in there I see PCF = true. So I would take the code I already published and change plot scan = 0; to plot scan = PCF;

( at November 17, 2017 8:25 pm)
0

Ok. Thank you again, Pete. Have a Happy Thanksgiving.

( at November 22, 2017 8:33 am)