public CentralPanelScrin1( AccountInfo accountInfo, TradeAccountInfo tradeAccountInfo, CurrentTrades currentTrades, UserStreamData userStreamData, TradeConfigRepository configRepository, Martingale martingale, KeyPanelScrin1 keyPanelScrin1, RightPanelScrin1 rightPanelScrin1) { StartButton = new StartButton(); StopButton = new StopButton(); TradeConfigurationView = new TradeConfigurationView(); this.accountInfo = accountInfo; this.tradeAccountInfo = tradeAccountInfo; this.currentTrades = currentTrades; this.userStreamData = userStreamData; this.configRepository = configRepository; this.martingale = martingale; this.keyPanelScrin1 = keyPanelScrin1; this.rightPanelScrin1 = rightPanelScrin1; SetConfigView(); SetPairs(); // получаем сохраненные конфиги для правых кнопок }
public CentralPanelScrinCalculator(Martingale martingale, CurrentGridStatistics currentGridStatistics, TradeHistoryRepository tradeHistoryRepository) { this.martingale = martingale; this.currentGridStatistics = currentGridStatistics; this.tradeHistoryRepository = tradeHistoryRepository; GeneralSettingsView = new GeneralSettingsView(); BackTestResultView = new BackTestResultView(); }
public Player(Type bettingStrategy, int StartingFunds, int MinimumBetAmount) { this.PrimaryHand = new Hand(); this.SplitHand = new Hand(); this.Statistics = new Stats(); this.Funds = StartingFunds; this.StartingFunds = StartingFunds; if (bettingStrategy == typeof(Manhattan)) { BettingStrategy = new Manhattan(MinimumBetAmount); } else if (bettingStrategy == typeof(Martingale)) { BettingStrategy = new Martingale(MinimumBetAmount); } }
private void button2_Click(object sender, EventArgs e) { StrategyBase strategy = null; var gameParams = new GameParams(); gameParams.Capital = Convert.ToDecimal(textCapital.Text); gameParams.PlayHours = (int)playHours.Value; gameParams.SingleChipValue = Convert.ToInt32(textSingleChipValue.Text); gameParams.SpinsPerHour = Convert.ToInt32(textSpinPerHour.Text); Color color; switch (tabControl1.SelectedIndex) { case 0: strategy = new TheoryOfNine(Game, gameParams); break; case 1: if (radioBlack.Checked) { color = Color.Black; } else { color = Color.Red; } strategy = new OneThreeTwoFour(Game, gameParams, color); break; case 2: strategy = new Martingale(Game, gameParams); break; case 3: if (radioTab4Black.Checked) { color = Color.Black; } else { color = Color.Red; } strategy = new OneThreeTwoFourDozens(Game, gameParams, color); break; case 4: if (radioTab5Black.Checked) { color = Color.Black; } else { color = Color.Red; } strategy = new OneThreeTwoFourDozensChangeColor(Game, gameParams, color); break; case 5: if (radioTab6Black.Checked) { color = Color.Black; } else { color = Color.Red; } strategy = new OneThreeTwoFourDozensMartingale(Game, gameParams, color, Convert.ToInt32(textMartingaleLimit.Text)); break; case 6: strategy = new TheoryOfNineAndOneThreeTwoFour(Game, gameParams); break; case 7: strategy = new KamoteStrategy(Game, gameParams); break; } if (strategy != null) { strategy.Execute(); } NumSpins += gameParams.PlayHours * gameParams.SpinsPerHour; GetStats(); switch (tabControl1.SelectedIndex) { case 0: PlotChart(chartTheory9, strategy.CapitalHistory); textTab1Capital.Text = gameParams.Capital.ToString("#,##0"); textTab1WinCount.Text = strategy.WinCount.ToString(); textTab1LoseCount.Text = strategy.LoseCount.ToString(); break; case 1: textTab2Capital.Text = gameParams.Capital.ToString("#,##0"); PlotChart(chart1324, strategy.CapitalHistory); textTab2Win.Text = strategy.WinCount.ToString(); textTab2Lose.Text = strategy.LoseCount.ToString(); break; case 2: textTab3Capital.Text = gameParams.Capital.ToString("#,##0"); textTab3Win.Text = strategy.WinCount.ToString(); textTab3Lose.Text = strategy.LoseCount.ToString(); PlotChart(chartMartingale, strategy.CapitalHistory); break; case 3: textTab4Capital.Text = gameParams.Capital.ToString("#,##0"); textTab4Win.Text = strategy.WinCount.ToString(); textTab4Lose.Text = strategy.LoseCount.ToString(); PlotChart(chartTab4, strategy.CapitalHistory); break; case 4: textTab5Capital.Text = gameParams.Capital.ToString("#,##0"); textTab5Win.Text = strategy.WinCount.ToString(); textTab5Lose.Text = strategy.LoseCount.ToString(); PlotChart(chartTab5, strategy.CapitalHistory); break; case 5: textTab6Capital.Text = gameParams.Capital.ToString("#,##0"); textTab6Win.Text = strategy.WinCount.ToString(); textTab6Lose.Text = strategy.LoseCount.ToString(); PlotChart(chartTab6, strategy.CapitalHistory); break; case 6: textTab7Capital.Text = gameParams.Capital.ToString("#,##0"); textTab7Win.Text = strategy.WinCount.ToString(); textTab7Lose.Text = strategy.LoseCount.ToString(); PlotChart(chart1, strategy.CapitalHistory); break; case 7: textTab8Capital.Text = gameParams.Capital.ToString("#,##0"); textTab8Win.Text = strategy.WinCount.ToString(); textTab8Lose.Text = strategy.LoseCount.ToString(); PlotChart(chart8, strategy.CapitalHistory); break; } }
public void BotMakeBetTest() { Bot justPlayer = new Bot(1); OneThreeTwoSix testBot = new OneThreeTwoSix(1); Martingale marty = new Martingale(1); Oscar oscar = new Oscar(1); Bot[] botSet = new Bot[] { testBot, marty, oscar }; for (int j = 0; j < 4; j++) { justPlayer.ChangeBank(-justPlayer.GiveResponce()); justPlayer.ChangeBank(10000); justPlayer.MakeBet(j); if (justPlayer.GetBet(j) != 100 || justPlayer.GiveResponce() != 10000 - 100) { Assert.Fail(); } for (int k = 0; k < 5; k++) { marty.ChangeBank(10000); marty.LastBank = marty.GiveResponce() + 1; marty.LoseStreak = k; marty.MakeBet(j); testBot.ChangeBank(10000); testBot.Step = k; testBot.LastBank = 0; testBot.MakeBet(j); oscar.Wins = k; oscar.ChangeBank(10000); oscar.LastBank = 10001; oscar.MakeBet(j); switch (k) { case 0: { if (marty.GiveResponce() != 9800 || marty.GetBet(j) != 200 || testBot.GetBet(j) != 50 || testBot.GiveResponce() != 9950 || oscar.GetBet(j) != 100 || oscar.GiveResponce() != 9900) { Assert.Fail(); } break; } case 1: { if (marty.GiveResponce() != 9600 || marty.GetBet(j) != 400 || testBot.GiveResponce() != 9850 || testBot.GetBet(j) != 150 || oscar.GetBet(j) != 103 || oscar.GiveResponce() != 9897) { Assert.Fail(); } break; } case 2: { if (marty.GiveResponce() != 9200 || marty.GetBet(j) != 800 || testBot.GetBet(j) != 100 || testBot.GiveResponce() != 9900 || oscar.GetBet(j) != 106 || oscar.GiveResponce() != 9894) { Assert.Fail(); } break; } case 3: { if (marty.GiveResponce() != 8400 || marty.GetBet(j) != 1600 || testBot.GiveResponce() != 9700 | testBot.GetBet(j) != 300 || oscar.GetBet(j) != 109 || oscar.GiveResponce() != 9891) { Assert.Fail(); } break; } case 4: { if (marty.GiveResponce() != 6800 || marty.GetBet(j) != 3200 || testBot.Step != 0 || testBot.GetBet(j) != 50 || testBot.GiveResponce() != 9950 || oscar.GetBet(j) != 112 || oscar.GiveResponce() != 9888) { Assert.Fail(); } break; } default: { if (marty.GiveResponce() != 3600 | marty.GetBet(j) != 6400) { Assert.Fail(); } break; } } marty.ChangeBank(-marty.GiveResponce()); testBot.ChangeBank(-testBot.GiveResponce()); oscar.ChangeBank(-oscar.GiveResponce()); } } Assert.Pass(); }