LabZoneSK / stop-loss-bot

Trading bot to place order when price is bellow target for Kraken exchange.
MIT License
24 stars 6 forks source link

Ability to place stop loss orders on short positions (from margin trading) #11

Open x-ji opened 6 years ago

x-ji commented 6 years ago

Kraken also allows users to margin trade with leverage and hold short positions. In this scenario the stop loss would be for when the price goes above a certain threshold. For example, when somebody shorts BTC at 6400 EUR, he might expect BTC to fall down below 6000 EUR and thus profit from the short. However, he might also place a stop loss order at 6500 EUR in case BTC price further shoots through the roof. An implementation would be to query the total amount of short positions held by the user and then place a leveraged buy order to close all those positions when the price goes above the predefined threshold.

martin-starosta commented 6 years ago

Thank you. I will take a look on this feature.

alishsan commented 6 years ago

A typo in the code: Maybe you could change bellow to below, in stop-loss.js? :) Thanks

martin-starosta commented 6 years ago

Typo has been fixed :-) thank you @alishsan