Posted By: johnnyp
Annoyances with script compilation and sliders - 09/14/17 13:36
I have a script which I usually run on 1 minute bars. Suppose I make a change to the script that causes compilation to fail, then I press Test, it tells me of the error and resets the bar period slider to 60 and the other sliders to their default values. So I fix the code and then I have to adjust the sliders again before pressing Test.
Does no one else find this exasperating?
A compilation failure should not reset the sliders, or am I doing it all wrong?
Posted By: jcl
Re: Annoyances with script compilation and sliders - 09/14/17 13:45
Sliders are not reset by a compilation failure. They are reset when you modify the code.
Posted By: johnnyp
Re: Annoyances with script compilation and sliders - 09/14/17 16:13
Nope. Code modification usually does not cause slider reset. Given how my teeth grind together each time the sliders are reset, I think I would have noticed. Besides, I have just tested adding a printf line to my script - the sliders did not move.
This test was realised using the latest beta version 1.62.1, downloaded today.
Posted By: jcl
Re: Annoyances with script compilation and sliders - 09/14/17 16:46
If not by code modifying, then your sliders were probably reset by something else, like selecting a different script? I don't think that sliders know about compilation errors.
Posted By: johnnyp
Re: Annoyances with script compilation and sliders - 09/14/17 19:10
My mistake. I need to be more specific. Compilation errors don't cause the sliders to reset, but some runtime errors do.
I'll report back when I find an example.
Posted By: johnnyp
Re: Annoyances with script compilation and sliders - 09/14/17 19:59
Here is a weird one.
I have t6 file containing data starting on the 7th September this year. I have a script that compiles ok, but when run gives the following error 055 binEURUSD 2016 (binEURUSD_2016.bar) history missing.
I move the bar period slider to 1, and press test. Same error, and the slider jumps back to 60.
I add BarPeriod = 1; to the script and press test. Hey presto, no error, the script works fine.
Question: why did it try running the script with period 60 when I had explicitly set the period slider to 1?
Similar question: why do I need to run a script once before I can set any custom sliders? Until I have successfully run the script the sliders are all called "SliderX" where X is 1, 2 or 3.