Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="api">Exchange API</param>
 /// <param name="name">Exchange name</param>
 /// <param name="symbol">The symbol to trade by default</param>
 public ExchangeInfo(IExchangeAPI api, string name, string symbol)
 {
     API       = api;
     Name      = name;
     Symbols   = api.GetSymbols();
     TradeInfo = new ExchangeTradeInfo(this, symbol);
 }
        protected override async Task InitializeAsync(ExchangeTradeInfo tradeInfo)
        {
            await base.InitializeAsync(tradeInfo);

            SetPlotListCount(1);
            AnchorPrice = TradeInfo.Trade.Price;
            HitValley   = HitPeak = false;
            await ProcessTradeAsync();
        }
        protected override void Initialize(ExchangeTradeInfo tradeInfo)
        {
            base.Initialize(tradeInfo);

            SetPlotListCount(1);
            AnchorPrice = TradeInfo.Trade.Price;
            HitValley   = HitPeak = false;
            ProcessTrade();
        }
Exemplo n.º 4
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
        }
Exemplo n.º 5
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;
     MarketSymbols = api.GetMarketSymbolsAsync().Sync().ToArray();
     TradeInfo     = new ExchangeTradeInfo(this, marketSymbol);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="api">Exchange API</param>
 /// <param name="symbol">The symbol to trade by default, can be null</param>
 public ExchangeInfo(IExchangeAPI api, string symbol = null)
 {
     API       = api;
     Symbols   = api.GetSymbols().ToArray();
     TradeInfo = new ExchangeTradeInfo(this, symbol);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="api">Exchange API</param>
 /// <param name="marketSymbols">Market symbols</param>
 /// <param name="marketSymbol">The market symbol to trade by default, can be null</param>
 public ExchangeInfo(IExchangeAPI api, IReadOnlyCollection <string> marketSymbols, string marketSymbol = null)
 {
     API           = api;
     MarketSymbols = marketSymbols;
     TradeInfo     = new ExchangeTradeInfo(this, marketSymbol);
 }