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