After a morning's tedious debugPrint()ing I find that the statement:
causes the script to restart (ie with "getBarState() == BARSTATE_ALLBARS").
The series is accessed in this transient way because it was only needed infrequently. I gathered from previous threads that I should not create and store series if I don't need to.
This is just crazy:
1) Why?
2) The code simply exits at the statement, no error is thrown (not caught by a try()), the next line does not execute. I don't this is normal in any other programming environment. I don't believe the docs mention this behaviour at all.
3) I wonder if this explains why, in other scripts, I have noticed occasional multiple alert firings - is this because of it rerunning? [Oddly, I can't get this script to fire an alert at all with historic bars as part of testing.] What would happen with strategy backtesting (a topic I know nothing about, but can see that some executions could be duplcated)?
4) There are peformance issues.
5) Why can't there be some clear explanation that BARSTATE_ALLBARS can occur more than once, and all the situations that could cause it?
If I create the series at start up I get no problem - I can also access a transient occurence without causing a restart.
In general I'm finding efs offers some surprising scenarios that don't seem to be explained and thus my code is not prepared for - either structurally or performance wise. Coupled with the absense of a debugger progress is far slower than I would expect.
An unhappy programmer.
PHP Code:
hh1 = highest(6).getValue(-1)
The series is accessed in this transient way because it was only needed infrequently. I gathered from previous threads that I should not create and store series if I don't need to.
This is just crazy:
1) Why?
2) The code simply exits at the statement, no error is thrown (not caught by a try()), the next line does not execute. I don't this is normal in any other programming environment. I don't believe the docs mention this behaviour at all.
3) I wonder if this explains why, in other scripts, I have noticed occasional multiple alert firings - is this because of it rerunning? [Oddly, I can't get this script to fire an alert at all with historic bars as part of testing.] What would happen with strategy backtesting (a topic I know nothing about, but can see that some executions could be duplcated)?
4) There are peformance issues.
5) Why can't there be some clear explanation that BARSTATE_ALLBARS can occur more than once, and all the situations that could cause it?
If I create the series at start up I get no problem - I can also access a transient occurence without causing a restart.
In general I'm finding efs offers some surprising scenarios that don't seem to be explained and thus my code is not prepared for - either structurally or performance wise. Coupled with the absense of a debugger progress is far slower than I would expect.
An unhappy programmer.
Comment