TSLab
TSLab.proSupportTSLab LiveTSVerse
Eng
Eng
  • TSLab trading platform
  • For newbies
    • A beginner's guide
      • Purchasing a license key for a data provider
      • An example of connecting text quotes
      • Example of connecting a data provider to a broker / exchange
      • An example of creating a script in TSLab
      • An example of creating a trading algorithm in TSLab
  • Installing TSLab
    • TSLab Installation Guide
      • System requirements
      • TSLab Installation manual
    • Update TSLab
      • Preparing for update
      • Release build
      • Nightly build
    • Restarting the TSLab program
    • TSLab Changelog
      • TSLab 2.1 Changelog
      • TSLab 2.2 Changelog
        • 2.2.26.0 - 2024/01/31
        • 2.2.25.0 - 2024/01/17
        • 2.2.24.0 - 2024/12/04
        • 2.2.23.0 - 2024/09/19
        • 2.2.22.0 - 2024/08/30
        • 2.2.21.0 - 2024/05/17
        • 2.2.20.0 - 2024/05/15
        • 2.2.19.0 - 2024/02/21
        • 2.2.18.0 - 2024/02/09
        • 2.2.17.0 - 2023/11/16
        • 2.2.16.0 - 2023/10/20
        • 2.2.15.0 - 2023/10/13
        • 2.2.14.0 - 2023/08/11
        • 2.2.13.0 - 2023/05/12
        • 2.2.12.0 - 2023/02/28
        • 2.2.11.0 - 2022/12/15
        • 2.2.10.0 - 2022/10/27
        • 2.2.9.0 - 2022/09/16
        • 2.2.7.0 - 2022/06/23
        • 2.2.5.0 - 2022/04/29
        • 2.2.3.0 - 2022/04/01
        • 2.2.2.0 - 2021/12/29
  • Data providers
    • Cryptocurrency exchanges
      • Binance Cryptocurrency Exchange
        • Registration on Binance
          • Registration on Binance Exchange website
          • Configure Binance Wallet
          • Creating a Binance API Key for TSLab
          • Binance. Transferring USDT from wallet to wallet without commission
        • Registration on TSLab [Binance]
          • Account registration on the TSLab website [Binance]
          • Creating a free Binance Data Provider for TSLab
        • Setting up a Binance Data Provider in TSLab
        • TSLab Binance Edition
          • Starting the program
          • Configuring the Binance Data provider
      • Bitget Cryptocurrency Exchange
        • Registration on the Bitget official website
        • Creating a Free Bitget Data Provider
        • Configuring the Bitget Data Provider in TSLab
      • ByBit Cryptocurrency Exchange
        • Registration on the ByBit website
        • Creating a free ByBit data provider
        • Configuring the ByBit Data Provider in TSLab
      • Deribit Cryptocurrency Exchange
        • Deribit data provider settings
        • Deribit. Frequently asked questions and useful information
        • Deribit. Possible problems and solutions
        • Deribit Margin Requirements Calculation
        • An example of a ready-made script for Deribit
      • Kucoin Cryptocurrency Exchange
        • Registration on the KuCoin official website
        • Creating an API key on the KuCoin website
        • Issuing a free license for KuCoin Data Provider
        • Setting up the KuCoin data provider in TSLab
      • OKX Cryptocurrency Exchange
        • Setting up an OKX account
          • Registration on the OKX website
          • OKX API Key creation
          • Issuing a free license for OKX Data Provider
          • Setting up the OKX data provider in TSLab
          • OKX demo account
        • TSLab OKX Edition
          • First launch of TSLab OKEx Edition
          • Configuring the OKEx data provider
          • Trading in TSLab [OKEx]
          • OKEx Demo
    • Historical Data
      • YahooFinance
      • Offline data provider in CSV format
      • An example of connecting text quotes
      • Text files with historical data
    • Interactive Brokers
      • Getting Started with Interactive Brokers Data Provider
        • Installing and configuring the Trader Workstation (TWS) terminal
        • Installing and configuring the IB Gateway terminal
      • Features of working with Interactive Brokers data provider
      • Known issues for Interactive Brokers Data Provider
      • Loading instruments in a package
  • Working with the program
    • Main menu
      • File
        • Program Settings
      • View
        • Chart
          • Features of working with the Chart in TSLab
          • Chart Controls
        • Depth of Market
        • Quotes
        • All Trades
      • Data
        • Data Providers window
        • Add online data provider
        • Add offline data provider
      • Lab
        • Scripts window
          • Script Container
      • Trading
        • Accounts window
        • Positions window
        • My trades window
        • My orders window
          • Move orders and deals to an agent
        • Autotrading Control Center window
          • Agent window
          • Agent trading settings
            • Event recalculations
            • Slippage
          • "Forget errors" of the agent
        • Orders manager
          • Linking a manually completed order to an agent
        • Agent Control Center window
      • Tools
        • Data backup and recovery
        • Notifications manager
          • Notifications Manager Filters
          • Reference List of Service Message Numbers
          • Example of setting up notifications for Gmail
        • Export to Excel
    • Common interface
      • Status bar
      • Tab
      • Workspace
      • Spreadsheets
    • Visual editor
      • Toolbar
        • Compress and Decompress Blocks
      • List of visual blocks
        • Service Elements
        • Cycles
        • TSChannel
      • The syntax of the Formula, Boolean expression and String expression blocks.
    • Autotrading Control Center
      • Agent trade settings
        • Agent trade settings - Placing orders
        • Agent trading settings - Script execution
        • Agent trading settings - Events
    • TSLab API
      • API Introduction
        • Visual Studio Installation
        • First script (API)
        • First Indicator (API)
        • Script Debugging
        • Logging
      • Writing scripts on the API
        • Trading Instrument Data
        • Working with positions
        • List of deals
        • The order queue
        • Standard Indicators and Handlers
        • Script parameters
        • Caching
        • Local and global cache
        • Multiple Tools
      • Writing indicators on the API
        • Stream indicator
        • Bar indicator
        • Pre-processed indicator
        • Indicator with multiple calculations
      • Additional features
        • The ability to create your own optimizers *
        • C ++ / CLI script
        • API Control Panel
        • Result from script
        • * Оптимизация. Пул массивов.
      • Examples
        • Get script results
        • Get script parameters
        • Get script and agent settings
        • Get position balance (net worth)
        • An example of a strategy Breakout of the Donchian channel
        • Example of a Moving Average Crossover strategy
        • Indicator example
        • How to speed up the processing of a script on the API
        • Links to examples
      • Question - Answer
        • HandlerParameter Attribute
    • Optimization
      • Insufficient load on a multicore processor
  • Examples of scripts and indicators
    • Examples of algorithms and indicators
    • Examples of implementing strategies in TSLab
      • A trading system based on indicator CCI
      • A trading system based on Standard Deviation
      • A trading system based on Aroon
      • A trading system based on ADX and DI technical indicators
      • A trading system based on the RSI indicator
      • Example of a trading strategy without parameters
  • TSLab website
    • TSLab Support Service
      • Memory dump of TSLab application
      • TSLab program log files
