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
  • Introduction
  • Strategies
  • The strategy is based on the ADX indicator
  • The strategy is based on the Aroon indicator
  • The strategy is based on the CCI indicator
  • The strategy is based on the CCI indicator
  • CCI Strategy Examples - Comparison
  • Strategy without parameters
  • Strategy based on the RSI indicator
  • Strategy based on the RSI indicator - counter trend
  • Strategy based on the RSI indicator and the "Compress" block
  • The strategy is based on the standard deviation.
  • Trading strategy using the indicators "Maximum for the period" and "Minimum for the period".
  • Position management strategy.

Was this helpful?

Export as PDF
  1. Examples of scripts and indicators

Examples of implementing strategies in TSLab

Introduction

DISCLAIMER

Data, information, and material (“content”) is provided for informational and educational purposes only. This material neither is, nor should be construed as an offer, solicitation, or recommendation to buy or sell any securities. Any investment decisions made by the user through the use of such content is solely based on the users independent analysis taking into consideration your financial circumstances, investment objectives, and risk tolerance. Neither www.tslab.pro nor any of its content providers shall be liable for any errors or for any actions taken in reliance thereon.

This article presents examples of the implementation of algorithms and indicators using the TSLab visual script editor.

In order to run the example, you need:

  1. Download a sample script to your computer.

  2. Launch TSLab program.

  3. Select the menu item Lab - Scripts

  4. In the Scripts window click the Load from file button.

  5. Go to the directory with the downloaded script. Select the required script and click on the Open button.

  6. In the list of available scripts, select the loaded script and double-click on it with the mouse.

Strategies

The examples of trading strategies written in the block programming visual editor.

The strategy is based on the ADX indicator

  • For long positions:

    • Buy if +DI > -DI and ADX rises.

    • Exit position if +DI < -DI or ADX falls.

  • For short positions:

    • To enter a short position if +DI < -DI and ADX rises.

    • To close a short position if +DI > -DI or ADX falls.

Useful links

Download

The strategy is based on the Aroon indicator

If AroonUp is greater than AroonDown - enter the Long position and close the Short position; If AroonUp is lower than AroonDown - enter the Short position and close the Long position; If AroonUp and AroonDown approximately equal - this is a period of consolidation.

The consolidation filter for entering a position is based on the difference between two indicators, the Constant is used as the filter level

Useful links

Download

The strategy is based on the CCI indicator

Buy when CCI rises above 100. Sell when the CCI falls below 100.

Sell (short) when CCI falls below -100. Close a short position when the CCI rises above -100.

Useful links

Download

The strategy is based on the CCI indicator

Buy (open a long position, close a short position) when the Index of the commodity channel rises above zero.

Sell (close a long position, open a short position) when the CCI falls below zero.

Useful links

Download

CCI Strategy Examples - Comparison

The comparison of indicators:

  • CCI built-in the TSLab program

  • CCI indicator from wiki

  • Modified CCI indicator

Useful links

Download

Strategy without parameters

If the price has significantly changed, the market is probably trending. If the bar is large and the price moved up, then buy, if the bar is small, then exit the position.

Correspondingly, use bars with a downward direction to enter a short position.

Useful links

Download

Strategy based on the RSI indicator

The strategy is based on the RSI indicator, if the indicator is high - sell; if the indicator is low - buy.

With a short profit and stop loss, the price of which is calculated by the trail stop in relative values.

Useful links

Download

Strategy based on the RSI indicator - counter trend

Sell and close long if the indicator is high.

Buy and close the short if the indicator is low.

Useful links

Download

Strategy based on the RSI indicator and the "Compress" block

Illustrates the operation of the Compress block and the daily ranges of the indicator.

Useful links

Download

The strategy is based on the standard deviation.

The upper limit of the channel 3*Standard deviations

The lower border of the channel is -3*Standard deviations from SMA

To enter the Short position, a limit order is placed at the level of the upper border of the channel.

Exit the positions with limit orders on the average SMA.

Useful links

Download

Trading strategy using the indicators "Maximum for the period" and "Minimum for the period".

The system is based on the breakdown of the maximum and minimum price levels for the period.

When the current price breaks up the upper line of the channel Maximum For, enter the Long position

When the current price breaks down the lower border of the channel, enter the Short position.

Exit from a position is performed by using the OSMA indicator. The simultaneous existence of opposite positions is prohibited.

Useful links

Download

Position management strategy.

With a limited set of the maximum number of lots.

The example of using formula blocks and the EMA indicator. The example of using the "Change By" blocks.

Download

Last updated 3 years ago

Was this helpful?

The example of a strategy based on the product channel Index
ADX1.tscript
The example of a strategy based on the Aroon indicator
Aroon1.tscript
The examples of CCI-based strategies
CCI_100.tscript
The examples of CCI-based strategies
CCI_Zero.tscript
The examples of CCI-based strategies
CCIwiki_And_CCIcustom_simile.tscript
The example of a strategy without parameters
Strategy without parameters.tscript
The examples of strategies based on the product channel Index
RSI_.tscript
The examples of strategies based on the product channel Index
RSI_counter trend.tscript
The examples of strategies based on the product channel Index
RSIcalc.tscript
The example of a Standard deviation based strategy
StDev_channel_5min_optim.tscript
Donchian_channel_wiki
Donchiano_with_stop.tscript
Ludoman.tscript