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
  • Script execution
  • Additional Information

Was this helpful?

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

Agent trading settings - Script execution

Last updated 3 years ago

Was this helpful?

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

Script execution

Settings

Description

Send position entry order immediately

A parameter that determines the ability to automatically enter a position without manual confirmation. The entry command will be executed only if the entry signal was generated on the latest closed bar.

Send position exit order immediately

A parameter that determines the ability to automatically exit a position without manual confirmation. The exit command can be executed in two ways, depending on the Automated closing setting. If the Automated closing parameter is equal to zero, the command will be executed with the formation of a price by the last closed bar, otherwise the command will be executed by the market in accordance with the Automated closing settings.

Automated opening (bars)

The number of bars during which the missed entry will be performed automatically by the market if the "Send position entry order immediately" parameter is enabled. Next, a message will be displayed about the missed entry and the need for manual intervention.

Blocks “By market at fixed price” for auto opening

Blocks the "by market" option with a fixed price for auto opening.

Automated closing (bars)

The number of bars during which the missed exit will be closed automatically by the market if the "Send position exit order immediately" parameter is enabled. Next, if the set number of bars is not enough, a message will be displayed about the missed exit and the need for manual intervention.

Attention! Automated closing applies to every order that makes any position change.

Blocks “By market at fixed price” for auto closing

Blocks the "by market" option with a fixed price for auto closing.

Ignore positions outside history

Ignores (disregards) positions that were closed outside the requested historical data.

Inform about missed entries

Notifies about missed position entries.

Do not entry position if there’s missed exit

Does not open new positions if there is a "position exit missed" error.

Do not notify about recalculation

Does not notify about script recalculation.

Keep virtual position active. Maximum bars

Determines how long to inform about a missed position before it disappears (If set to 0 - an infinite amount of time, any other positive value is equal to the number of bars).

Ignore exit signal not on latest bar

Ignores an exit position signal created by an agent not on the latest (current) bar.

Wait for exit

The number of candles during which the program will wait for the execution of the exit position limit order. Then the application will be canceled. The setting works for an active order (the instrument price touched the order price, but was not executed due to lack of liquidity)

Wait for entry

The number of bars during which the program will wait for the execution of the enter position limit order. Then the application will be canceled. The setting works for an active order (the instrument price touched the order price, but was not executed due to lack of liquidity)

Add order commission

Take into account the commission of orders in the calculation of profit. If the broker sends a commission on transactions, then the commission will be taken into account in the agent's trading results.

Additional Information

Send position entry/exit order immediately - runs auto trading. If the flags are not set, signals will be sent only to the Command Manager for manual execution.

Automated opening/closing - automatic execution by market, if the order was not executed within the specified amount of bars in the "Wait for entry / exit" parameter (activated when the price is touched) or if there was a failure in the Internet connection. Actually, you can set a value greater than 2 or 3, the main thing is that it should not be more than the number of bars loaded into the script. You can view it in the "Log" window of the agent or script. When compiling or recalculating, the number of bars is written.

Blocks “By market at fixed price” for auto opening - blocks the “By market at fixed price” for auto opening flag and applies to the Command Manager.

Blocks “By market at fixed price” for auto closing - blocks the “By market at fixed price” for auto closing flag and applies to the Command Manager.

Ignore positions outside history - When trading in the absence of a loaded history, orders are drawn on the first bar of the agent. The flag prohibits drawing of these trades. Adjust the script properties so that at least the agent sees the last entry and exit of the position. If the agent does not "look through" the history of its trades to place new orders (for example, it does not calculate the average entry price of all trades), then the flag can be set. If you need a history, then it is better to load more of it, while limiting it in the script properties by the Maximum bars parameter.

Inform about missed entries - if the flag is on, then if the signal to enter the position is missed, an alert will be sent in messages or by mail (if the notification manager is configured).

Do not entry position if there’s missed exit - the flag prohibits the opening of new positions if the signal to exit the position was missed.

Do not notify about recalculation - the flag prohibits the output of information to messages and mail when the agent is recalculated. As a rule, it is used for very fast scripts, where the non-execution of orders is due to the liquidity in the market. This is a very important flag for the support team. If you set it, then the agent's recalculations are not written to the log. By setting this flag, you understand that it is pointless to analyze the orders of an agent who puts out hundreds of them a day. It will calculate by itself which of the orders have worked and which have not, and will place the missing. Keep virtual position active. Maximum bars - Adjusts the number of bars during which the last calculated signal in history is valid. For example, if you set 10, and the last signal was 11 bars ago, the signal will disappear from the chart and from the Command Manager (even if the entry is skipped), and the agent will start calculating a new signal.

Ignore exit signal not on latest bar - the flag acts similarly to the "Keep virtual position active. Maximum bars" setting, but only works for exiting a position and only for one bar. That is, by setting this flag, it is expected that the agent will place each order to exit a position by only one bar. On the next bar, if the signal from the script continues, the order will continue to stand. If the price in the order changes, the order will change. But as soon as the signal for placing in the agent disappears, the order will be canceled, even if it was active ("Active" - ​​it means that the market price touched the order, but there was not enough liquidity for execution). As a rule, the flag is used for scripts that expose only take-profits to the exit, but it can also be used for other purposes, the main thing is to understand the mechanism. That is, with this flag, there can be no question of any Automated closing or Wait for entry/exit.

Wait for entry/exit - works only with conditional and limit orders. Turns on if the current price touched the order price, but was not executed. The amount of bars during which the order will continue to stand in the order queue. After the expiration of the amount of bars, the order will be canceled. This parameter must be configured together with the “Automated opening/closing” parameter. If “Automated opening/closing” is greater than “Wait for entry / exit”, then after canceling an unexecuted order, a replacement order will be sent "by market". If "Automated opening/closing" is less than "Wait for entry/exit", then the order will be canceled and the agent will start calculating the next signal. The flag also applies to orders that are subject to the "By market at fixed price" flag.

Add order commission - whether to take into account the commission coming from the broker (not all brokers send commission in transactions). Not all instruments can be recalculated (for example, for the MOEX futures market, the lot size is always 1), so the commission can be greatly overestimated in relation to the income chart. When you see that the commission is too high, do not check the box, this will exclude the commission from the calculation of income. Whether the commission comes from the broker in transactions can be seen in the table "Your transactions".