Hi
I’ve used a few different codes to try to run my system, but the latest one works fine for backtesting, loads up OK for Pro-Order, but then crashes and I get an error message advising me to modify it and backtest it. My problem is that the current coding backtests fine, but crashes in use, so I wonder if there’s anywhere in particular I should be looking at given the error message (eg does the “ex:(-10)” relate to anything specific or is it a generic error code?).
Obviously I’ve read what it says, but I’m confused as to why a parameter can’t equal zero; if we define a parameter why wouldn’t it be allowed to equal zero?
Many thanks in advance.
That error message is talking about the way you have set a period for an indicator, example:
var = average[myPeriod](close)
If for any reason, “myPeriod” equal 0 or a negative value, then the program will crash. As it is not really a problem while backtesting, it could devastating in real time situation with real money. So just check all of your indicators period first.
Ah, OK, great, many thanks, I know where to start looking. Thanks for explaining, that makes sense, and I have included a time period bit of coding in this version so that’s very likely to be the problem.
Thanks again, I made a very small modification (added +1 so the parameter can’t be zero) and the code has successfully executed a (winning :-)) trade this afternoon and is still running. Much appreciated.