コード例 #1
0
        private void setNewBar(GMSDK.Bar gskBar)
        {
            string     symbol        = gskBar.exchange + "." + gskBar.sec_id;
            Instrument curInstrument = InstrumentManager.Instruments[symbol];

            if (curInstrument == null)
            {
                this.EmitError(2, "Symbol " + symbol + " was not found in InstrumentManager.");
                return;
            }
            GMBar gmBar = GSKToGM.ConvertBar(gskBar);

            this.OnNewBar(this, new BarEventArgs(gmBar, curInstrument, this));
        }
コード例 #2
0
        public List <Bar> GetBars(string symbol, int barSize, string beginTimeString, string endTimeString)
        {
            List <GMSDK.Bar> gskBars;

            lock (this._md)
            {
                gskBars = this._md.GetBars(symbol, barSize, beginTimeString, endTimeString);
            }
            List <Bar> bars = new List <Bar>();

            foreach (GMSDK.Bar gskBar in gskBars)
            {
                bars.Add(GSKToGM.ConvertBar(gskBar));
            }
            return(bars);
        }
コード例 #3
0
        public List <Bar> GetLastNBars(string symbol, int barSize, int n, string lastTimeString)
        {
            List <GMSDK.Bar> gskBars;

            lock (this._md)
            {
                gskBars = this._md.GetLastNBars(symbol, barSize, n, lastTimeString);
            }
            gskBars.Reverse();
            List <Bar> bars = new List <Bar>();

            foreach (GMSDK.Bar gskBar in gskBars)
            {
                bars.Add(GSKToGM.ConvertBar(gskBar));
            }
            return(bars);
        }