public MacdTrailUi(MacdTrail strategy)
        {
            InitializeComponent();
            _strategy = strategy;

            TextBoxVolumeOne.Text = _strategy.VolumeFix.ToString();

            TextBoxSlipage.Text = _strategy.Slipage.ToString(new CultureInfo("ru-RU"));

            ComboBoxRegime.Items.Add(BotTradeRegime.Off);
            ComboBoxRegime.Items.Add(BotTradeRegime.On);
            ComboBoxRegime.Items.Add(BotTradeRegime.OnlyClosePosition);
            ComboBoxRegime.Items.Add(BotTradeRegime.OnlyLong);
            ComboBoxRegime.Items.Add(BotTradeRegime.OnlyShort);
            ComboBoxRegime.SelectedItem = _strategy.Regime;

            Trail.Text = _strategy.TrailStop.ToString(new CultureInfo("ru-RU"));
            Step.Text  = _strategy.Step.ToString(new CultureInfo("ru-RU"));

            LabelRegime.Content       = OsLocalization.Trader.Label115;
            LabelVolume.Content       = OsLocalization.Trader.Label30;
            LabelSlippage.Content     = OsLocalization.Trader.Label92;
            ButtonAccept.Content      = OsLocalization.Trader.Label132;
            LabelStep.Content         = OsLocalization.Trader.Label136;
            LabelTrailingStop.Content = OsLocalization.Trader.Label137;
        }
Beispiel #2
0
        public MacdTrailUi(MacdTrail strategy)
        {
            InitializeComponent();
            _strategy = strategy;

            TextBoxVolumeOne.Text = _strategy.VolumeFix.ToString();

            TextBoxSlipage.Text = _strategy.Slipage.ToString(new CultureInfo("ru-RU"));


            ComboBoxRegime.Items.Add(BotTradeRegime.Off);
            ComboBoxRegime.Items.Add(BotTradeRegime.On);
            ComboBoxRegime.Items.Add(BotTradeRegime.OnlyClosePosition);
            ComboBoxRegime.Items.Add(BotTradeRegime.OnlyLong);
            ComboBoxRegime.Items.Add(BotTradeRegime.OnlyShort);
            ComboBoxRegime.SelectedItem = _strategy.Regime;

            Trail.Text = _strategy.TrailStop.ToString(new CultureInfo("ru-RU"));
            Step.Text  = _strategy.Step.ToString(new CultureInfo("ru-RU"));
        }
Beispiel #3
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 == "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);
            }


            return(bot);
        }
Beispiel #4
0
        /// <summary>
        /// create robot
        /// создать робота
        /// </summary>
        public static BotPanel GetStrategyForName(string nameClass, string name, StartProgram startProgram, bool isScript)
        {
            BotPanel bot = null;

            // примеры и бесплатные боты
            if (isScript && bot == null)
            {
                bot = CreateScriptStrategyByName(nameClass, name, startProgram);
                return(bot);
            }

            if (nameClass == "Breakdown")
            {
                bot = new Breakdown(name, startProgram);
            }
            if (nameClass == "Hftone")
            {
                bot = new Hftone(name, startProgram);
            }
            if (nameClass == "Frank_2")
            {
                bot = new Frank_2(name, startProgram);
            }
            if (nameClass == "Frankbol_for_bnb")
            {
                bot = new Frankbol_for_bnb(name, startProgram);
            }
            if (nameClass == "Frankbol")
            {
                bot = new Frankbol(name, startProgram);
            }
            if (nameClass == "Frank")
            {
                bot = new Frank(name, startProgram);
            }
            if (nameClass == "Storog")
            {
                bot = new Storog(name, startProgram);
            }
            if (nameClass == "Depozit")
            {
                bot = new Depozit(name, startProgram);
            }
            if (nameClass == "Ver_01")
            {
                bot = new Ver_01(name, startProgram);
            }
            if (nameClass == "NewParabol")
            {
                bot = new NewParabol(name, startProgram);
            }
            if (nameClass == "Start")
            {
                bot = new Start(name, startProgram);
            }
            if (nameClass == "RobotPriceChannel")
            {
                bot = new RobotPriceChannel(name, startProgram);
            }

            if (nameClass == "SmaScreener")
            {
                bot = new SmaScreener(name, startProgram);
            }
            if (nameClass == "ScreenerEngine")
            {
                bot = new ScreenerEngine(name, startProgram);
            }
            if (nameClass == "SmaTrendSample")
            {
                bot = new SmaTrendSample(name, startProgram);
            }
            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 == "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 (BotsWithAttribute.ContainsKey(nameClass))
            {
                Type botType = BotsWithAttribute[nameClass];
                bot = (BotPanel)Activator.CreateInstance(botType, name, startProgram);
            }

            return(bot);
        }