Stop Loss (sl=), Take Profit (tp=) and Trailing Stop(ts=) each work a little differently for each exchange.
Bitmex
With Bitmex, there were lots of variations and options so we chose to give you the ability to decide if you want to base your tp/sl/ts off of the current price, or your positions average. This is decided by whether or not you add c=position to the command.
It is important to note that these stop orders are their own command. If you wanted to open a new order/position, with one of these, it would be 2 commands. (1 for opening the position, another for setting the sl/tp/ts.)
When triggering these orders, you have 2 prices to set. The sl= will set your trigger price and the p= will set where you place the limit order, or t=market if you just want to market out when your trigger price is hit.
Examples:
This would set your trigger 10% below the current price and the limit order upon triggering would be placed 5% below the current price (5% above the trigger).
Stop Loss Limit order based off of the current price.
a=local e=bitmex-testnet s=xbtusd b=long q=100 sl=-10% p=-15%
This would set your trigger 10% below the current price, once triggered it would close at market.
Stop Loss Market order based off of the current price
a=local e=bitmex-testnet s=xbtusd b=long q=100 sl=-10% t=market
This would set your trigger 10% above the current price and the limit order upon triggering would be placed 5% above the current price (5% below the trigger.)
Take Profit Limit order based off of the current price
a=local e=bitmex-testnet s=xbtusd b=long q=100 tp=10% p=15%
This would set your trigger 10% below the current price, once triggered it would close at market.
Take Profit Market order based off of the current price
a=local e=bitmex-testnet s=xbtusd b=long q=100 tp=10% t=market
This would set your trailing trigger 10% below the current price and the limit order would be placed 1% above the order.
Trailing Stop Limit order based off of the current price
a=local e=bitmex-testnet s=xbtusd b=long q=100 ts=10% p=11%
This would set your trailing trigger 10% below the current price, once triggered it would close at market.
Trailing Stop Market order based off of the current price
a=local e=bitmex-testnet s=xbtusd b=long q=100 ts=-10% t=market
All of the above examples are using the current price to place your orders. Simply adding c=position to those commands would tell Autoview to base everything off of your positions average.
Binance
Placing a stop loss or take profit is a command on its own. If you wanted to open a buy for 100 coins and then place your stop loss below, it would be 2 commands.
sl= or tp= sets the trigger price, p= will decide where the limit order goes once triggered.
Note: Binance does not currently support stop-loss or take-profit
This would set your take profit 10% above the current price, once triggered it would place a limit order 5% above the current price (5% below the trigger price).
Take Profit order trigger at 10% and limit order at 5% after triggering
a=local e=binance s=bnbbtc b=buy q=1 tp=10% p=5%
This would set your stop loss 10% below the current price, once triggered it would place a limit order 5% below the current price (5% above the trigger price).
Stop Loss Limit order with a -10% trigger and -5% limit after triggering
a=local e=binance s=bnbbtc b=buy q=1 sl=-10% p=-5%
Comments
0 comments
Article is closed for comments.