상속: BarFactoryItem
예제 #1
0
        public void Remove(Instrument instrument, BarType barType, long barSize, BarInput barInput = BarInput.Trade,
                           ClockType type = ClockType.Local)
        {
            BarFactoryItem item;

            switch (barType)
            {
            case BarType.Time:
                item = new TimeBarFactoryItem(instrument, barSize, barInput, type, -1);
                break;

            case BarType.Tick:
                item = new TickBarFactoryItem(instrument, barSize, barInput, -1);
                break;

            case BarType.Volume:
                item = new VolumeBarFactoryItem(instrument, barSize, barInput, -1);
                break;

            case BarType.Range:
                item = new RangeBarFactoryItem(instrument, barSize, barInput, -1);
                break;

            case BarType.Session:
                throw new ArgumentException(
                          "BarFactory::Remove Can not create SessionBarFactoryItem without session parameters");

            default:
                throw new ArgumentException($"Unknown bar type - {barType}");
            }
            Remove(item);
        }
예제 #2
0
        public void Add(Instrument instrument, BarType barType, long barSize, BarInput barInput, ClockType type,
                        TimeSpan session1, TimeSpan session2, int providerId = -1)
        {
            BarFactoryItem item;

            switch (barType)
            {
            case BarType.Time:
                item = new TimeBarFactoryItem(instrument, barSize, barInput, type, session1, session2, providerId);
                break;

            case BarType.Tick:
                item = new TickBarFactoryItem(instrument, barSize, barInput, session1, session2, providerId);
                break;

            case BarType.Volume:
                item = new VolumeBarFactoryItem(instrument, barSize, barInput, session1, session2, providerId);
                break;

            case BarType.Range:
                item = new RangeBarFactoryItem(instrument, barSize, barInput, session1, session2, providerId);
                break;

            case BarType.Session:
                item = new SessionBarFactoryItem(instrument, barInput, type, session1, session2, providerId);
                break;

            default:
                throw new ArgumentException($"Unknown bar type - {barType}");
            }
            Add(item);
        }
예제 #3
0
 public void Remove(Instrument instrument, BarType barType, long barSize, BarInput barInput = BarInput.Trade,
     ClockType type = ClockType.Local)
 {
     BarFactoryItem item;
     switch (barType)
     {
         case BarType.Time:
             item = new TimeBarFactoryItem(instrument, barSize, barInput, type, -1);
             break;
         case BarType.Tick:
             item = new TickBarFactoryItem(instrument, barSize, barInput, -1);
             break;
         case BarType.Volume:
             item = new VolumeBarFactoryItem(instrument, barSize, barInput, -1);
             break;
         case BarType.Range:
             item = new RangeBarFactoryItem(instrument, barSize, barInput, -1);
             break;
         case BarType.Session:
             throw new ArgumentException(
                 "BarFactory::Remove Can not create SessionBarFactoryItem without session parameters");
         default:
             throw new ArgumentException($"Unknown bar type - {barType}");
     }
     Remove(item);
 }
예제 #4
0
 public void Add(Instrument instrument, BarType barType, long barSize, BarInput barInput, ClockType type,
     TimeSpan session1, TimeSpan session2, int providerId = -1)
 {
     BarFactoryItem item;
     switch (barType)
     {
         case BarType.Time:
             item = new TimeBarFactoryItem(instrument, barSize, barInput, type, session1, session2, providerId);
             break;
         case BarType.Tick:
             item = new TickBarFactoryItem(instrument, barSize, barInput, session1, session2, providerId);
             break;
         case BarType.Volume:
             item = new VolumeBarFactoryItem(instrument, barSize, barInput, session1, session2, providerId);
             break;
         case BarType.Range:
             item = new RangeBarFactoryItem(instrument, barSize, barInput, session1, session2, providerId);
             break;
         case BarType.Session:
             item = new SessionBarFactoryItem(instrument, barInput, type, session1, session2, providerId);
             break;
         default:
             throw new ArgumentException($"Unknown bar type - {barType}");
     }
     Add(item);
 }