Exemplo n.º 1
0
        public static IEnumerable <string> RelatedMajorCurrencyPairsForMinimalSpread(EExpertAdvisor ea, string currency)
        {
            var spreadInfos = new List <SpreadInfo>();

            foreach (var pair in RelatedMajorCurrencyPairs(currency))
            {
                var spread = ea.MarketInfo(pair, TradePlatform.MT4.SDK.API.MARKER_INFO_MODE.MODE_SPREAD);
                spreadInfos.Add(new SpreadInfo {
                    Symbol = pair, Spread = spread
                });
            }

            var results = from s in spreadInfos
                          orderby s.Spread ascending
                          select s.Symbol;

            return(results);
        }
Exemplo n.º 2
0
        private static IEnumerable <string> GetLowSpreadsCurrencies(EExpertAdvisor ea)
        {
            var spreadInfos = new List <SpreadInfo>();

            foreach (var pair in CurrencyPairs)
            {
                var spread = ea.MarketInfo(pair, TradePlatform.MT4.SDK.API.MARKER_INFO_MODE.MODE_SPREAD);
                spreadInfos.Add(new SpreadInfo {
                    Symbol = pair, Spread = spread
                });
            }

            var results = from s in spreadInfos
                          where s.Spread <= 30
                          orderby s.Spread ascending
                          select s.Symbol;

            return(results);
        }
Exemplo n.º 3
0
        public static IEnumerable <string> RelatedCurrencyPairsForMinimalSpread(EExpertAdvisor ea, string currency)
        {
            var spreadInfos = new List <SpreadInfo>();

            foreach (string pair in RelatedCurrencyPairs(currency))
            {
                double spread = ea.MarketInfo(pair, MARKER_INFO_MODE.MODE_SPREAD);
                spreadInfos.Add(new SpreadInfo {
                    Symbol = pair, Spread = spread
                });
            }

            IEnumerable <string> results = from s in spreadInfos
                                           //where s.Spread <= 20
                                           orderby s.Spread ascending
                                           select s.Symbol;

            return(results);
        }