//private int mCount = 300;
        //private string mInstrument = "";
        //private string mTimeframe = "";
        //private CandleManagerHistory mHistory = null;

        public CandleManager(ITransport transport, int dayOffset, int weekOffset)
        {
            mTransport                     = transport;
            mTransport.OnTick             += OnTick;
            mTransport.OnRequestCompleted += new EventHandler <RequestCompletedEventArgs>(mTransport_OnRequestCompleted);
            mCalculator                    = new TimeFrameCalculator(dayOffset, weekOffset);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 public CandleHistory(string instrument,
                      Timeframe timeframe, TimeFrameCalculator calculator, int precision)
 {
     mInstrument       = instrument;
     mTimeframe        = timeframe;
     mLastMinute       = new DateTime(0);
     mLastMinuteVolume = 0;
     mCalculator       = calculator;
     mLoaded           = false;
     mID        = (Guid.NewGuid().ToString());
     mPrecision = precision;
 }
Beispiel #3
0
 internal CandleManagerHistory(TransportHistoryRequest request, bool subscribe, TimeFrameCalculator calculator, int precision)
 {
     mPrecision = precision;
     mTimeframe = Timeframe.Parse(request.Timeframe);
     mHistory   = new CandleHistory(request.Instrument, mTimeframe, calculator, mPrecision);
     if (subscribe)
     {
         mTicks = new LinkedList <Tick>();
     }
     mWaitForData = true;
     mSubscribe   = subscribe;
     mFailed      = false;
     mCount       = request.Count;
     mLastMinute  = DateTime.MinValue;
 }