예제 #1
0
        public static BotPanel CreateScriptStrategyByName(string nameClass, string name, StartProgram startProgram)
        {
            BotPanel bot = null;

            if (bot == null)
            {
                List <string> fullPaths = GetFullNamesFromFolder(@"Custom\Robots");

                string longNameClass  = nameClass + ".txt";
                string longNameClass2 = nameClass + ".cs";

                string myPath = "";

                for (int i = 0; i < fullPaths.Count; i++)
                {
                    string nameInFile =
                        fullPaths[i].Split('\\')[fullPaths[i].Split('\\').Length - 1];

                    if (nameInFile == longNameClass ||
                        nameInFile == longNameClass2)
                    {
                        myPath = fullPaths[i];
                        break;
                    }
                }

                bot = Serialize(myPath, nameClass, name, startProgram);
            }

            bot.IsScript = true;
            bot.FileName = nameClass;

            //++++
            if (nameClass == "PriceLavelBot")
            {
                bot = new PriceLavelBot(name, startProgram);
            }
            if (nameClass == "EnvelopTrendBitmex")
            {
                bot = new EnvelopTrendBitmex(name, startProgram);
            }
            if (nameClass == "EnvelopFlatBitmex")
            {
                bot = new EnvelopFlatBitmex(name, startProgram);
            }
            if (nameClass == "FastDelta")
            {
                bot = new FastDelta(name, startProgram);
            }
            if (nameClass == "GridBot")
            {
                bot = new GridBot(name, startProgram);
            }
            if (nameClass == "FastDelta_2")
            {
                bot = new FastDelta_2(name, startProgram);
            }
            if (nameClass == "MovingChanelFlat")
            {
                bot = new MovingChanelFlat(name, startProgram);
            }
            if (nameClass == "ArbitrageIndex")
            {
                bot = new ArbitrageIndex(name, startProgram);
            }
            if (nameClass == "ArbitrageFutures")
            {
                bot = new ArbitrageFutures(name, startProgram);
            }
            if (nameClass == "PriceChanel_work")
            {
                bot = new PriceChanel_work(name, startProgram);
            }
            return(bot);
        }
