I used the AlgoTradingDemo1.m with SMA+RSI to find an optimal parametres for few currencies and I received the following error.
Error in @(x) marsiFun(x,BundClose,annualScaling,cost);
Error in parametersweep at 57
Error in AlgoTradingDemo1 at 35
[maxSharpe,param,sh] = parameterSweep(fun,range);
The loop change the FX price and gives each time different parametres for each currency.
Could you please give me an idea of what could cause this error?
I run the Algotrading1 and Algotrading2 with different data, but the result for the best ledlag is the same for different datas, such as 10:394 and 2:396.
why do my best estimators not change when I use different datas?
This is a lot of stuff in very compact form. Thanks for this good example.
Just one comment: If you publish examples you should take the work to make them correct or even tell the user that it is delivering wrong results and can not be used (see Javier comment).