
In this lesson you will learn about TSLab:
Company overview
7 great features you will love
Other useful features
Big news coming soon
? Please note: The video resolution is 1080p (1920x1080). You can quickly adjust the video quality of the lecture to a higher or lower resolution, depending on your needs. Just click the gear icon in the bottom right corner and select a setting. If you select “auto”, then it will automatically select the resolution based on the internet bandwidth that’s available.
In this lesson you will learn :
Program installation, configuration and main settings
How to organize and customize your workspace
How to manage data providers for different instruments
Historical/offline data. How to get the data in TSLab
Charts. Properties, editor window, main settings
Practical tips
-----------------------------------------------------------------------------------------------------------------------------------------------
Practical TIP!
Issue: after downloading the quotes/ offline data you try to plot a chart and see an empty window. The chart stays empty and shows no data.
Solution: go to Chart Properties (right-click) - find the "Use initial date" field- untick the checkbox.
Open the link in External Resources to see the screenshot
--------------------------------------------------------------------------------------------------------------------------------------------------
Practical task
Install TSLab from https://www.tslab.pro/. Save and customize your configuration.
Download historical futures quotes for SP 500 E Mini/ ES from External Resources (Quotes>CME Futures>Continuous>ES).
Create a futures data provider for CME.
Create a futures chart for ES, set the timeframe to 30 minutes.
Plot the volume and ATR values to separate chart panels. (Hint: search in the toolbar under “Indicators”).
In this lesson you will learn:
Script editor and its properties
Blocks of the visual editor
How to work with the "Script Management" window
Different tabs in TSLab - Historical trades and their parameters, Optimization tab, Profit tab, Logs, Chart
How and why to plot different values on a separate scale
How to create a basic script
You will build your first fully functional simple scripts for two strategies:
Simple Moving Averages crossover
Parabolic SAR strategy
-------------------------------------------------------------------------------------------------------------------------------------------------
Practical TIPS!
You can see a detailed description of any block, its input, output, parameters and a link to an example. Select a block - Properties - Detailed
Issue: Your chart has shrunk in a small band, has been flattened.
Solution: Plot data on different scales or chart panels. All the indicators that relate to the price, such as are the moving averages, various price channels, pivot points should be placed on the same panel with the price of the instrument. Everything that is NOT directly related to the price, for example, volume, ATR, various oscillators, should be placed on a separate scale, and preferably on a separate panel of the chart.
-------------------------------------------------------------------------------------------------------------------------------------------------
Practical task
Create a script using the following algorithm:
Instrument: Futures SP 500 E Mini, ES
Timeframe: 15M
The period from 01.01.2017 to 01.01.2018
Download ES quotes for this script from External Resources. Select ES 20170101_20180101_UTC.txt
Data Provider Settings:
Number of decimals: 2
Price Step: 0.25 point
Lot size:50
Open a long position when the candle closes above the Parabolic SAR indicator (the price crosses the indicator from the bottom up )
Exit the position when the candle closes below the Parabolic SAR indicator
Keep the indicator (Parabolic SAR) parameters values as set by default. The indicator is located in the toolbar in the “indicators” column.
Compare your answer with the Model Answer from External Resources. Please see the instructions below.
Download the file "Lesson_2_Model_Answer.tscript" to you PC without opening it. Then open TSLab and download the file by clicking the "Load from file" button. Open the script.
In this lesson you will learn:
What candles are in terms of an algorithm
How to define different parameters of candles in TSLab - body, range, median price
Numerical and logical formulas with examples
Popular Boolean expression operators
The similarity and difference between numerical and logical formulas
At the end of the lesson, you will build a script with different formulas.
---------------------------------------------------------------------------------------------------------------------------------------------------
Practical TIPS!
When typing a formula in the editor, there are pop-up hints windows with the names of the blocks. If you double-click on these hints, the links to this block appear automatically.
Issue: You may see a lot of messy writing/overlapping text on the chart and blue brackets describing the trades in them. How do you make the chart more visual?
Solution: Disable or enable the display of all elements of the chart. Go to the menu in the upper left corner of the chart, and open the Source list. Disable the position text by selecting the corresponding checkbox.
In blue brackets, TSLab is grouping the trades and their descriptions overlap each other. Go to the “properties” and remove the checkbox to disable the grouping.
---------------------------------------------------------------------------------------------------------------------------------------------------
Practical tasks
Task 1. Describe the following candles in TSLab
Bullish candle without a wick/shadow
Candle without a body
Bearish Candle with a body < 30 % of its range
Bullish Pin bar with a lower wick/shadow > 50% of its range
Bearish Pin bar with an upper wick/shadow > 70% of its range
=====================================================================================
Task 2. Create a script for the following algorithm:
Instrument: Crude Oil Futures: CL
Timeframe: 5M
Period: Use all available historical data
Download CL quotes/historical data for this script from External Resources
Data Provider Settings:
Number of decimals 2
Price step 0.01 $
Lot size 1000
Open a long position after a bullish candle with a bottom wick/shadow more than 50% of its range.
Exit the position either when it hits a stop loss of 0.30 cents or it reaches a take profit equal to three stops.
Additionally, exit the position by a market order when there is a bearish candle with a range exceeding the ATR (20) by four times.
Compare your answers with the Model Answers in External Resources.
For task 2 download the file Lesson_3_Model_Answer_task 2.tscript to you PC without opening it. Then open TSLab and download the file by clicking the "Load from file" button. Open the script.
-----------------------------------------------------------------------------------------------------------------------------------------------
Course update 01.01.2021
We have provided recent historical/ offline data for you to practise. In External Resources you can find Historical Quotes 2019 and 2020. Please bear in mind that this data is for educational purpose only.
In this lesson you will learn:
how to describe a combination of several candles
how we look into the past and refer to the past values of any indicator
the importance of the "begin with" parameter
practical tips to solve common problems
-----------------------------------------------------------------------------------------------------------------------------------
Practical task
Create a script using the following algorithm:
Instrument: Gold Futures GC
Timeframe: 60M
Period: Use all available historical data
Download GC quotes for this script from External Resources
Data Provider Settings:
Number of decimals 1
Price step 0.1 $
Lot size 100
Open a long position after three consecutive bullish candles.
Exit the position in 30 candles or on stop set at the open of the first of the three bullish candles from the combination above.
======================================================================================
Compare your script with the Model Answer script in External Resources
In this lesson you will learn:
three ways to open and close a position
how to use market, limit and stop orders in TSLab in different strategies
how to add conditions to entry/exit the market
practical tips for common issues
-----------------------------------------------------------------------------------------------------------------------------------------------
Practical Tasks
Create scripts using the following algorithms:
Task 1.
Instrument: Bitcoin BTC
Timeframe: 5M
Period: Use all available historical data
Download BTC quotes/historical data from External Resources. Select GDAX.BTC-USD_170701_180701.txt
Data Provider Settings:
Number of decimals 1
Price step 0.01 $
Lot size 1
Open a short position at the breakout of the bottom line of the Bollinger Bands. The period is 20 and a coefficient of deviation of 2 ( enter at the price of the lower line).
Close the position at the price of the channel middle line ( SMA ).
=====================================================================================
Task 2
Instrument: Crude Oil Futures CL
Timeframe: 1M
Period: Use all available historical data
Download CL quotes/historical data for this script here. Select CL 20140101_20160101_UTC.txt
Data Provider Settings:
Number of decimals 2
Price step 0.01 $
Lot size 1000
Open a short position when the price reaches/touches the maximum price for the last 150 candles. The latter is the entry price.
Close the position when the closing price is below the minimum for the last 400 candles.
==================================================================================
Compare your scripts with the Model Answers Scripts in External Resources.
Download two files Lesson_5_Model_Answer_task 1 and task 2.tscript to you PC without opening. Then open TSLab and download them by clicking the "Load from file" button one by one. Open the script.
In this lesson you will learn:
how to get multiple time frames inside one script
how to build indicators based on higher time frames
what compression is all about, how it works
data decompression
how to solve problems with compression and decompression
-----------------------------------------------------------------------------------------
Practical task
Create a script using the following algorithm:
Instrument: Bitcoin BTC
Timeframe: 5M
Period: Use all available historical data
Download BTC quotes/historical data from External Resources. Select GDAX.BTC-USD_170701_180701.txt
Data Provider Settings:
Number of decimals 2
Price step 0.01 $
Lot size 1
Open a long position after a bullish 5M candle with a body of more than $5. The close of this candle must be above yesterday's high. Time starts at 12 am (00:00). At the same time, there should be a rising simple moving average, SMA (period 50), built on the 60-minute timeframe.
Exit the position on stop, set at the minimum price of the last hour.
====================================================================================
Compare your answer with Model Answer.
Model Answer Script
Download the file Lesson_6_7_Model_Answer.tscript to you PC without opening it. Then open TSLab and download the file by clicking the "Load from file" button. Open the script.
In this lesson you will learn:
the differences and similarities between the standard and extended compression
how to build non-standard time frames inside one script
time format in TSLab
the importance of the recalculation interval in algorithmic trading
practical solutions to solve problems when using non-standard time frames in different scenarios
------------------------------------------------------------------------------------------------
Practical task
Create a script using the following algorithm:
Instrument: Bitcoin BTC
Timeframe: 5M
Period: Use all available historical data
Download BTC quotes/historical data from External Resources. Select GDAX.BTC-USD_170701_180701.txt
Data Provider Settings:
Number of decimals 2
Price step 0.01 $
Lot size 1
Use the Compress(Advanced) block for this script
Open a long position after a bullish 5M candle with a body of more than $5. The close of this candle must be above yesterday's high. Time starts at 12 am (00:00). At the same time, there should be a rising simple moving average, SMA (period 50), built on the 60-minute timeframe.
Exit the position on stop, set at the minimum price of the last hour.
====================================================================================
Compare your answer with Model Answer.
Download the file Lesson_6_7_Model_Answer.tscript to you PC without opening it. Then open TSLab and download the file by clicking the "Load from file" button. Open script.
In this lesson you will learn:
the purpose and application of the "Updatable Value" block
how to set the value in the "Initial" parameter
the importance of the parameter "Do not Clear" for calculating stops
how to solve a variety of problems with the "Updatable Value" block in practice
----------------------------------------------------------------------------------------------------------------------------------------------
Practical task
Create a script using the following algorithm:
Instrument: Gold Futures GC
Timeframe: 5M
Period: Use all available historical data
Download GC quotes/historical data from External Resources. Select GC 20121227_20181010_UTC.txt
Data Provider Settings:
Number of decimals 1
Price step 0.1 $
Lot size 100
Conditions for entry:
Wait for a bullish candle with a range of more than $3 on the chart. Store the value of the candle opening and maximum price with the "Updatable value" block.
Enter a short position at the breakout of the opening price of the signal candle above. Set the stop loss at the high of this candle.
Exit the position either on stop or on take profit of $10 each.
===================================================================================
Compare your script with the Model Answer script
Download the file Lesson_8_Model_Answer.tscript to you PC without opening it. Then open TSLab and download the file by clicking the "Load from file" button. Open the script.
In this lesson you will learn:
how to build a script with consecutive signals: impulse, pullback, pin bar
what the flag is
how to reset signals at different conditions
how to count events, candles, signals
-----------------------------------------------------------------------------------------------------------------------------------------------
Practical task
Create a script using the following algorithm:
Instrument: SP 500 E Mini, ES
Timeframe: 5M
Period: Use all available historical data
Download ES quotes/historical data from External Resources. Select ES 20121209_20181010_UTC.txt
Data Provider Settings:
Number of decimals 2
Price step 0.25 point
Lot size 50
Use the "Updatable Value block"
Conditions for entry, consecutive triggers:
Wait for the price increase by 10 points for 10 candles (from Open [-10] to High).
Then for the next 20 candles wait for a pullback to the SMA with a period of 20, built on the candles Low.
When the price touches the SMA
Open a long position (Use the limit order entry).
Exit the position by trailing stop with parameters: Stop loss 15, Trail enable 20, Trail loss 20. (use the "Trail Stop absolute" block)
======================================================================================
Compare your script with the Model Answer script
Download the file Lesson_9_Model_Answer.tscript to you PC without opening it. Then open TSLab and download the file by clicking the "Load from file" button. Open the script.
In this lesson you will learn:
the purpose of optimization
optimized and non-optimized parameters
principles and features of optimization
how to check the odds in your favour by testing the entry and exit points
recommendations for avoiding over-optimization (curve fitting)
In this lesson you will learn:
how to build a full script using the knowledge and technique you gained throughout this course
You will build a strategy that will have most of the key features learned in the previous lessons. It will include compression, references to previous values and, updatable values. The strategy is based on the breakout of the inside bar.
In this lesson you will learn:
how to prepare your script for real-time trading
how to set up a connection to a broker and live market data
issues with past and live data
how to make sure your script works fast
trading settings for correct performance of the script
how to create an Agent and configure its settings
how to deploy your robot
In this lesson you will learn:
how to find an absolute value
how to build a counter without the "Updatable value" block"
how to set a stop-loss at SMA
how to create On-Balance-Volume (OBV) indicator
In this lesson you will learn:
how to use various Math methods in TSLab
how to define round levels and create channels
how to filter a sideways price trend
how to make a parabolic stop-loss or a trailing stop that trails on a parabola
---------------------------------------------------------------------------------------------------------------------------------------------------
Practical Task
Using the Math class method, find the body range of the candle, regardless of its direction (bullish or bearish).
Build the round levels (the multiples of 10) above and below the price for the E Mini SP 500 Futures, ES.
Download ES quotes from External Resources. Select ES 20170101_20180101_UTC.txt
Take a screenshot of your script and send it to your instructor
For task 2 use the following data provider settings if required:
Number of decimals: 2
Price Step: 0.25 point
Lot size: 50
This course is designed for traders interested in automating one’s trading strategies without spending hundreds of hours learning to code. Using a set of smart logical blocks, you can build fully- or partly-automated algorithmic trading strategies. Create, test and deploy your own automated trading strategies using a one-of-a-kind software. After the first two lessons, you will be able to create your first fully functional trading bot. Once you’ve finished this course, you will be able to create trading algos for any instrument and any market supported by your broker.