Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Folks,
I apologize in advance if I'm stepping over any lines, but I need a hand and don't have the right tools to do what I want to accomplish. The long and short of it is my Dad asked me to write a TOS scan script for him. All well and fine except he's 1000 miles away and I don't use TOS. I won't say no to him, but I hate the idea of having to open/fund a TOS account to test one freakin scan.
The basic idea is to look for a pullback after a breakout above a specific very narrow Boll Band. The breakout has to have closed above the Top Boll Band at least 5 times and the last 5 of those have to include the pullback.
Anyway, I got the scan written in 2 other platforms to verify the results match and are what he wants. Then I tried to do the translation to TOS. I've written a script and believe the logic is sound. However, my coding of the logic lost something in TOS translation.
Anyone see where I went awry? He tells me the error highlights everything after the first Plot statement (first post-define statement) but gives a typical programming error message. (Might as well say "It don't work...try again!")
Plot ThreeAScan = (
C > AVGC50 and
C > TopBB and
C[1] > TopBB1 and
C[2] > TopBB2 and
C[3] > TopBB3 and
C[4] > TopBB4 and
((H < H[1] and H[1] > H[2] AND H[2] > H[3] AND H[3] > H[4]) OR
(H < H[1] and H[1] < H[2] AND H[2] > H[3] AND H[3] > H[4]) OR
(H < H[1] and H[1] < H[2] AND H[2] < H[3] AND H[3] > H[4]) OR
(H < H[1] and H[1] < H[2] AND H[2] < H[3] AND H[3] < H[4])) and
((L[5] = MINL7) OR
(L[6] = MINL8) OR
(L[7] = MINL9) OR
(L[8] = MINL10))
);
I'll have to think on it...but thanks for pointing me straight. I'll change if it doesn't screw up the logic, send it to my Dad and let him run it up the flagpole to see who salutes.
Well, that at least changed the error message. I simplified it a little bit to help figure things out. However, it now doesn't seem to recognize one of my "define" statements.
C > AVGC50 and
C > TopBB and
C[1] > TopBB1 and
C[2] > TopBB2 and
C[3] > TopBB3 and
C[4] > TopBB4 and
((H < H[1] and H[1] > H[2] AND H[2] > H[3] AND H[3] > H[4]) OR
(H < H[1] and H[1] < H[2] AND H[2] > H[3] AND H[3] > H[4]) OR
(H < H[1] and H[1] < H[2] AND H[2] < H[3] AND H[3] > H[4]) OR
(H < H[1] and H[1] < H[2] AND H[2] < H[3] AND H[3] < H[4])) and
((L[5] <= MINL7) OR
(L[6] <= MINL8) OR
(L[7] <= MINL9) OR
(L[8] <= MINL10))
);
Error now generated:
Expected double
No such variable: C at 20:1
No such variable: C at 21:1
No such variable: C at 22:1
No such variable: C at 23:1
No such variable: C at 24:1
No such variable: C at 25:1
No such variable: C at 20:1
No such variable: C at 21:1
No such variable: C at 22:1
No such variable: C at 23:1
No such variable: C at 24:1
No such variable: C at 25:1
Any ideas why it doesn't recognize the "def C = close;" statement ?