Пример #1
0
 public MarketResult(double start_cash, PriceSet price_set, IMarketModelSimulation market, IReadOnlyList <double> cash, IReadOnlyList <double> equity)
 {
     this.StartCash = start_cash;
     this.EndCash   = market.Cash;
     this.PriceSet  = price_set;
     this.Market    = market;
     this.Cash      = cash;
     this.Equity    = equity;
 }
Пример #2
0
        //Primary contructor
        public MarketModelBus(double initial_cash, PriceSet price_set)
        {
            this.Cash   = initial_cash;
            this.Equity = Cash;

            this.Prices   = new HistoryList <Price>(price_set.Prices);
            this.Second1  = new HistoryList <PriceCandle>(price_set.Second1);
            this.Minute1  = new HistoryList <PriceCandle>(price_set.Minute1);
            this.Minute15 = new HistoryList <PriceCandle>(price_set.Minute15);
            this.Minute30 = new HistoryList <PriceCandle>(price_set.Minute30);
            this.Hour1    = new HistoryList <PriceCandle>(price_set.Hour1);
            this.Hour4    = new HistoryList <PriceCandle>(price_set.Hour4);
            this.Day1     = new HistoryList <PriceCandle>(price_set.Day1);
            this.Week1    = new HistoryList <PriceCandle>(price_set.Week1);
            this.Month1   = new HistoryList <PriceCandle>(price_set.Month1);

            this.OpenOrders   = new Dictionary <int, TradingOrder>();
            this.ClosedOrders = new List <TradingOrder>();
            //Make the first price availeble
            Prices.Step();
        }
 public MarketModelSimulation(double initial_cash, PriceSet price_set)
     : this(initial_cash, 0.0, price_set)
 {
 }
        //Primary contructor
        public MarketModelSimulation(double initial_cash, double commission_per_unit, PriceSet price_set)
        {
            this.next_order_ticket = 0; //TODO create and argument for this
            this.Cash              = initial_cash;
            this.Equity            = Cash;
            this.CommissionPerUnit = commission_per_unit;

            this.Prices   = new HistoryListFast <Price>(price_set.Prices);
            this.Second1  = new HistoryListFast <PriceCandle>(price_set.Second1);
            this.Minute1  = new HistoryListFast <PriceCandle>(price_set.Minute1);
            this.Minute15 = new HistoryListFast <PriceCandle>(price_set.Minute15);
            this.Minute30 = new HistoryListFast <PriceCandle>(price_set.Minute30);
            this.Hour1    = new HistoryListFast <PriceCandle>(price_set.Hour1);
            this.Hour4    = new HistoryListFast <PriceCandle>(price_set.Hour4);
            this.Day1     = new HistoryListFast <PriceCandle>(price_set.Day1);
            this.Week1    = new HistoryListFast <PriceCandle>(price_set.Week1);
            this.Month1   = new HistoryListFast <PriceCandle>(price_set.Month1);

            this.OpenOrders   = new Dictionary <int, TradingOrder>();
            this.ClosedOrders = new List <TradingOrder>();
            //Make the first price availeble
            Prices.Step();
        }
Пример #5
0
 public MarketManagerSimulation(double initial_cash, PriceSet price_set)
 {
     this.price_set    = price_set;
     this.initial_cash = initial_cash;
 }