Script on william % not working with the scanning manager

Optuma Forums Optuma Scripting Script on william % not working with the scanning manager

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #65041
    Yan
    • Topics: 21
    • Replies: 29
    • Posts: 50

    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

    • This topic was modified 1 month ago by Yan.
    #65045
    Mathew
    • Topics: 40
    • Replies: 1,965
    • Posts: 2,005

    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.

    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

    1 user thanked author for this post.
    Yan
    #65049
    Yan
    • Topics: 21
    • Replies: 29
    • Posts: 50

    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.

    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

    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

    #65051
    Yan
    • Topics: 21
    • Replies: 29
    • Posts: 50

    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.

    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

    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……

    #65055
    Mathew
    • Topics: 40
    • Replies: 1,965
    • Posts: 2,005

    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

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest