Convert String to Symbol - Error CS0118: 'cAlgo.API.Internals.Algo.Symbol' is a 'property' but is used like a 'type'

Created at 12 Nov 2013, 19:46
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
jhtrader's avatar

jhtrader

Joined 15.10.2013 Blocked

Convert String to Symbol - Error CS0118: 'cAlgo.API.Internals.Algo.Symbol' is a 'property' but is used like a 'type'
12 Nov 2013, 19:46


I am writing the following routine in my robot

       public List<order> getModelOrders(string portfolioName, bool islong)
        {

            var modelPortfolioOptions = new List<Tuple<string, string, TradeType, boolbool>>();
            var modelOrders = new List<order>();
            Symbol pair;
            TradeType trade;
            bool isCarry;


            Tuple<string, string, TradeType, boolbool>[] allPortfolioOptions = 
            {
                Tuple.Create("AUD", "AUDCAD", TradeType.Buy, truefalse)

           }

        pair = MarketData.GetSymbol(option.Item2);

 

Error CS0118: 'cAlgo.API.Internals.Algo.Symbol' is a 'property' but is used like a 'type'

 


Replies

fzlogic
13 Nov 2013, 15:20

It looks like you're putting the code in the wrong place. Can you provide more code?


@fzlogic

jhtrader
13 Nov 2013, 18:09

I figured this one out!!

fzlogic said:

It looks like you're putting the code in the wrong place. Can you provide more code?

The problem was the way I was referencing the class.. I did not declare it as a Robot so it could not use the things like Symbols..

This fixed it..

    [Robot()]
    public class Portfolio : Robot
    {

 

    }