fix default trigger price

This commit is contained in:
saml33 2023-09-07 21:55:56 +10:00
parent 9bf63a9862
commit a9380dfd3b
1 changed files with 2 additions and 4 deletions

View File

@ -96,12 +96,10 @@ const getOrderTypeMultiplier = (
flipPrices: boolean,
reducingShort: boolean,
) => {
// xor of the flip reasons
const shouldFlip = flipPrices !== reducingShort
if (orderType === OrderTypes.STOP_LOSS) {
return shouldFlip ? 1.1 : 0.9
return reducingShort ? (flipPrices ? 0.9 : 1.1) : flipPrices ? 1.1 : 0.9
} else if (orderType === OrderTypes.TAKE_PROFIT) {
return shouldFlip ? 0.9 : 1.1
return reducingShort ? (flipPrices ? 1.1 : 0.9) : flipPrices ? 0.9 : 1.1
} else {
return 1
}