Tradelink Coding Help

Discussion in 'Automated Trading' started by inktomii, Jun 16, 2011.

  1. inktomii



    I would need some help to code a standard deviation of 2 moving averages in Tradelink. Here is what I have for the MA:

    string _asymb = "AAA";
    string _bsymb = "XXX";
    int _barsback = 15;
    public string Asymb { get { return _asymb; } set { _asymb = value; } }
    public string Bsymb { get { return _bsymb; } set { _bsymb = value; } }
    public int BarsBack { get { return _barsback; } set { _barsback = value; } }

    //Moving average calculation with closing price, stock A
    decimal ma_aprice = Calc.Avg(Calc.Closes(blt[_asymb], BarsBack));

    //Moving average calculation with closing price, stock B
    decimal ma_bprice = Calc.Avg(Calc.Closes(blt[_bsymb], BarsBack));

    //some type of calculation with 2 Moving Averages
    decimal ma_twosymb = ma_aprice - ma_bprice;

    decimal std = Calc.StdDev((Calc.Closes(blt[ma_twosymb], BarsBack)));

    When I do the Standard Deviation of ma_twosymb, I get this message:
    Error: The best Overloaded method match for Tradelink.Common.BarListTracker.this[string]' has some invalid arguments.

    I just started coding, if anyone could offer some help.

    Thank you,

  2. if you join the users list somebody will help you with this.

    google tradelink project or