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); }
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); }
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); }
public IEnumerable <string> GetRelatedCurrencyPairs(EExpertAdvisor ea, string currency) { return(CurrencyPairRegistry.RelatedMajorCurrencyPairsForMinimalSpread(ea, currency).Take(4)); }
public BuyTrailingMethod(Order order, EExpertAdvisor ea) { this.order = order; this.ea = ea; }
public static void FilterCurrencyForMinimalSpread(EExpertAdvisor ea) { currencyPairs = GetLowSpreadsCurrencies(ea).ToList(); //currencyPairs.Remove("GBPNZD"); }