Skip to content

Commit

Permalink
Fix calculateTradePrice function
Browse files Browse the repository at this point in the history
Updated calculateTradePrice function used in the AdvancedOrderForm to incorporate the specified limit price of a Take Profit Limit or Stop Limit order.
  • Loading branch information
ImpossiblePairs authored Oct 14, 2021
1 parent 3b65fed commit dabc787
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ export function calculateTradePrice(
if (tradeType === 'Market') {
return calculateMarketPrice(orderBook, baseSize, side)
} else if (TRIGGER_ORDER_TYPES.includes(tradeType)) {
return Number(triggerPrice)
if( tradeType === 'Take Profit Limit' || tradeType === 'Stop Limit' ) {
return Number(price)
} else {
return Number(triggerPrice)
}
}
return Number(price)
}
Expand Down

0 comments on commit dabc787

Please sign in to comment.