public void MoneyManagementTest_Bankroll_Test() { moneyManagement = myMoneyManagement.getMoneyManagementBankroll(true); myMoneyManagement.Bankroll = 50; sessionTotalScore = -45M; nextBet = 5; actualResult = moneyManagement(sessionTotalScore, nextBet); Assert.IsFalse(actualResult); sessionTotalScore = -45M; nextBet = 6; actualResult = moneyManagement(sessionTotalScore, nextBet); Assert.IsTrue(actualResult); myMoneyManagement.BankrollBust = false; // reset sessionTotalScore = 0; nextBet = 50; actualResult = moneyManagement(sessionTotalScore, nextBet); Assert.IsFalse(actualResult); sessionTotalScore = 0; nextBet = 51; actualResult = moneyManagement(sessionTotalScore, nextBet); Assert.IsTrue(actualResult); }
public void MoneyManagementTest_NoBankroll_Test() { moneyManagement = myMoneyManagement.getMoneyManagementBankroll(false); myMoneyManagement.Bankroll = 50; sessionTotalScore = -45M; nextBet = 10; actualResult = moneyManagement(sessionTotalScore, nextBet); Assert.IsFalse(actualResult); }
private void SetupMoneyManagement() { mmShoe = myMoneyManagement.getMoneyManagementShoe(App.GameBaccaratViewModel.IsShoeStopLoss, App.GameBaccaratViewModel.IsShoeTakeProfit); mmBankroll = myMoneyManagement.getMoneyManagementBankroll(App.GameBaccaratViewModel.IsBankroll); myMoneyManagement.ShoeStopLoss = App.GameBaccaratViewModel.ShoeStopLossInt; myMoneyManagement.ShoeTakeProfit = App.GameBaccaratViewModel.ShoeTakeProfitInt; myMoneyManagement.Bankroll = App.GameBaccaratViewModel.BankrollInt; for (int setNumber = 0; setNumber < Constants.StrategizeTotalNumber; setNumber++) { myBetProgression[setNumber].BetBaseUnit = App.GameBaccaratViewModel.BetBaseUnitInt; myBetProgression[setNumber].BetMaxUnit = App.GameBaccaratViewModel.BetMaxUnitInt; } }
public void PrepareGame(bool includeTies = true) { score = new ScoreBaccarat(); shoe = new Shoe(cards); game = new GameBaccarat() { Shoe = shoe }; game.IncludeTies = includeTies; game.Play(); myBetProgression = new BetProgressions[Constants.StrategizeTotalNumber] { new BetProgressions(), new BetProgressions(), new BetProgressions(), new BetProgressions() }; myStrategy = new StrategyBaccarat[Constants.StrategizeTotalNumber] { new StrategyBaccarat(), new StrategyBaccarat(), new StrategyBaccarat(), new StrategyBaccarat() }; for (int setNumber = 0; setNumber < Constants.StrategizeTotalNumber; setNumber++) { myBetProgression[setNumber].BetProgressionType = BetProgressionTypes.FlatBet; myStrategy[setNumber].StrategyBaccaratType = StrategiesBaccaratTypes.None; } strategyMultiWrapper = new StrategyMultiWrapper(); for (int setNumber = 0; setNumber < Constants.StrategizeTotalNumber; setNumber++) { strategyMultiWrapper.MyBetProgression[setNumber] = myBetProgression[setNumber]; strategyMultiWrapper.MyStrategy[setNumber] = myStrategy[setNumber]; } myMoneyManagement = new MoneyManagements(); mmShoe = myMoneyManagement.getMoneyManagementShoe(false, false); mmBankroll = myMoneyManagement.getMoneyManagementBankroll(false); }
/// <summary> /// Money Manager checks if the shoe or session should end based on stop loss, take profit, and bankroll /// Note that NextBet is committed here, because it is needed for the bankroll check. /// The call to betProgression advances the progression, if any. /// </summary> /// <param name="score"></param> /// <param name="betProgression"></param> /// <param name="mmShoe"></param> /// <param name="mmBankroll"></param> /// <returns></returns> private bool MoneyManager(decimal shoeTotalScore, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll) { if (mmShoe(shoeTotalScore)) { return(true); } NextBet = betProgression(LastBetResult); if (mmBankroll(sessionTotalScore, NextBet)) { return(true); } return(false); }
private OutcomesBaccaratCoup StrategyCore_Follow(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll) { if (i < Follow_Length) { Follow_BetPlacement = OutcomesBaccaratCoup.None; return(OutcomesBaccaratCoup.Continue); } int j = 1; OutcomesBaccaratCoup lastOutcome = results[i - j].OutcomeCoup; for (; j < Follow_Length; j++) { if (results[i - j - 1].OutcomeCoup != lastOutcome) { break; } } if (j == Follow_Length) { if (lastOutcome != OutcomesBaccaratCoup.T) { Follow_BetPlacement = lastOutcome; } } if (Follow_BetPlacement != OutcomesBaccaratCoup.None) { if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll)) { return(OutcomesBaccaratCoup.Break); } ResultBaccaratCoup result = results[i]; OutcomesBaccaratCoup betPlacement = Follow_BetPlacement; result.CoupBet.BetPlacement = betPlacement; result.CoupBet.UnitBet = NextBet; OutcomesBaccaratCoup outcome = result.OutcomeCoup; if (outcome == betPlacement) { if (outcome == OutcomesBaccaratCoup.B) { scoreShoe.ScoreBankerWin(NextBet); } else if (outcome == OutcomesBaccaratCoup.P) { scoreShoe.ScorePlayerWin(NextBet); } else if (outcome == OutcomesBaccaratCoup.T) { scoreShoe.ScoreTieWin(NextBet); } result.OutcomeBet = OutcomesLastCoupBet.Win; LastBetResult = result.OutcomeBet; } else { if (outcome == OutcomesBaccaratCoup.T) { if (CustomPattern_BetPlacement != OutcomesBaccaratCoup.T) { result.OutcomeBet = OutcomesLastCoupBet.Push; LastBetResult = result.OutcomeBet; } } else { scoreShoe.ScoreLoss(NextBet, betPlacement); result.OutcomeBet = OutcomesLastCoupBet.Loss; LastBetResult = result.OutcomeBet; } } } return(Follow_BetPlacement); }
private OutcomesBaccaratCoup StrategyCore_OppositeN(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll) { if (i < CustomOpposite_Length) { return(OutcomesBaccaratCoup.Continue); } OutcomesBaccaratCoup outcomeN = results[i - CustomOpposite_Length].OutcomeCoup; if (outcomeN == OutcomesBaccaratCoup.T) { return(OutcomesBaccaratCoup.Continue); } if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll)) { return(OutcomesBaccaratCoup.Break); } ResultBaccaratCoup result = results[i]; OutcomesBaccaratCoup betPlacement; if (outcomeN == OutcomesBaccaratCoup.B) { betPlacement = OutcomesBaccaratCoup.P; } else { betPlacement = OutcomesBaccaratCoup.B; } result.CoupBet.BetPlacement = betPlacement; result.CoupBet.UnitBet = NextBet; OutcomesBaccaratCoup outcome = result.OutcomeCoup; if (betPlacement == outcome) { if (outcome == OutcomesBaccaratCoup.B) { scoreShoe.ScoreBankerWin(NextBet); } else { scoreShoe.ScorePlayerWin(NextBet); } result.OutcomeBet = OutcomesLastCoupBet.Win; LastBetResult = OutcomesLastCoupBet.Win; } else { if (outcome == OutcomesBaccaratCoup.T) { result.OutcomeBet = OutcomesLastCoupBet.Push; LastBetResult = OutcomesLastCoupBet.Push; } else { scoreShoe.ScoreLoss(NextBet, betPlacement); result.OutcomeBet = OutcomesLastCoupBet.Loss; LastBetResult = OutcomesLastCoupBet.Loss; } } return(betPlacement); }
private OutcomesBaccaratCoup StrategyCore_TieAlways(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll) { if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll)) { return(OutcomesBaccaratCoup.Break); } ResultBaccaratCoup result = results[i]; OutcomesBaccaratCoup betPlacement = OutcomesBaccaratCoup.T; result.CoupBet.BetPlacement = betPlacement; result.CoupBet.UnitBet = NextBet; OutcomesBaccaratCoup outcome = result.OutcomeCoup; if (outcome == OutcomesBaccaratCoup.T) { scoreShoe.ScoreTieWin(NextBet); result.OutcomeBet = OutcomesLastCoupBet.Win; LastBetResult = OutcomesLastCoupBet.Win; } else { scoreShoe.ScoreLoss(NextBet, betPlacement); result.OutcomeBet = OutcomesLastCoupBet.Loss; LastBetResult = OutcomesLastCoupBet.Loss; } return(betPlacement); }
private OutcomesBaccaratCoup StrategyCore_None(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll) { if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll)) { return(OutcomesBaccaratCoup.Break); } ResultBaccaratCoup result = results[i]; OutcomesBaccaratCoup betPlacement = OutcomesBaccaratCoup.None; result.CoupBet.BetPlacement = betPlacement; result.CoupBet.UnitBet = NextBet; return(betPlacement); }
private void StrategyWrapper(List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotal, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll) { OutcomesBaccaratCoup outcome = OutcomesBaccaratCoup.None; for (int i = 0; i < results.Count; i++) { outcome = MyStrategy[0].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[0].BetProgressionCore, mmShoe, mmBankroll); if (outcome == OutcomesBaccaratCoup.None || outcome == OutcomesBaccaratCoup.Continue) { outcome = MyStrategy[1].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[1].BetProgressionCore, mmShoe, mmBankroll); if (outcome == OutcomesBaccaratCoup.None || outcome == OutcomesBaccaratCoup.Continue) { outcome = MyStrategy[2].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[2].BetProgressionCore, mmShoe, mmBankroll); if (outcome == OutcomesBaccaratCoup.None || outcome == OutcomesBaccaratCoup.Continue) { outcome = MyStrategy[3].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[3].BetProgressionCore, mmShoe, mmBankroll); } } } if (outcome == OutcomesBaccaratCoup.Break) { break; } results[i].TotalDollarScore = scoreShoe.TotalScore; } }