Scilab / C question

This is a discussion on Scilab / C question within the Tech Board forums, part of the Community Boards category; Hello everyone, first post! I've been out of the coding game for a LONG time and I was wondering if ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,453
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 03: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, 01: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21