コード例 #1
0
 public SpotPrice(Func <SpotOrder, bool, List <SpotOrder> > FindPossibleMatch,
                  SpotOrderContainer Container,
                  SpotModel model,
                  Action <SpotOrder, SpotOrder> MakeDeal, Func <SpotOrder, bool> Redo)
     : base(FindPossibleMatch, Container, model, MakeDeal, Redo)
 {
 }
コード例 #2
0
ファイル: SpotService.cs プロジェクト: 810912015/option
        public SpotService(IOptionModel om)
        {
            isStop    = Com.BitsQuan.Miscellaneous.AppSettings.Read <bool>("isDisableBtcTrade", true);
            model     = new SpotModel(om);
            pre       = new SpotPre();
            post      = new SpotPost();
            Market    = new SpotMarket();
            match     = new SpotMatch(model);
            creator   = new SpotOrderCreator(model);
            KlinePool = new KlineDataPool(
                new Func <int, Contract>((i) => {
                return(new Contract {
                    Code = "-2", Name = "BTC"
                });
            }));
            KlineDataPoolInitor.InitSpot(KlinePool);
            ohlcGen = new OhlcGenarator();
            OhlcMaker.OnOhlcMaked += OhlcMaker_OnOhlcMaked;

            match.OnDeal   += match_OnDeal;
            match.OnFinish += match_OnFinish;
            foreach (var v in model.SpotOrders.ToList())
            {
                match.Match(v);
            }
            var qc = om.Coins.Where(a => a.Name.ToLower() == "btc").FirstOrDefault();

            DeepPool = new DeepDataPool3(match.Container.Get(qc));
            SetMaxId();
        }
コード例 #3
0
ファイル: SpotArranger.cs プロジェクト: 810912015/option
 public SpotArranger(Func <SpotOrder, bool, List <SpotOrder> > FindPossibleMatch,
                     SpotOrderContainer Container,
                     SpotModel model,
                     Action <SpotOrder, SpotOrder> MakeDeal, Func <SpotOrder, bool> Redo)
 {
     price     = new SpotPrice(FindPossibleMatch, Container, model, MakeDeal, Redo);
     priceOk   = new SpotPriceFok(FindPossibleMatch, Container, model, MakeDeal, Redo);
     marketFok = new SpotMarketFok(FindPossibleMatch, Container, model, MakeDeal, Redo);
     marketIoc = new SpotMarketIoc(FindPossibleMatch, Container, model, MakeDeal, Redo);
     mtp       = new SpotMIocThenPrice(FindPossibleMatch, Container, model, MakeDeal, Redo);
 }
コード例 #4
0
ファイル: SpotMatch.cs プロジェクト: 810912015/option
        public SpotMatch(SpotModel sm)
        {
            this.model = sm;
            Container  = new SpotOrderContainer((a) => {
                if (this.OnFinish != null)
                {
                    OnFinish(a);
                }
            });

            arranger = new SpotArranger(FindPossibleMatch, Container, model, MakeDeal, Redo);
        }
コード例 #5
0
 public SpotArrange(Func <SpotOrder, bool, List <SpotOrder> > FindPossibleMatch,
                    SpotOrderContainer Container,
                    SpotModel model,
                    Action <SpotOrder, SpotOrder> MakeDeal, Func <SpotOrder, bool> Redo)
 {
     this.matchLock         = new object();
     this.FindPossibleMatch = FindPossibleMatch;
     this.Container         = Container;
     this.model             = model;
     this.MakeDeal          = MakeDeal;
     this.Redo = Redo;
 }
コード例 #6
0
ファイル: SpotOrderCreator.cs プロジェクト: 810912015/option
 public SpotOrderCreator(SpotModel sorder)
 {
     this.sm = sorder;
 }