The script stopped working when I changed the day of week to 1 & 2. I am now trying to get the highest high and lowest low of the first 2 days of the week, plot that from last Wed thru this weeks Tues and change on Wed to this weeks first 2 days.
akiri
One of the reasons the script is not working was explained by Jason in an earlier post (see quoted excerpt from that post)
Originally posted by JasonK Hello akiri,
<SNIP>
However, prior to the return statement at the end of main() you are executing some drawing functions that do not have valid parameters. You're making a function call out of a global variable, nTFHigh_1(0). With the (0) added to the end of the variable, EFS is trying execute a function with that name while passing 0 as a parameter. This is valid syntax but because the function does not exist in your formula EFS exits the formula. Change these parameters to remove the (0).
At this point your code should generate an error that nTFHigh_1 has no properties. This occurs at initialization or the beginning of processing because on the first bar that gets processed, nTFHigh_1 is still null. To correct this error you can add a conditional check for a non-null value of this variable in the associated if() statement that also validates nTime.
<SNIP>
The other reason is that in line 19 of the script you set the condition to check if dayOfWeek is equal to 3 instead of 1
Once you make these changes the script should work as intended
Alex
Originally posted by akiri The script stopped working when I changed the day of week to 1 & 2. I am now trying to get the highest high and lowest low of the first 2 days of the week, plot that from last Wed thru this weeks Tues and change on Wed to this weeks first 2 days.
Comment