Exemplo n.º 1
0
 public Order(string symbol, int ticket, double lots, EExpertAdvisor ea)
 {
     this.symbol = symbol;
     this.ticket = ticket;
     this.ea     = ea;
     this.lots   = lots;
     NULL_TIME   = CloseTime;
     //this.orderType = orderType;
 }
Exemplo n.º 2
0
 public Order(string symbol, int ticket, double lots, EExpertAdvisor ea)
 {
     this.symbol = symbol;
     this.ticket = ticket;
     this.ea = ea;
     this.lots = lots;
     NULL_TIME = CloseTime;
     //this.orderType = orderType;
 }
Exemplo n.º 3
0
        public static IEnumerable<string> RelatedCurrencyPairsForMinimalSpread(EExpertAdvisor ea, string currency)
        {
            var spreadInfos = new List<SpreadInfo>();

            foreach (var pair in RelatedCurrencyPairs(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
                          //where s.Spread <= 20
                          orderby s.Spread ascending
                          select s.Symbol;

            return results;
        }
Exemplo n.º 4
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.º 5
0
 public SellTrailingMethod(Order order, EExpertAdvisor ea)
 {
     this.order = order;
     this.ea = ea;
 }
Exemplo n.º 6
0
 public Times(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 7
0
 public Highs(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 8
0
 public Opens(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 9
0
 public Opens(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 10
0
 public Lows(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 11
0
 public Closes(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 12
0
 public Times(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 13
0
 public Lows(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
 public IEnumerable<string> GetRelatedCurrencyPairs(EExpertAdvisor ea, string currency)
 {
     return CurrencyPairRegistry.RelatedMajorCurrencyPairsForMinimalSpread(ea, currency).Take(4);
 }
Exemplo n.º 15
0
 public Closes(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 16
0
 public static void FilterCurrencyForMinimalSpread(EExpertAdvisor ea)
 {
     currencyPairs = GetLowSpreadsCurrencies(ea).ToList();
     //currencyPairs.Remove("GBPNZD");
 }
Exemplo n.º 17
0
 public Highs(EExpertAdvisor ea)
 {
     this.ea = ea;
 }
Exemplo n.º 18
0
        public static IEnumerable<string> RelatedMajorCurrencyPairsForMinimalSpread(EExpertAdvisor ea, string currency)
        {
            var spreadInfos = new List<SpreadInfo>();

            foreach (string pair in RelatedMajorCurrencyPairs(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
                                          orderby s.Spread ascending
                                          select s.Symbol;

            return results;
        }