예제 #1
0
파일: Blaster.cs 프로젝트: 810912015/option
        public Blaster(IMatch match, Market m, IOptionModel model)
        {
            this.Market  = m;
            this.matcher = match;
            this.model   = model;
            this.fehc    = new ReorderCollection(this.matcher);

            this.sellor = new BlastSellor(this.positionType, Log, CreateSellOrder, RaiseSell, match);

            this.executor = new BlastExecutor(this.Market, this.CreateRecord,
                                              this.OnBlasting, this.OnBlasted, this.positionType, Log, sellor, CalRatio, fehc, (s) => model.Contracts.Where(a => a.Code == s).FirstOrDefault());
        }
예제 #2
0
 public BlastExecutor(Market Market,
                      Func <Trader, decimal, bool, BlastRecord> CreateRecord,
                      Action <BlastRecord> OnBlasting,
                      Action <BlastRecord> OnBlasted,
                      PositionType positionType,
                      TextLog Log,
                      BlastSellor sellor,
                      Func <Trader, PositionSummary, decimal, decimal> CalRatio, ReorderCollection fehc, Func <string, Contract> getContractByCode)
 {
     this.getContractByCode = getContractByCode;
     this.Market            = Market;
     this.CreateRecord      = CreateRecord;
     this.OnBlasted         = OnBlasted;
     this.OnBlasting        = OnBlasting;
     this.positionType      = positionType;
     this.Log      = Log;
     this.sellor   = sellor;
     this.CalRatio = CalRatio;
     this.fehc     = fehc;
 }