problem with retrieving value from Indicator in cbot

Created at 25 Apr 2021, 13:38
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!
PR

progy85

Joined 07.01.2021 Blocked

problem with retrieving value from Indicator in cbot
25 Apr 2021, 13:38


Hi,

Indicator RSI_xMA_onChart:
        public string buySellValue = "";

            buySellValue = signT;

Now I want to get value from indicator in robot like that: 
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {

        private RSI_xMA_onChart newIndicator;

        protected override void OnStart()
        {
            newIndicator = Indicators.GetIndicator<RSI_xMA_onChart>();


            //   Print(sma.buySellValue);


        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

I got:
New cBot (5), EURUSD, h1 | Crashed in OnStart with ArgumentException: Incorrect parameters count. Parameter name: parameterValues


Replies

PanagiotisCharalampous
26 Apr 2021, 09:11

Hi progy85,

As per the message, the parameters you pass to the indicator are wrong. Check the indicator to find out which parameters need to be passed.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous