Managed Trading
Introduction
Managed trading in HaasScript means that you outsource the trade amount and ordering handling to the background engine. The big advantage is that it makes scripting a lot easier. The downside is that you can only simply trade with 1 trade amount and you can only occupy 1 position.
Executing Orders
Placing orders
Placing orders can simply be done by any of the following commands: DoBuy
, DoSell
, DoLong
, DoShort
, and DoExitPosition
.
It's a good practice to keep on calling the trade signals.
DoBuy
The DoBuy
sends out a spot trading signal to buy coins in a trading market. It uses the bot its settings of the trading market and trade amount.
DoSell
The DoSell
sends out a spot trading signal to sell coins in a trading market. It uses the bot its settings of the trading market and trade amount.
DoLong
The DoLong
sends out a futures trading signal to get long contracts in a trading market. It uses the bot its settings of the trading market, trade amount, and leverage.
DoShort
The DoShort
sends out a futures trading signal to get short contracts in a trading market. It uses the bot its settings of the trading market, trade amount, and leverage.
DoExitPosition
The DoExitPosition
sends out a futures trading signal to sell all the long and short contracts in a trading market.
Managing Orders
With managed trading, there is no need to manage your orders. It is all handled for you by the background engine. But, if you like to manage it a little bit anyway then you can use the command CancelAllOrders
and IsAnyOrderOpen
.
Order Information
With managed trading, you do not have to care so much about your order data. However, if you still want to then you can use the commands GetAllOpenOrders
and GetAllFilledOrders
Managing Positions
Position information
With managed trading, you do not have to manage your positions. However, if you still want to manage them then you can use the command GetPositionProfit
.
Position prices
You can use one of the following commands to get price information about your positions: LastLongPrice
, LastExitLongPrice
, LastShortPrice
, LastExitShortPrice
, and LastNoPositionPrice
.
Managing Wallet
Wallet commands
You do not have to check your wallet at managed trading, but if you still want to do so then you can use the command WalletAmount
to see what you got in your wallet right now.
Last updated