Script on william % not working with the scanning manager

Hi there,

I just tried the willam indicator on scanning manager with the following script, to catch a potential swing trade.

a1 = 100 * ( HIGHESTHIGH(BARS=20) - CLOSE() ) / ( HIGHESTHIGH(BARS=20) - LOWESTLOW(BARS=20) ) ;
v1=(a1- offset(a1, offset=1))/offset(a1, offset=1);
v1>0 and v1<0.1

then i set scanning manager with 1 month timeframe, but the scanning results shows nothing here.

658

So is there something wrong with the code ? Or there is something wrong with the scan manager setup? (i just verified with some codes, knowing that there are some codes who matches the script at the moment)

Thank you for your time

Yan

Hi Yan,

Whenever a script is not working, it is always best to break it into parts and look at it on the chart. eg here is your script without the last line as a Show View.

a1 = 100 * ( HIGHESTHIGH(BARS=20) - CLOSE() ) / ( HIGHESTHIGH(BARS=20) - LOWESTLOW(BARS=20) ) ;
v1=(a1- offset(a1, offset=1))/offset(a1, offset=1);

will

You can see straight away that a value between 0 and 0.1 is very unlikely to happen. You will need to fix the last line.

Hope that helps

Mathew

[postquote quote=65045]
Hi, Mathew

As you request, i tried to break the script into parts and check everything little by little. And here is what i found.

The problem comes from the function offset, i did try it with what i found in the knowledge base with the link as follow:

https://help.optuma.com/kb/faq.php?id=1070

apparently, when i change offset(a1,offset=1) into a1(1) or a1[1], the result changed dramatically which suggests a result different from what’s in the knowledge base.

Again, i am not good at programming, so i can’t explain this myself. I will try to solve it myself, but sometimes it really makes me confused for following the instruction and get a different result…

i will let you know what i find later.

Yan

[postquote quote=65045]

I just double checked the script, it does give me the result that i want on monthly chart. For example, with the monthly data, i get 0.009 on this stock

058

and that’s why i put v1>0 and v1<0.1 here.

I really don’t understand why scanning manager can’t find this stock even it meets the script.

Confusing…

Hi Yan,

This looks like an issue with the Scanner when you select “Last Bar”. Change it to “Last Month” and it should work.

Last Bar works for the first two weeks of the month but then seems to change. I’m looking into it now to see what is happening.

All the best

Mathew