Ejemplo n.º 1
0
        public override bool OnExecution()
        {
            KuCoinConnectorNode connector = this.InParameters["kucoin"].GetValue() as KuCoinConnectorNode;
            var symbol       = this.InParameters["symbol"].GetValue().ToString();
            var tradeAccount = bool.Parse(this.InParameters["tradeAccount"].GetValue().ToString());
            var result       = connector.Client.GetTransferable(symbol, tradeAccount ? Kucoin.Net.Objects.KucoinAccountType.Trade : Kucoin.Net.Objects.KucoinAccountType.Main);

            this.OutParameters["balance"].SetValue(result.Data.Balance);
            return(true);
        }
        public override void SetupEvent()
        {
            KuCoinConnectorNode connector = this.InParameters["kucoin"].GetValue() as KuCoinConnectorNode;

            connector.SocketClient.SubscribeToTickerUpdates(this.InParameters["symbol"].GetValue().ToString(), (data) =>
            {
                var instanciatedParameters = this.InstanciateParametersForCycle();
                instanciatedParameters["bestAskPrice"].SetValue((double)data.BestAsk);
                instanciatedParameters["bestAskQuantity"].SetValue((double)data.BestAskQuantity);
                instanciatedParameters["bestBidPrice"].SetValue((double)data.BestBid);
                instanciatedParameters["bestBidQuantity"].SetValue((double)data.BestBidQuantity);
                this.Graph.AddCycle(this, instanciatedParameters);
            });
        }