Sample cBot Reference SMA

Created at 11 Nov 2015, 09:40
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!
IU

iulik2k1

Joined 16.08.2013

Sample cBot Reference SMA
11 Nov 2015, 09:40


hi,

i try to add a simple sma to my bot. so i copy the example in my bot

 

      [Parameter("Source")]
        public DataSeries Source { get; set; }
        [Parameter("SMA Period", DefaultValue = 14)]
        public int SmaPeriod { get; set; }

        private SampleSMA sma;
        protected override void OnStart()
        {
            sma = Indicators.GetIndicator<SampleSMA>(Source, SmaPeriod);
        }

Error CS0246: The type or namespace name 'SampleSMA' could not be found (are you missing a using directive or an assembly reference?)

 

i open a new bot, replace the code with the example i have the same error.

can someone explain why code from example is building and same code in new bot is not compiling?

thank you!

 


@iulik2k1
Replies

mindbreaker
11 Nov 2015, 10:27 ( Updated at: 21 Dec 2023, 09:20 )

RE:

Hi

If You use indicator in cbot need add reference.

Bye


@mindbreaker

iulik2k1
11 Nov 2015, 10:44

RE: RE:

thanks mindbreaker.

so i can create my custom indicator now and add to my robot. i can have a lightest source code now.


@iulik2k1