Thread: Scilab / C question

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    2

    Scilab / C question

    Hello everyone, first post! I've been out of the coding game for a LONG time and I was wondering if someone here might know the answer to this question....

    I'm working on back testing a trading algo using scilab which looks to be C based (has a lot of C based operations at a minimum). I don't know how to read this FOR loop, could you please explain it to me?

    cprice is a single column x 10 row filled with double values

    Code:
    ma = 20; 
    for k = size(cprice,1):-1:ma
        M(k,1)=mean(cprice(k-ma+1:k));
        V(k,1)=sqrt(variance(cprice(k-ma+1:k)));
    end
    Thanks for any help you might be able to provide
    Last edited by Salem; 03-12-2012 at 11:45 AM. Reason: removed all the font/colour abuse

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    2
    Yeah, thanks. I was looking for the answer in the wrong place.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-23-2011, 09:00 AM
  2. *szString = things question/memory question
    By Jang in forum C Programming
    Replies: 3
    Last Post: 01-20-2011, 04:59 AM
  3. Newbish Question file reading question....
    By kas2002 in forum C Programming
    Replies: 23
    Last Post: 05-17-2007, 12:06 PM
  4. Self regiserting DLLs question and libraries question.
    By ApocalypticTime in forum Windows Programming
    Replies: 2
    Last Post: 03-22-2003, 02:02 PM
  5. How to create matlab/scilab-like interface...
    By Captain Penguin in forum C++ Programming
    Replies: 0
    Last Post: 10-09-2002, 06:44 PM