File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ let PositionSizeBuilder = ($) => {
6464 }
6565
6666 let calculatePositionSize = ( data ) => {
67- const { risk, entryPrice, stopLoss, leverage} = data ;
67+ const { risk, entryPrice, stopLoss, leverage } = data ;
6868
6969 const priceDifference = ( stopLoss > entryPrice ) ? stopLoss - entryPrice : entryPrice - stopLoss ;
7070
@@ -74,7 +74,7 @@ let PositionSizeBuilder = ($) => {
7474 data . positionSizeUSD = 0 ;
7575
7676 } else {
77- data . positionSizeUnit = Math . round ( risk / Math . abs ( priceDifference ) ) ;
77+ data . positionSizeUnit = risk / Math . abs ( priceDifference ) ;
7878 data . positionSizeUSD = ( data . positionSizeUnit * entryPrice ) . toFixed ( 2 ) ;
7979 }
8080
@@ -86,7 +86,7 @@ let PositionSizeBuilder = ($) => {
8686
8787 let render = ( ) => {
8888 const elementsToUpdate = {
89- positionSizeUnit : data . positionSizeUnit ,
89+ positionSizeUnit : Number ( data . positionSizeUnit ) . toFixed ( 4 ) ,
9090 positionSizeUSD : "$" + data . positionSizeUSD ,
9191 margin : "$" + data . margin
9292 } ;
You can’t perform that action at this time.
0 commit comments