TRADINGVIEW WEBHOOK
Manage your positions and bot from TradingView
Before starting to send signals, ensure you have generated a Mizar API Key. Learn how to do this by reading the instructions here.
Set your TradingView Webhook endpoint to: https://api.mizar.com/api/v1/dca-bots/trading-view/execute-commandâ
Refer to the following tutorial to learn how to configure your TradingView Webhook.
Each DCA bot has its own unique ID. You can find the IDs in your DCA bot management dashboard here.
Open a new position
Simple Open Signal
This command will initiate the opening of a new BTC/USDT position.
Open a new position and override take-profit settings
This command will trigger the opening of a new position where its take-profit deviation is set at +5% compared to the average entry price.
Open a new position and override stop-loss settings
This command will trigger the opening of a new position where its stop-loss deviation is set at +5% compared to the average entry price.
Open a LONG position (for LONG/SHORT bots)
This command will open a LONG position, BTC/USDT.
Open a SHORT position (for LONG/SHORT bots)
This command will open a SHORT position, BTC/USDT.
Open a position with target price
This command will open a BTC/USDT position, with base order price set at $42,000. If the order is not completely filled within the expiration time, it will be canceled. If the expiration time is not set, then the default value of 300 seconds will be used.
Open a position with a reduced size
This command initiates a BTC/USDT position with a base order size that is half of the default size.
position_size
specifies the relative size of the position compared to the default settings. It accepts values ranging from0
to1
, where1
represents 100% of the default size.
Open a position with market at expiration option
This command will open a BTC/USDT position, with base order price set at $42,000. A market order will be executed if the order is not filled within the expiration time.
Open a position with aggressive limit order control
When opening a position, you have the option to fine-tune how your limit entry order is placed within the market spread. This is particularly useful for executing trades with a level of aggressiveness that matches your trading strategy, while also incorporating safeguards against excessive market spread.
Spread Aggressiveness (
spread_aggressiveness
): This setting allows you to define the aggressiveness of your limit order placement within the current market spread. A value of0
aims for the least aggressive placement, targeting the best bid price for buys, which can help in minimizing the cost of entry. A value of1
targets the most aggressive placement, aiming for the best ask price, which can be beneficial in fast-moving markets where getting the position filled is a priority over the entry cost.Maximum Deviation from Best Price (
max_deviation_from_best_price
): To protect against the risk of entering a position at an unfavorable price in markets with a wide spread, this setting limits how far from the best available price your order can be placed. It's defined as a percentage of the best price, ensuring that your order remains within a reasonable range of current market prices.
Close Positions
This commands will allow you to close your DCA bot positions.
Close Position
This commands will close the BTC/USDT position. In this case, it'll execute a sell order.
Close LONG Position (for LONG/SHORT bots)
This commands will close the BTC/USDT LONG position.
Close SHORT Position (for LONG/SHORT bots)
This commands will close the BTC/USDT SHORT position.
Close All Positions
This command will close all the bot open positions.
Stop Bot and Close All Positions
This command will close all the bot open positions and stop the bot.
Add funds
With the add funds function, you can add more orders to your currently open position. The size is a percentage of the base order size and can be larger than 1 (e.g. if size is 1 and the filled base order of the is 0.001 BTC then the add funds will be of 0.001 BTC).
Add funds to a LONG position
If the base order filled amount is 0.001 BTC, this will open an additional order of 0.002 BTC to the current open BTC/USDT position.
Alternatively, in the case of trading with extremely volatile assets or if your position size is variable, you might prefer to use the argument bo_settings_size
that is the relative quote asset value of the BO subscription settings So if the BO size of the subscription is 10 USDT and bo_settings_size
is 2, then the add funds order will be 20 USDT.
Add Funds with limit order
If the base order is set a 0.001 BTC, this will open an additional limit order (at $42,000 price) of 0.002 BTC to the current open BTC/USDT position.
Add Funds with client id
If you want to add an order identifier, you can add client_id
to the request. The client_id
is a string of max length 36 that can be used in case you want to cancel specific add funds orders.
Cancel add funds orders
You can cancel all the open add funds orders associated with an open position.
Cancel add funds orders with client order ids
You can select up to 10 specific add funds orders to cancel with the argument client_ids
Cancel add funds orders with client order ids with failure if any client id is not found
In case you want to raise an error when client_ids
are not found among the add funds orders, then you can set the argument fail_if_ids_not_found
to true.
Remove funds
With the remove funds function, you can remove funds to your currently open position, by partially closing the position. The size can be expressed as a percentage of the base order size, or as a percentage of the total position size.
Remove funds based on base order size
This command will open a sell order of 100% the base order size.
Remove funds based on the position size
This command will open a sell order of 20% of the position size.
Remove funds based on the position size with limit order
This command will open a sell order (at $42,000 price) of 20% of the position size.
Remove Funds with client id
If you want to add an order identifier, you can add client_id
to the request. The client_id
is a string of max length 36 that can be used in case you want to cancel specific add funds orders.
Cancel remove funds orders
You can cancel all the open add funds orders associated with an open position.
Cancel remove funds orders with client order ids
You can select up to 10 specific remove funds orders to cancel with the argument client_ids
Cancel remove funds orders with client order ids with failure if any client id is not found
In case you want to raise an error when client_ids
are not found among the remove funds orders, then you can set the argument fail_if_ids_not_found
to true.
Edit Take Profit
This allows you to edit the take profit settings of open positions.
Override deviation
This command will set the take profit of the BTC/USDT position to 5%.
Override deviation for LONG position (LONG/SHORT bots)
This command will set the take profit of the BTC/USDT LONG position to 5%.
Override deviation for SHORT position (LONG/SHORT bots)
This command will set the take profit of the BTC/USDT SHORT position to 5%.
Edit Take Profit with absolute target price
With this command, you'll set the take profit target price to a defined price ($42,000). If a safety order is hit after the take profit is edited, the take profit will be updated based on the position settings (taking the initial take profit deviation).
Edit Stop Loss
This allows you to edit the stop loss settings of open positions.
Override deviation
This command will set the stop loss of the BTC/USDT position to -5%.
Set stop loss in absolute price
This command will set the stop loss to 42000.
Override deviation for LONG position (LONG/SHORT bots)
This command will set the stop loss of the BTC/USDT LONG position to -5%.
Override deviation for SHORT position (LONG/SHORT bots)
This command will set the stop loss of the BTC/USDT SHORT position to -5%.
Edit Safety Orders
This allows you to edit the safety order settings of open positions.
Shift Safety Order Price
This command will set the next safety order price of the BTC/USDT position to $42,000.
Shift Safety Order Price for LONG Position (LONG/SHORT bot)
This command will set the next safety order price of the BTC/USDT LONG position to $42,000.
Shift Safety Order Price for SHORT Position (LONG/SHORT bot)
This command will set the next safety order price of the BTC/USDT SHORT position to $42,000.
Execute the First Available Safety Order as a Market Order
This command will override the safety order deviation settings and execute the first safety order available as a market order.
Open position or activate safety order
This command will either open a position if a position for that symbol side is not yet active; otherwise will execute the first available safety order at the mark price. All the arguments to open position can be used with this command
Delay
You can add a delay to every command by simply adding the argument delay
. The is is expressed in seconds and the max allowed is 10 sec.
Multiple commands
Our webhook allows you to efficiently execute multiple commands in a single operation. This is particularly useful for scenarios where you need to perform several actions in a sequence without initiating multiple requests.
Endpoint
To utilize this feature, send your requests to the following endpoint:
URL:
https://api.mizar.com/api/v1/dca-bots/trading-view/execute-commands
Features
Batch Operations: Execute up to 10 commands in a single webhook request.
Sequential Execution: Commands are processed in the order they are listed, ensuring a smooth and predictable execution flow.
Break on Failure: If enabled, the execution process will halt upon encountering any failure, preventing subsequent commands from being executed.
Example
Below is an example payload that demonstrates chaining two commands: open-position
and remove-funds
.
Break on failure
If there is any failure in executing
Last updated