Advertisement
Guest User

Mex Order Syntax for Heffer's Bot

a guest
Jan 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. # Trading Bot
  2.  
  3. ### Command structure…
  4.  
  5. `[Symbol:action(arg,arg);action(arg,arg):signature]`
  6.  
  7. * `Symbol` is the symbol that the trade should be made on
  8. * `action()` are the commands to execute. They are executed in order
  9. * `signature` is a hash used to sign the command to show it’s not been tampered with and was generated by you. Just makes it a little harder to generate fake commands
  10.  
  11. You place a command anywhere in your alert message text. For example:
  12. "Moving average cross - [XBTUSD:OpenLong();StopLoss(250):abcdefg]"
  13.  
  14. When this alert is fired, it will open a long (using your default position size)
  15. using a LimitMarket buy (see below). Once the order is filled, it will place a
  16. stop loss order 250 dollars below the average entry price.
  17.  
  18. ### Actions
  19.  
  20. * Limit(qty)
  21. * Market(qty)
  22. * MovingLimit(qty) - stays at the top of the order book
  23. * LimitMarket(qty) - like MovingLimit, only switches to a SteppedMarket if the price moves a certain distance
  24. * SteppedMarket(qty) - breaks the order up into N random sized bits and places each bit as a market order, with a random delay between each bit (idea is to prevent excessive slippage, especially for large orders)
  25. * StopLoss(dollarShift) - cancels all existing stop orders for the symbol and creates a new one dollarShift below the entry price
  26. * TrailingStopLoss(trail) - cancels all existing stop orders and opens a trailing stop loss order
  27. * Reduce(percentage) - reduces your position by the percentage given
  28. * Panic() - Cancels all pending orders and closes any open position on the symbol
  29. * ExitAllCryptoMarkets() - cancels all pending orders on all symbols and closes all open positions in all symbols. Positions are closed with market orders.
  30.  
  31. * EnterLong(amount) - Adds to a long position using LimitMarket orders. config determines the size of the entry and max position determines the max exposure (ie, once you are at max exposure, more calls to EnterLong will do nothing)
  32. * ExitLong() - closes an open long position, regardless of size, using LimitMarket orders
  33. * EnterShort(amount) - Same as EnterLong, but for shorts
  34. * ExitShort() - ditto
  35.  
  36. * Margin() - text me my margin position
  37. * Position() - text me my position size.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement