Skip to content

Commit

Permalink
refactor: fit multiple data-source (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
zccz14 authored Feb 18, 2024
1 parent 88fcac9 commit b9ddd3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion @libs/utils/useStopLossOnSingleProduct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ export const useStopLossOnSingleProduct = (
-(drawdown_quota - position.floating_profit),
position.variant,
tar.money.currency,
(product_id) => ex.getQuote(product_id) || { ask: 1, bid: 1 }
(product_id) =>
ex.getQuote(source_account_id, product_id) || { ask: 1, bid: 1 }
);
mapProductIdVariantToClosePrice[
`${position.product_id}${position.variant}`
Expand Down
5 changes: 4 additions & 1 deletion global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ declare const useAccountInfo: (options?: {
/** Use Exchange */
declare const useExchange: () => {
/** Get Quote of Product */
getQuote: (product_id: string) => { ask: number; bid: number };
getQuote: (
datasource_id: string,
product_id: string
) => { ask: number; bid: number };
/** Get Order by Order ID */
getOrderById: (id: string) => IOrder | undefined;
/** List of unfilled orders */
Expand Down

0 comments on commit b9ddd3c

Please sign in to comment.