|
|
@@ -151,8 +151,14 @@ const calcTotalProfit = async () => {
|
|
|
}
|
|
|
|
|
|
const parseIorKey = (iorKey) => {
|
|
|
- const [, type, accept, side, , ratioString] = iorKey.match(/^ior_(r|ou|m|wm|ot)(a?)(h|c|n)?(_(\d+))?$/);
|
|
|
- const ratio = ratioString ? `${ratioString[0]}.${ratioString.slice(1)}` * (accept ? 1 : -1) : 0;
|
|
|
+ const [, type, accept, side, , ratioString] = iorKey.match(/^ior_(r|ou|m|wm|ot|os)(a?)(h|c|n)?(_([\d-]+))?$/);
|
|
|
+ let ratio = 0;
|
|
|
+ if (ratioString?.includes('-')) {
|
|
|
+ ratio = ratioString;
|
|
|
+ }
|
|
|
+ else if (ratioString) {
|
|
|
+ ratio = `${ratioString[0]}.${ratioString.slice(1)}` * (accept ? 1 : -1);
|
|
|
+ }
|
|
|
return { type, side, ratio };
|
|
|
}
|
|
|
|
|
|
@@ -163,6 +169,7 @@ const PS_IOR_KEYS = [
|
|
|
['-2', 'ior_rh_25', 'ior_wmh_2', 'ior_rac_15'],
|
|
|
['+1', 'ior_rah_05', 'ior_wmc_1', 'ior_rc_15'],
|
|
|
['+2', 'ior_rah_15', 'ior_wmc_2', 'ior_rc_25'],
|
|
|
+ ['0-1', 'ior_ot_0', 'ior_os_0-1', 'ior_ot_1'],
|
|
|
['2-3', 'ior_ot_2', 'ior_os_2-3', 'ior_ot_3'],
|
|
|
];
|
|
|
|
|
|
@@ -245,6 +252,10 @@ const formatEvents = (events, cprKeys) => {
|
|
|
index = 2;
|
|
|
}
|
|
|
}
|
|
|
+ else if (type === 'os') {
|
|
|
+ ratioKey = ratio;
|
|
|
+ index = 1;
|
|
|
+ }
|
|
|
if (typeof (ratioKey) == 'number') {
|
|
|
if (ratioKey > 0) {
|
|
|
ratioKey = `+${ratioKey}`;
|