TOS Scan Errors on Breakout?


Category:
0
0

Hi Pete,

I’m setting up two TOS scans using the codes below (long and short), but it keeps giving errors. Please help to fix. Thank you!

EMA BREAKOUT LONG
high is less than high from 1 bars ago and low is greater than low from 1 bars ago and high from 1 bars ago is greater than high from 2 bars ago and MACD().”Value” is greater than MACD().”Avg” and MACD().”Value” is greater than MACD().”ZeroLine” and MACD().”Value” is less than MACD().”Value” from 1 bars ago and MACD().”Value” from 1 bars ago is greater than MACD().”Value” from 2 bars ago and low is less than MovAvgExponential(“length” = 3) and low from 1 bars ago is less than MovAvgExponential(“length” = 3) from 1 bars ago and close is greater than MovAvgExponential(“length” = 18) and close from 1 bars ago is greater than MovAvgExponential(“length” = 18) from 1 bars ago and close from 2 bars ago is less than MovAvgExponential(“length” = 18) from 2 bars ago.

CURRENT BAR SCAN:

Open > 18 EMA
Close > 18 EMA
Low < 18 EMA

VARIABLES:

  • MACD Value = 3, 6
  • MACD Avg = 9
  • Add Average Daily Volume (ADV) requirement (greater than 250000)

EMA BREAKOUT SHORT
high is less than high from 1 bars ago and low is greater than low from 1 bars ago and low from 1 bars ago is less than low from 2 bars ago and MACD().”Value” is less than MACD().”Avg” and MACD().”Value” is less than than MACD().”ZeroLine” and MACD().”Value” is greater than MACD().”Value” from 1 bars ago and MACD().”Value” from 1 bars ago is less than MACD().”Value” from 2 bars ago and high is greater than MovAvgExponential(“length” = 3) and high from 1 bars ago is greater than MovAvgExponential(“length” = 3) from 1 bars ago and close is less than MovAvgExponential(“length” = 18) and close from 1 bars ago is less than MovAvgExponential(“length” = 18) from 1 bars ago and close from 2 bars ago is greater than MovAvgExponential(“length” = 18) from 2 bars ago

CURRENT BAR SCAN: 

Open < 18 EMA
Close < 18 EMA
Low > 18 EMA

VARIABLES:

  • MACD Value = 3,6
  • MACD Avg = 9
  • Add Average Daily Volume (ADV) requirement (greater than 250000)
Marked as spam
Posted by (Questions: 23, Answers: 57)
Asked on May 13, 2019 5:42 pm
132 views
0
Private answer

I tested both. The code for "breakout long" loads and produces no errors. The code for "breakout short" does produce an error and I have found the reason why. There is a line where you have the word "than" repeated twice in a row.

MACD().”Value” is less than than MACD().”ZeroLine” and MACD().”Value” is greater than

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on May 16, 2019 3:01 pm
0
Thanks! How do you define the MACD variables in the code? VARIABLES: MACD Value = 3, 6 MACD Avg = 9 Because when I add MACD Value = 3, 6 MACD Avg = 9 it says, ”Invalid statement: Value at1:6” Also, when I run scan, there’s no results at all. Please copy your code or a screen shot for me to try on my TOS. Thanks!
( at May 16, 2019 3:27 pm)
0
Those are input parameters. Not variables. The input parameters can be adjusted when you are adding the conditions to the study filter.
( at May 27, 2019 10:16 am)