Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Optimizing parameters trading system
Replies: 5   Last Post: Jul 24, 2012 4:20 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Sargondjani

Posts: 176
Registered: 8/30/11
Re: Optimizing parameters trading system
Posted: Jul 24, 2012 2:23 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Jelle" wrote in message <jumo8t$mg6$1@newscl01ah.mathworks.com>...
> I changed the script to optimize both the short and long period moving average:
>
> sh = nan(100,100);
>
> for n = 1:100
> for m = n:100
> [~,sh(m)] = movavg(Data.Closing(:,1), n, m)
> end
> end
>
> However I still get
>
> ??? In an assignment A(I) = B, the number of elements in B and I must be the same.


You should take error messages very literally.
sh(m) is a number, while i suspect that the right hand side is vector/matrix, ie. the number of elemens are not the same

if you try:
[~,temp] = movavg(Data.Closing(:,1), n, m)
and then but a break after that line (click in left margin, till red dot appears) then run the code. you will now see what the size of temp is. this is also the size that sh(m) should have.

(afterwards go to "exit debug mode" in dropdown menu 'debug')



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.