the Cbots and Custom Indicators vsix Version is too older, some syntaxes canot be compiled .

Created at 04 Mar 2020, 09:10
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!
Bits's avatar

Bits

Joined 14.03.2018

the Cbots and Custom Indicators vsix Version is too older, some syntaxes canot be compiled .
04 Mar 2020, 09:10


the Cbots and Custom Indicators vsix is too older, eg:
1. public static string ListenerListName { get; set; } = "aa";
2. using static FxCore.Common.Setting;
3. fxs.Select((i)=>i.name=="kk"):
so Syntaxes Cannot be compiled successfully!


using cAlgo.API;

using static FxCore.Common.Setting;

namespace FxCore.Common
{
    public static class Setting
    {
        internal static Indicator CurIndicator = null;
        internal static int LongCycle = int.Parse(Properties.Resources.LongCycle);
        internal static int ShortCycle = int.Parse(Properties.Resources.ShortCycle);
        private static string listenerListName = "监控列表";

        public static string MusicPath { get; set; }
        public static string ListenerListName { get => listenerListName; set => listenerListName = value; }
        internal static void BuyListener(TimeFrame timeFrame, Alert alert)
        {
            try
            {
                Watchlist watchlist = CurIndicator.Watchlists.Single((i) => i.Name == ListenerListName);
                var symbols = watchlist?.SymbolNames;
                foreach (var item in symbols)
                {
                    new Alert(CurIndicator, timeFrame);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }
    }
}

 


cTrader Automate
@Bits
Replies

PanagiotisCharalampous
04 Mar 2020, 09:23

Hi yearn2012,

Unfortunately I cannot reproduce your issues since I am missing FxCore.Common.Setting and I do not see anywhere xs.Select((i)=>i.name=="kk"). Can you tell us what errors are you getting?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

Bits
04 Mar 2020, 11:11

RE:

PanagiotisCharalampous said:

Hi yearn2012,

Unfortunately I cannot reproduce your issues since I am missing FxCore.Common.Setting and I do not see anywhere xs.Select((i)=>i.name=="kk"). Can you tell us what errors are you getting?

Best Regards,

Panagiotis 

Join us on Telegram

 

Now I send to you a full simple code:

using cAlgo.API;
using System.Linq;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class kk : Indicator
    {
        private string jia;

        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }
        public string s { get; set; } = "5";
        public string Jia { get => jia; set => jia = value; }

        protected override void Initialize()
        {
            this.Watchlists.Single((i) => i.Name == "list");
        }

        public override void Calculate(int index)
        {
            // Logic code
        }
    }
}

this code complide error!


@Bits

PanagiotisCharalampous
04 Mar 2020, 11:27

RE: RE:

Hi yearn2012,

cBot/Indicator projects are built in .Net Framework 4.0. Auto-property initializers are not supported in C# 4.0 used by .Net Framework 4.0.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous