This is an old revision of the document!


Long/Short Signal (unified)

### BitMEX Long/Short ###
 
# If necessary uncomment the following line to set exchange & symbol
#exchange=bitmex-testnet symbol=xbtusd
 
# Optionally for multi accounts uncomment the following and fill in your accounts
#parallel=acc1,acc2,acc3
 
# Cancel all orders ..if none found jump ahead to main order
cancel=order ifnone=main
# Close open positions on the opposite side at market
# ..if no matching position is found, skip the delay and jump to main order
close=position side=[!side] type=market ifnone=main
# Give closing order time to execute
delay=5
 
# Place main position order at market
# error abort : Abort/skip rest on error (after retries)
# retries 3   : Give up after 3 retries in case of overload
:main
side=[side] quantity=YOUR_BUY_IN% leverage=YOUR_LEVERAGE type=market error=abort retries=3 #notify=discord:1 
# Give main order time to execute
delay=3
 
# Add market stop loss order
# return 1        : Expect to place an order (needed in case main order takes longer to fill)
# error closeside : If we cannot place SL, cancel orders, close position & abort
close=position side=[side] stoploss=[-]YOUR_STOP_LOSS% type=market return=1 error=closeside retries=10 id=SL #notify=discord:"`SL at   \z` {stoppx}" 
# Add limit take profit order
# (see above for other parameters)
close=position side=[side] takeprofit=0% price=[+]YOUR_TAKE_PROFIT% return=1 error=closeside retries=10 id=TP #notify=discord:"`TP at   \z` {price}" 

Quantity, leverage, stoploss and takeprofit have to be adjusted to your strategy / personal needs!

Attention

Always double check that you are using the right syntax/alert!