예제 #1
0
        private void OnMqlError(MqlErrorException mqlErrorException)
        {
            int         num         = this.AccountNumber();
            string      str         = this.Symbol();
            MetaTrader4 metaTrader4 = MetaTrader4.For(num, str);

            metaTrader4.OnMqlError(mqlErrorException);
        }
예제 #2
0
        protected override int Start()
        {
            int         num         = this.AccountNumber();
            string      str         = this.Symbol();
            MetaTrader4 metaTrader4 = MetaTrader4.For(num, str);

            metaTrader4.OnQuote(this);
            return(1);
        }
예제 #3
0
        public Form1()
        {
            InitializeComponent();

            Bridge.InitializeHosts(true);

            metaTrader4 = Bridge.GetTerminal(2088782777, "EURUSD.arm");
            metaTrader4.QuoteRecieved += metaTrader4_QuoteRecieved;
            metaTrader4.MqlError += metaTrader4_MqlError;
        }
예제 #4
0
 internal static MetaTrader4 For(int accountNumber, string symbol)
 {
   lock (MetaTrader4._listernerLock)
   {
     string local_0 = (string) (object) accountNumber + (object) symbol;
     if (MetaTrader4._listeners.ContainsKey(local_0))
       return MetaTrader4._listeners[local_0];
     MetaTrader4 local_1 = new MetaTrader4(accountNumber, symbol);
     _listeners.Add(local_0, local_1);
     return local_1;
   }
 }
예제 #5
0
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterOpenAuth();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            Bridge.InitializeHosts(true);

            metaTrader4 = Bridge.GetTerminal(121212, "EURUSD");
            metaTrader4.QuoteRecieved += metaTrader4_QuoteRecieved;
            metaTrader4.MqlError += metaTrader4_MqlError;
        }
예제 #6
0
 internal static MetaTrader4 For(int accountNumber, string symbol)
 {
     lock (MetaTrader4._listernerLock)
     {
         string local_0 = (string)(object)accountNumber + (object)symbol;
         if (MetaTrader4._listeners.ContainsKey(local_0))
         {
             return(MetaTrader4._listeners[local_0]);
         }
         MetaTrader4 local_1 = new MetaTrader4(accountNumber, symbol);
         _listeners.Add(local_0, local_1);
         return(local_1);
     }
 }
예제 #7
0
        internal static MetaTrader4 For(int accountNumber, string symbol)
        {
            MetaTrader4 item;

            lock (MetaTrader4._listernerLock)
            {
                string str = string.Concat(accountNumber, symbol);
                if (!MetaTrader4._listeners.ContainsKey(str))
                {
                    MetaTrader4 metaTrader4 = new MetaTrader4(accountNumber, symbol);
                    MetaTrader4._listeners.Add(str, metaTrader4);
                    item = metaTrader4;
                }
                else
                {
                    item = MetaTrader4._listeners[str];
                }
            }
            return(item);
        }
예제 #8
0
 internal static MetaTrader4 For(int accountNumber, string symbol)
 {
     MetaTrader4 item;
     lock (_listernerLock)
     {
         string str = string.Concat(accountNumber, symbol);
         if (!_listeners.ContainsKey(str))
         {
             var metaTrader4 = new MetaTrader4(accountNumber, symbol);
             _listeners.Add(str, metaTrader4);
             item = metaTrader4;
         }
         else
         {
             item = _listeners[str];
         }
     }
     return item;
 }
예제 #9
0
 public static MetaTrader4 GetTerminal(int accountNumber, string symbol)
 {
     return(MetaTrader4.For(accountNumber, symbol));
 }
예제 #10
0
 public static List <MetaTrader4> GetTerminals()
 {
     return(MetaTrader4.All());
 }
예제 #11
0
 protected override int Start()
 {
     MetaTrader4.For(QuoterExtensions.AccountNumber(this), QuoterExtensions.Symbol(this)).OnQuote(this);
     return(1);
 }
예제 #12
0
 private void OnMqlError(MqlErrorException mqlErrorException)
 {
     MetaTrader4.For(QuoterExtensions.AccountNumber(this), QuoterExtensions.Symbol(this)).OnMqlError(mqlErrorException);
 }