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?
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).