Skip to content

Commit

Permalink
feat(TradeDialog): add points of far to lost
Browse files Browse the repository at this point in the history
  • Loading branch information
aqzhyi committed Jan 29, 2021
1 parent 78be411 commit 9be527a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/components/ExecutionDialog/ExecutionDialogPrices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ const ExecutionDialogPrices: React.FC = () => {
.minus(openRate)
.abs()

const loseOfSL = big(rate.model?.stopLoss.amount || 0)
.minus(openRate)
.abs()

return (
<span css={rootCSS}>
<span css={bidCSS}>
Expand Down Expand Up @@ -110,6 +114,16 @@ const ExecutionDialogPrices: React.FC = () => {
`}
>
<ChangePoints value={farOfSL.toNumber()} />
<span> far</span>
<span
css={css`
color: #e1191d;
`}
>
{' {to lose '}
<ChangePoints value={loseOfSL.toNumber()} />
{'}'}
</span>
</span>

<span
Expand All @@ -123,12 +137,13 @@ const ExecutionDialogPrices: React.FC = () => {
`}
>
<ChangePoints value={farOfTP.toNumber()} />
<span> far</span>
<span
css={css`
color: #6eaf0f;
`}
>
{' {win '}
{' {to win '}
<ChangePoints value={winOfTP.toNumber()} />
{'}'}
</span>
Expand Down

0 comments on commit 9be527a

Please sign in to comment.