Ejemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="api">Exchange API</param>
 /// <param name="marketSymbol">The market symbol to trade by default, can be null</param>
 public ExchangeInfo(IExchangeAPI api, string marketSymbol = null)
 {
     API = api;
     //todo:注意下这里要干什么
     //MarketSymbols = api.GetMarketSymbolsAsync().Sync().ToArray();
     TradeInfo = new ExchangeTradeInfo(this, marketSymbol);
 }
Ejemplo n.º 2
0
        protected override void Initialize(ExchangeTradeInfo tradeInfo)
        {
            base.Initialize(tradeInfo);

            SetPlotListCount(1);
            AnchorPrice = TradeInfo.Trade.Price;
            HitValley   = HitPeak = false;
            ProcessTrade();
        }
Ejemplo n.º 3
0
        protected virtual void Initialize(ExchangeTradeInfo info)
        {
            TradeInfo          = info;
            LastTradeTimestamp = info.Trade.Ticks;
            UpdateAmounts();
            StartCashFlow = CashFlow;
            Profit        = (CashFlow - StartCashFlow) + (ItemCount * (decimal)info.Trade.Price);
            ItemCount     = 0.0m;
            Buys          = Sells = 0;
            Spend         = 0.0m;

#if DEBUG
            lastTradeTicks = info.Trade.Ticks;
#endif
        }