|
@@ -185,16 +185,16 @@ const calcGoldsWithWinTarget = (data) => {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const jcWin = fixFloat(win_target_2 - GOLD_BASE - goldB2 - goldM2);
|
|
|
|
|
|
|
+ const win_jc = fixFloat(win_target_2 - GOLD_BASE - goldB2 - goldM2);
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
- jcWin,
|
|
|
|
|
goldA1,
|
|
goldA1,
|
|
|
goldB1,
|
|
goldB1,
|
|
|
goldM1,
|
|
goldM1,
|
|
|
goldA2,
|
|
goldA2,
|
|
|
goldB2,
|
|
goldB2,
|
|
|
goldM2,
|
|
goldM2,
|
|
|
|
|
+ win_jc,
|
|
|
jc_index_1,
|
|
jc_index_1,
|
|
|
jc_index_2,
|
|
jc_index_2,
|
|
|
jc_base: GOLD_BASE,
|
|
jc_base: GOLD_BASE,
|
|
@@ -207,18 +207,18 @@ const calcTotalProfit = (sol1, sol2, gold_side_jc) => {
|
|
|
const winTarget2 = sol2.win_average;
|
|
const winTarget2 = sol2.win_average;
|
|
|
const winTarget = fixFloat(Math.min(winTarget1, winTarget2), 2);
|
|
const winTarget = fixFloat(Math.min(winTarget1, winTarget2), 2);
|
|
|
|
|
|
|
|
- const jcWin1 = calcGoldsWithWinTarget({ gold_side_jc, win_target: winTarget1, sol1, sol2 })?.jcWin;
|
|
|
|
|
- const jcWin2 = calcGoldsWithWinTarget({ gold_side_jc, win_target: winTarget2, sol1, sol2 })?.jcWin;
|
|
|
|
|
- const jcWin = fixFloat(Math.max(jcWin1, jcWin2), 2);
|
|
|
|
|
|
|
+ const win1 = calcGoldsWithWinTarget({ gold_side_jc, win_target: winTarget1, sol1, sol2 })?.win_jc;
|
|
|
|
|
+ const win2 = calcGoldsWithWinTarget({ gold_side_jc, win_target: winTarget2, sol1, sol2 })?.win_jc;
|
|
|
|
|
+ const winJc = fixFloat(Math.max(win1, win2), 2);
|
|
|
|
|
|
|
|
- const start = Math.max(winTarget, jcWin);
|
|
|
|
|
- const end = Math.min(winTarget, jcWin);
|
|
|
|
|
|
|
+ const start = Math.max(winTarget, winJc);
|
|
|
|
|
+ const end = Math.min(winTarget, winJc);
|
|
|
const result = [];
|
|
const result = [];
|
|
|
|
|
|
|
|
for (let i = start; i > end; i--) {
|
|
for (let i = start; i > end; i--) {
|
|
|
const win_target = i;
|
|
const win_target = i;
|
|
|
const goldsInfo = calcGoldsWithWinTarget({ gold_side_jc, win_target, sol1, sol2 });
|
|
const goldsInfo = calcGoldsWithWinTarget({ gold_side_jc, win_target, sol1, sol2 });
|
|
|
- const win_diff = Math.abs(fixFloat(win_target - goldsInfo.jcWin));
|
|
|
|
|
|
|
+ const win_diff = Math.abs(fixFloat(win_target - goldsInfo.win_jc));
|
|
|
const lastResult = result.at(-1);
|
|
const lastResult = result.at(-1);
|
|
|
if (!lastResult?.win_diff || win_diff < lastResult.win_diff) {
|
|
if (!lastResult?.win_diff || win_diff < lastResult.win_diff) {
|
|
|
result.push({ win_target: fixFloat(win_target), win_diff, ...goldsInfo });
|
|
result.push({ win_target: fixFloat(win_target), win_diff, ...goldsInfo });
|