Powered by GitBook
LogoLogo

Мы в соцсетях

  • Группа в Telegram
  • Новости TSLab
  • Vkontakte
  • YouTube канал TSLab Live

Наши веб-сайты

  • TSLab
  • Служба поддержки
On this page
  • Agent trade settings
  • Placing orders
  • Additional Information

Was this helpful?

Export as PDF
  1. Working with the program
  2. Autotrading Control Center
  3. Agent trade settings

Agent trade settings - Placing orders

Last updated 3 years ago

Was this helpful?

Agent trade settings

The Agent trade settings, as well as the Common settings, are available when creating a new agent. In addition, the Trade settings window can be opened by clicking on the gear icon in the Agent column.

Placing orders

Settings

Description

Convert by market to limit orders

A market order is created not at the current price, but at the bar opening price (as in calculations) +/- slippage if the "Interval + trade" parameter is selected. If the "Interval" recalculation mode is selected, then the closing price of the last bar is used.

Incorrect stop order is being converted to by market order

Conditional position close orders with a price below the market are placed as market orders. If a message appears:

"A conditional order may not be triggered by the signal '{0}', since the current price in the market is {1} (While the price in the condition is equal to {2})! Thus, the order is placed as a market order, not as a conditional one.

Open by limit orders

To open a position, the program creates limit orders without slippage.

