Esempio n. 1
0
        /*
         * Uses the technical strategy to predict where the next support/resistance levels will be
         * and primes the bot to make trades when these levels are reached
         */
        public void executeStrategy(ITechnicalTradingStrategy strategy, string marketName)
        {
            decimal?support, resistance;

            strategy.findSupportResistanceLevels(exch, marketName, out support, out resistance);

            Console.WriteLine("For " + marketName);
            Console.WriteLine("Strategy to buy at support level of: " + support);
            Console.WriteLine("Strategy to sell at resistance level of: " + resistance);

            //set the support/resistance levels
            supportLevels[marketName]    = support ?? -1;
            resistanceLevels[marketName] = resistance ?? -1;
        }
Esempio n. 2
0
 public TechnicalTradingBot(Exchange theExch, ITechnicalTradingStrategy theStrategy)
 {
     exch     = theExch;
     strategy = theStrategy;
 }