Пример #1
0
        //TODO: Fix Managers
        public void Start()
        {
            if (Service == null)
            {
                Service = new ForexService(ref _UserCredentials);
            }
            else
            {
                Service.UserCredentials = _UserCredentials;
            }

            //Archive ARCH = new Archive();
            //var v3= Enums.ToEnum<Archive.TimeFrame, AsmodatForex.com.efxnow.democharting.chartingservice.TimeFrame>(Archive.TimeFrame.FIVE_MINUTE);
            //var v = Enums.ToList<Archive.TimeFrame>();

            Service.Authentication = new ServiceAuthentication(ref Service);// UserCredentials, ref ForexArchive);
            Service.Authentication.Start();
            while (Service.Authentication.Token == null)
            {
                Thread.Sleep(1);
            }

            Service.Configuration = new ServiceConfiguration(ref Service); //ForexAuthentication.ForexConfiguration = ForexConfiguration;
            Service.Charting      = new ServiceCharting(ref Service);
            Service.Rates         = new ServiceRates(ref Service);
            Service.API           = new TreadingAPI(ref Service);
            Service.Trading       = new ServiceTrading(ref Service);
            Service.Analysis      = new Analysis(ref Service);

            UserCreditalsUpdated = false;
        }
Пример #2
0
        public ServiceCharting(ref ForexService ForexService) : base(ref ForexService)
        {
            ThreadsUpdate = new ThreadedMethod(25, System.Threading.ThreadPriority.Lowest, 1);
            ThreadsSave   = new ThreadedMethod(25, System.Threading.ThreadPriority.Lowest, 1);

            Timers.Run(() => this.UpdateTimer(), 1000, null, true, false);
        }
Пример #3
0
 public AbstractServices(ref ForexService ForexService)
 {
     this.ForexService = ForexService;
     Timers            = new ThreadedTimers(100);
     Threads           = new ThreadedMethod(100);
     Locks             = new ThreadedLocker(100);
     Exceptions        = new ThreadedBuffer <Exception>(100);
 }
Пример #4
0
        /// <summary>
        /// This constructor creates instance of managed connection with forex server for specified user defined inside ForexService class
        /// </summary>
        /// <param name="ForexService"></param>
        public ServiceAuthentication(ref ForexService ForexService) : base(ref ForexService)
        {
            this.Disconnections = -1;

            Timers.Run(() => KeepAliveTimer(), 500, null, true, true);
            Timers.Run(() => ReconnectTimer(), 500, null, true, true);
            Timers.Run(() => DataTimer(), 10, null, true, true);
        }
Пример #5
0
        public ServiceTrading(ref ForexService ForexService) : base(ref ForexService)
        {
            DataDeals.IsValid = false;
            Threads.Run(() => this.InitRequestManager(), null, true, true);

            //UpdateProperties();
            Timers.Run(() => this.PeacemakerUpdate(), 100, null, true, true);
            Timers.Run(() => this.PeacemakerRequest(), 1, null, true, true);
            Timers.Run(() => this.PeacemakerAccount(), 1000, null, true, true);
        }
Пример #6
0
 public ServiceRates(ref ForexService ForexService) : base(ref ForexService)
 {
     RateUpdateInterval = 1000;
     Timers.Run(() => UpdateRatesTimer(), RateUpdateInterval, null, true, true);
 }
Пример #7
0
 public TreadingAPI(ref ForexService ForexService)  : base(ref ForexService)
 {
     //CEA_TradingAPI.get
 }
Пример #8
0
 public Analysis(ref ForexService ForexService)
     : base(ref ForexService)
 {
 }
Пример #9
0
 public ServiceConfiguration(ref ForexService ForexService) : base(ref ForexService)
 {
     Timers.Run(() => UpdateProperties(), 1000, null, true, true);
 }