File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -943,7 +943,7 @@ function checkTradingData(signal: Signal, source: SourceType): TradingData {
943943 // Check to satisfy the compiler, if no price it will fail later anyway
944944 if ( signal . price ) {
945945 // Calculate whether this trade will make a profit or loss
946- const percent = PositionType . LONG ? calculatePnL ( tradeOpen . priceBuy ! , signal . price ) : calculatePnL ( signal . price , tradeOpen . priceSell ! )
946+ const percent = signal . positionType == PositionType . LONG ? calculatePnL ( tradeOpen . priceBuy ! , signal . price ) : calculatePnL ( signal . price , tradeOpen . priceSell ! )
947947 logger . debug ( `Closing ${ percent . isLessThan ( 0 ) ? "loss" : "profit" } for ${ getLogName ( tradeOpen ) } trade will be ${ percent . toFixed ( 3 ) } % with fees.` )
948948
949949 // Check if strategy has hit the losing trade limit, and this an automatic trade signal
You can’t perform that action at this time.
0 commit comments