Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Trading Bot
- ### Command structure…
- `[Symbol:action(arg,arg);action(arg,arg):signature]`
- * `Symbol` is the symbol that the trade should be made on
- * `action()` are the commands to execute. They are executed in order
- * `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
- You place a command anywhere in your alert message text. For example:
- "Moving average cross - [XBTUSD:OpenLong();StopLoss(250):abcdefg]"
- When this alert is fired, it will open a long (using your default position size)
- using a LimitMarket buy (see below). Once the order is filled, it will place a
- stop loss order 250 dollars below the average entry price.
- ### Actions
- * Limit(qty)
- * Market(qty)
- * MovingLimit(qty) - stays at the top of the order book
- * LimitMarket(qty) - like MovingLimit, only switches to a SteppedMarket if the price moves a certain distance
- * 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)
- * StopLoss(dollarShift) - cancels all existing stop orders for the symbol and creates a new one dollarShift below the entry price
- * TrailingStopLoss(trail) - cancels all existing stop orders and opens a trailing stop loss order
- * Reduce(percentage) - reduces your position by the percentage given
- * Panic() - Cancels all pending orders and closes any open position on the symbol
- * ExitAllCryptoMarkets() - cancels all pending orders on all symbols and closes all open positions in all symbols. Positions are closed with market orders.
- * 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)
- * ExitLong() - closes an open long position, regardless of size, using LimitMarket orders
- * EnterShort(amount) - Same as EnterLong, but for shorts
- * ExitShort() - ditto
- * Margin() - text me my margin position
- * Position() - text me my position size.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement