Skip to content

Commit

Permalink
typo and no hint for tp/sl = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
TranceGeniK committed Nov 30, 2019
1 parent bb815b2 commit c77b6c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
persistent-hint
v-model="trailingStop"
:rules="formValidation.trailingStopRules"
label="Stop Loss"
label="Trailing Stop"
></v-text-field>
<v-layout class="row justify-center align-center"center>
<v-btn
Expand Down
4 changes: 2 additions & 2 deletions src/components/Home/OpenPosition/TradingStops/TradingStops.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export default {
};
},
tpProfit: function() {
if (this.takeProfit && this.$bybitApi.openPosition.size) {
if (this.takeProfit && this.takeProfit != 0 && this.$bybitApi.openPosition.size) {
let profit = Math.abs((1 / this.$bybitApi.openPosition.entry_price) -
(1 / parseFloat(this.takeProfit))) * this.$bybitApi.openPosition.size;
return profit.toFixed(4) + ' ≈ ' +
(profit * this.$bybitApi.openPosition.entry_price).toFixed(2) + 'USD';
}
},
slLoss: function() {
if (this.stopLoss && this.$bybitApi.openPosition.size) {
if (this.stopLoss && this.stopLoss != 0 && this.$bybitApi.openPosition.size) {
let loss = Math.abs((1 / this.$bybitApi.openPosition.entry_price) -
(1 / parseFloat(this.stopLoss))) * this.$bybitApi.openPosition.size +
(((this.$bybitApi.openPosition.size * 0.075) / 100) / this.stopLoss);
Expand Down

0 comments on commit c77b6c1

Please sign in to comment.