Optuma Forums › Optuma Scripting › Script on william % not working with the scanning manager › Reply To: Script on william % not working with the scanning manager
- Topics: 24
- Replies: 34
- Posts: 58
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.
1234 a1 = 100 * ( HIGHESTHIGH(BARS=20) - CLOSE() ) / ( HIGHESTHIGH(BARS=20) - LOWESTLOW(BARS=20) ) ;v1=(a1- offset(a1, offset=1))/offset(a1, offset=1);
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