예제 #2
0
        /// <summary>
        /// create robot
        /// создать робота
        /// </summary>
        public static BotPanel GetStrategyForName(string nameClass, string name, StartProgram startProgram, bool isScript)
        {
            BotPanel bot = null;

            // примеры и бесплатные боты

            if (isScript)
            {
                bot = CreateScriptStrategyByName(nameClass, name, startProgram);
                return(bot);
            }


            if (nameClass == "TimeOfDayBot")
            {
                bot = new TimeOfDayBot(name, startProgram);
            }
            if (nameClass == "Fisher")
            {
                bot = new Fisher(name, startProgram);
            }
            if (nameClass == "FundBalanceDivergenceBot")
            {
                bot = new FundBalanceDivergenceBot(name, startProgram);
            }
            if (nameClass == "BbPowerTrade")
            {
                bot = new BbPowerTrade(name, startProgram);
            }
            if (nameClass == "BollingerRevers")
            {
                bot = new BollingerRevers(name, startProgram);
            }
            if (nameClass == "BollingerTrailing")
            {
                bot = new BollingerTrailing(name, startProgram);
            }
            if (nameClass == "CciTrade")
            {
                bot = new CciTrade(name, startProgram);
            }
            if (nameClass == "MacdRevers")
            {
                bot = new MacdRevers(name, startProgram);
            }
            if (nameClass == "MacdTrail")
            {
                bot = new MacdTrail(name, startProgram);
            }
            if (nameClass == "OneLegArbitrage")
            {
                bot = new OneLegArbitrage(name, startProgram);
            }
            if (nameClass == "PairRsiTrade")
            {
                bot = new PairRsiTrade(name, startProgram);
            }
            if (nameClass == "PriceChannelBreak")
            {
                bot = new PriceChannelBreak(name, startProgram);
            }
            if (nameClass == "PriceChannelVolatility")
            {
                bot = new PriceChannelVolatility(name, startProgram);
            }
            if (nameClass == "RsiTrade")
            {
                bot = new RsiTrade(name, startProgram);
            }
            if (nameClass == "RviTrade")
            {
                bot = new RviTrade(name, startProgram);
            }

            if (nameClass == "MomentumMACD")
            {
                bot = new MomentumMacd(name, startProgram);
            }

            if (nameClass == "Engine")
            {
                bot = new CandleEngine(name, startProgram);
            }
            if (nameClass == "ClusterEngine")
            {
                bot = new ClusterEngine(name, startProgram);
            }

            if (nameClass == "PairTraderSimple")
            {
                bot = new PairTraderSimple(name, startProgram);
            }
            if (nameClass == "EnvelopTrend")
            {
                bot = new EnvelopTrend(name, startProgram);
            }
            if (nameClass == "ClusterCountertrend")
            {
                bot = new ClusterCountertrend(name, startProgram);
            }
            if (nameClass == "PatternTrader")
            {
                bot = new PatternTrader(name, startProgram);
            }
            if (nameClass == "HighFrequencyTrader")
            {
                bot = new HighFrequencyTrader(name, startProgram);
            }
            if (nameClass == "PivotPointsRobot")
            {
                bot = new PivotPointsRobot(name, startProgram);
            }
            if (nameClass == "Williams Band")
            {
                bot = new StrategyBillWilliams(name, startProgram);
            }
            if (nameClass == "MarketMakerBot")
            {
                bot = new MarketMakerBot(name, startProgram);
            }
            if (nameClass == "Bollinger")
            {
                bot = new StrategyBollinger(name, startProgram);
            }
            if (nameClass == "ParabolicSarTrade")
            {
                bot = new ParabolicSarTrade(name, startProgram);
            }
            if (nameClass == "PriceChannelTrade")
            {
                bot = new PriceChannelTrade(name, startProgram);
            }
            if (nameClass == "WilliamsRangeTrade")
            {
                bot = new WilliamsRangeTrade(name, startProgram);
            }
            if (nameClass == "SmaStochastic")
            {
                bot = new SmaStochastic(name, startProgram);
            }
            if (nameClass == "PinBarTrade")
            {
                bot = new PinBarTrade(name, startProgram);
            }
            if (nameClass == "TwoLegArbitrage")
            {
                bot = new TwoLegArbitrage(name, startProgram);
            }
            if (nameClass == "ThreeSoldier")
            {
                bot = new ThreeSoldier(name, startProgram);
            }
            if (nameClass == "RsiContrtrend")
            {
                bot = new RsiContrtrend(name, startProgram);
            }
            if (nameClass == "PairTraderSpreadSma")
            {
                bot = new PairTraderSpreadSma(name, startProgram);
            }
            //+++
            if (nameClass == "PriceChanel_work")
            {
                bot = new PriceChanel_work(name, startProgram);
            }
            if (nameClass == "PriceLavelBot")
            {
                bot = new PriceLavelBot(name, startProgram);
            }
            if (nameClass == "EnvelopTrendBitmex")
            {
                bot = new EnvelopTrendBitmex(name, startProgram);
            }
            if (nameClass == "EnvelopFlatBitmex")
            {
                bot = new EnvelopFlatBitmex(name, startProgram);
            }
            if (nameClass == "FastDelta")
            {
                bot = new FastDelta(name, startProgram);
            }
            if (nameClass == "FastDelta_2")
            {
                bot = new FastDelta_2(name, startProgram);
            }
            if (nameClass == "MovingChanelFlat")
            {
                bot = new MovingChanelFlat(name, startProgram);
            }
            if (nameClass == "ArbitrageIndex")
            {
                bot = new ArbitrageIndex(name, startProgram);
            }
            if (nameClass == "ArbitrageFutures")
            {
                bot = new ArbitrageFutures(name, startProgram);
            }
            if (nameClass == "TrendLine")
            {
                bot = new TrendLine(name, startProgram);
            }
            if (nameClass == "EnvelopCountertrend")
            {
                bot = new EnvelopCountertrend(name, startProgram);
            }
            //-----
            return(bot);
        }