Slippage in price steps

The volume of slippage in steps of the instrument price that will be submitted to the order created by the agent. An order of the "By market" type does not take into account the slippage settings and is executed at the first offered price. Attention! The slippage settings are cumulative.

Slippage in %

The volume of slippage as a percentage that will be submitted to the order created by the agent.

Take-profit without slippage

Take-profit order is created not conditional, but limit (but without slippage).

Order expiration, Days

Allows transferring the expiration time in days to the broker in a conditional order. By default, the program places conditional orders for two days. Recommended for use when working with large timeframes. (Does not apply to cryptocurrency markets)

Additional Information

Slippage - works only for conditional orders. For other order types, slippage is not required. In trade settings, slippage is set for the entire script, both slippages are summed up. If you set slippage both in percentage and in price steps, both slippages are summed up. This slippage has a lower priority than slippage, which is set directly in the block of entry and/or exit from the position (set in absolute values). If 5 points are set in a certain entry block, and 1% is set in the total slippage, then 5 points will be set for orders of this entry block, and 1% will be set for the rest of the script.

Take-profit without slippage - by default, the "Take-profit" block places a conditional order. This flag changes the order type to "Limit". It should be remembered that for those data providers that have "Use related orders" the flag turns them off. And between stop and profit, at each recalculation, the program will select only one order, the price of which is currently closer to the current price.

Open by limit orders - Flag used specifically for "If greater than / if less than" entry blocks. By default, these blocks are used for placing conditional orders. If the flag is on, the order type is changed to "Limit". We advise you to use "Open by limit orders" for real trading.

Convert by market to limit orders - The flag is specially created for the "By market" blocks, it changes the order type from "By market" to "Limit", rather "Conditionally Limit". The order will be placed at the closing price of the previous bar, taking into account slippage. The flag affects all agent signals, including Automated open, Automated close, and signals in the command manager.

Attention. If recalculation is set to "Interval + trade", then the order will be placed at the Open price of the current bar. Do not use “Convert by market to limit orders” with Smartcom Data provider. This provider does not have such an option, orders will be placed at incorrect prices.

Incorrect stop order is being converted to by market order. Works for position close conditional orders. Places market orders instead of limit orders. It also works for "Take-profit without slippage", since first it is checked that the price is bad, only after that the "Take-profit without slippage" flag works.

Explanation on the example of a stop loss order:

Stop loss is a conditional order. When the price touches the price specified in the condition, it is converted into a limit order at the price specified in the condition "+ - slippage". Since the stop loss changes stepwise, with the next recalculation, the price in the condition may turn out to be much lower than the market immediately upon the opening of the bar. This is the “Incorrect stop order”. That is, you have a long position, and now the price is 100, and you submit an order to close if it is less than 120. Or you have a short position, the price is 100, and you want to close the position if the price is more than 80. Such an order will not be executed until the price will not return to the price specified in the condition"+ - slippage". If the option "Incorrect stop order is being converted to by market order" is enabled, then a market order will be placed instead of a limit order. For the stop-loss short position, a buy market order will be placed, and for a stop-loss long position, a sell market order will be placed. Consequently, trades will be executed at the best buy and sell prices that will be in the order queue at the time of recalculation. As a rule, this mechanism works automatically for most brokers, but some brokers (for example, Finam) do not support it, in this case it is recommended to set the flag.