Complex 5-component oscillator as a tool of technical analysis in algorithmic trading

Development of a new complex oscillator for effective algorithmic trading in the stock market. Technical indicators on which the oscillator is based and the rule base for its construction. Oscillator calculation algorithm using QuantOffice software.

Рубрика Программирование, компьютеры и кибернетика
Вид статья
Язык украинский
Дата добавления 09.08.2022
Размер файла 83,5 K

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

Размещено на http://www.allbest.ru/

COMPLEX 5-COMPONENT OSCILLATOR AS A TOOL OF TECHNICAL ANALYSIS IN ALGORITHMIC TRADING

B.A. Zhalezka

Belorus National Technical University, Minsk, BELARUS

A.O. Stadnik

Godel Technologies Europe Ltd., Minsk, BELARUS

V.A. Siniavskaya

Belorussian State Economic University, Minsk, BELARUS

Abstract

New complex oscillator is suggested for effective algorithmic trading on the stock market. The oscillator is based on the following technical indicators: moving average convergence divergence, parabolic stop and reverse, average directional moving index rating, momentum volume weighted average price. Rule base for the oscillator construction is created. The algorithm of the oscillator caluculation is realised via QuantOffice software. Results of the oscillator backtesting on the historical data are presented.

Introduction

Technical analysis is one of the most popular methods for justifying of the stock exchange decisions in conditions when the price of a security is determined only by demand and supply. For such an analysis, the input is only a time series of the price of the security. Based on it, a price change is predicted in the future and various indicators are calculated that form signals for the trader about the most favorable points for the sale or purchase of securities.

There is a wide variety of technical indicators, described in detail, for example, in books [1 - 3]. When forming a trading strategy, not one, but several indicators are usually used. Their complex is called an oscillator. Taking into account the relationships between them allows trader to make more profitable order on selling or buying the securities than using only one indicator.

The purpose of this article is to form a trading strategy based on a five-component oscillator and verify its efficiency. It is the development of the authors's investigation of computer data analysis and modelling in the sphere of the stock exchange decision making [4].

1. Base technical indicators for the oscillator construction

For construction of the oscillator 5 following indicators were selected [5].

1. Moving Average Convergence Divergence (MACD), which is the difference between exponential moving averages of the short and long trade periods. MACD signals a trend change and indicates the start of a new trend. Price divergence points to the end of the current trend, especially if the MACD is at extreme high or low levels.

2. Volume Weighted Average Price (VWAP), which is a ratio of the volume sold to the total volume sold over a certain period (formula (1)).

, (1)

where Volumei - quantity of the securities selled in i-th time moment; Pricei - security's price in i-th time moment.

VWAP is often used by investors who seek to be as passive as possible in their activity.

3. Parabolic Stop and Reverse (PSAR), which moves at a higher acceleration than a simple moving average, can change its position from the point of view of the price, is designed to determine trend reversal points and exit points. It is calculated according to the following rules (formula (2)).

, (2)

where xp - maximim price value from the moment of the long position opening; af - acceleration factor, its value increments by step value each time the maximum value of xp is exceeded; High - maximum price in i-th time period; Low - minimum price in i-th time period.

4. Average Directional Moving Index Rating (ADXR), which helps to determine an existance of a price trend. It consists of five lines: ADX, ADXR, AD, + DI, -DI [5].

5. Momentum, which measures price acceleration and deceleration (formula (3)). When the market peaks, the Momentum indicator will rise sharply and then fall, deviating from the ongoing price move.

Similarly, at a local low, Momentum prices will plummet and then start to rise significantly ahead of prices. Both of these situations lead to a discrepancy between the indicator and prices.

(3)

3. The algorithm of the oscillator calculation in Quant Office
Complex oscillator, constructed on the base of 5 abovementioned indicators (MACD, VWAP, PSAR, ADXR, Momentum) was authomatized by means of QuantOffice software. A ready-made trading strategy template called EMA Crossover was used. This template is available in the QuantOffice environment as a test variant of the trading strategy, in which orders are executed immediately after they are placed.
The strategy is a .dll file written in C# that is used by QuantOffice. In order to use these strategies as a kind of shell necessary for the operation of the new oscillator, the standard indicators were replaced with the new oscillator.
A database of rules was developed to generate signals for purchase and sale, as well as to exclude false signals [5], for the implementation of which the following program code was written.
if (Macd.Stable && Vwap.Stable && Sar.Stable && Adxr.Stable && Momentum.Stable)
{
if (Macd.Previous.MACD <= MacdDownThreshold && Macd.MACD > MacdDownThreshold)
{
flacMacdDown = true;
flacMacdUp = false;
}
// buy rules: current price is above the VWAP and ADX is above ADXThreshold and the Momentum is above MomentumUpThreshold and the MACD cross up the MacdUpThreshold the price hits the parabolic to the upside
if (close > Vwap.VWAP && Adxr.ADX > AdxThreshold && Momentum.MomentumValue > MomentumUpThreshold
&& Macd.Previous.MACD <= MacdUpThreshold && Macd.MACD > MacdUpThreshold &&
close < Sar.Previous && close >= Sar.SAR && flacMacdDown)
{
flacMacdDown = false;
result = 1D;
return true;
}
if (Macd.Previous.MACD <= MacdUpThreshold && Macd.MACD > MacdUpThreshold)
{
flacMacdUp = true;
flacMacdDown = false;
}
//sell rules: the price hits the parabolic to the downside and the MACD cross down the MacdDownThreshold and ADX is above AdxThreshold and the Momentum is below MomentumDownThreshold and current price is below the VWAP
if (close > Sar.Previous && close <= Sar.SAR && Macd.Previous.MACD >= MacdDownThreshold
&& Macd.MACD < MacdDownThreshold && Adxr.ADX > AdxThreshold
&& Momentum.MomentumValue < MomentumDownThreshold && close < Vwap.VWAP && flacMacdUp)
{
flacMacdUp = false;
result = -1D;
return true;
}
result = 0D;
return true;
}
4. Oscillator backtesting on the historical data
In the table 1 the results of the developed strategy testing on the historical data of Apple inc. securities (AAPL) are represented.
Table 1. Results of the trade testing on the historical data of AAPL (Apple inc. shares)

Quantity of Trades

Net Profit (Loss)

Total Profit

Total Loss

Profitable Trades Ratio

Winning Trades

Losing Trades

Cumulated Profit, %

Sharpe Ratio

Sortino Ratio

45

17239,22

46018,17

-28778,95

60%

27

18

172,39%

1,52

2,93

By means of new 5-component oscillator 45 transactions were generated, of which 27 (or 60%) were profitable and yielded a net profit of 1,7239.22 cash units. The obtained values of the Sharpe ratio (it is equal to 1.52, the value ?1 is considered as positive) and the Sortino ratio (it is equal to 2.93, the value greater than 2 is considered as effective) indicate that this strategy is effective.
Graphical interpretation of the 5-component oscillator work is represented on the figure 1.

Размещено на http://www.allbest.ru/

Fig. 1 - Graph of the 5-component oscillator signals combined with the price, SAR and VWAP
Conclusion
Automation of the technical analysis allows minimizing the risk of order delaying due to subjective factor of trader's doubting in its efficiency. Algorithmic trading on the base of oscillators is a perspective direction in the sphere of the stock exchange decision making under conditions when only supply and demand can influence on the price of the security. oscillator software algorithmic trading
For the construction of the oscillator 5 technical indicators were used: moving average convergence divergence, parabolic stop and reverse, average directional moving index rating, momentum volume weighted average price. The backtesting of the complex 5-component oscillator allowed concluding that the trading algorithm is effective and gives a profit for its user.
The developed oscillator and trade strategy were approved for use in CJSC Orientsoft - Programs and Solutions (Belarusian division of Deltix inc.).
References
1. Elder, A. (2014) Trading for a Living. Psychology. Trading Tactics. Money Management. John Wiley & Sons, New York. - 303 p.
2. Williams, B., Gregory-Williams J. (2008) Trading Chaos. Maximize Profits with Proven Technical Techniques. John Wiley & Sons, New York. - 258 p.
3. Kaufman, P. (2019) Trading Systems and Methods. John Wiley & Sons, New York. - 1168 с.
4. Siniavskaya, O.A., Zhelezko, B.A. (2007) Fuzzy Evaluation of the Risk of Investment in Securities in the Portfolio Optimization Problem. In: Computer Data Analysis and Modeling: Complex Stochastic Data and Systems: Proc. of the Eighth Intern. Conf., Minsk, Sept. 11-15, 2007. In 2 vol. Vol. 2. Minsk, Publ. center BSU, pp. 91 - 94.
5. Zhalezka, B.A., Stadnik A.O., and Siniauskaya V.A. (2022) Technical analysis and indicators application in algorithmic marketing. Economic Science Today. Vol. 15, pp. 119 - 130. (in Russian).
Размещено на Allbest.ru
...

Подобные документы

  • Basic assumptions and some facts. Algorithm for automatic recognition of verbal and nominal word groups. Lists of markers used by Algorithm No 1. Text sample processed by the algorithm. Examples of hand checking of the performance of the algorithm.

    курсовая работа [22,8 K], добавлен 13.01.2010

  • Строение класса complex. Примеры использования класса complex. Результат выполнения программы. Цикл возведения первого числа во второе. Операции с комплексными числами. Конструкторы и операции присваивания для типа complex. Неявные преобразования типов.

    курсовая работа [1,5 M], добавлен 18.05.2011

  • Overview history of company and structure of organization. Characterization of complex tasks and necessity of automation. Database specifications and system security. The calculation of economic efficiency of the project. Safety measures during work.

    дипломная работа [1009,6 K], добавлен 09.03.2015

  • Lists used by Algorithm No 2. Some examples of the performance of Algorithm No 2. Invention of the program of reading, development of efficient algorithm of the program. Application of the programs to any English texts. The actual users of the algorithm.

    курсовая работа [19,3 K], добавлен 13.01.2010

  • Technical methods of supporting. Analysis of airplane accidents. Growth in air traffic. Drop in aircraft accident rates. Causes of accidents. Dispatcher action scripts for emergency situations. Practical implementation of the interface training program.

    курсовая работа [334,7 K], добавлен 19.04.2016

  • Lines of communication and the properties of the fiber optic link. Selection of the type of optical cable. The choice of construction method, the route for laying fiber-optic. Calculation of the required number of channels. Digital transmission systems.

    дипломная работа [1,8 M], добавлен 09.08.2016

  • Technical and economic characteristics of medical institutions. Development of an automation project. Justification of the methods of calculating cost-effectiveness. General information about health and organization safety. Providing electrical safety.

    дипломная работа [3,7 M], добавлен 14.05.2014

  • Модули, входящие в пакет программного обеспечения. Project Menagement, Methodology Management, Portfolio Analysis, Timesheets, myPrimavera, Software Development Kit, ProjectLink. Иерархическая структура Primavera и ее взаимосвязь с программой MS Project.

    контрольная работа [9,5 K], добавлен 18.11.2009

  • Review of development of cloud computing. Service models of cloud computing. Deployment models of cloud computing. Technology of virtualization. Algorithm of "Cloudy". Safety and labor protection. Justification of the cost-effectiveness of the project.

    дипломная работа [2,3 M], добавлен 13.05.2015

  • Микропроцессоры с архитектурой Complex Instruction Set Computers. Развитие архитектуры IA-32 в семействе Pentium. Параллельные конвейеры обработки. Усовершенствованный блок вычисления с плавающей точкой. Технология динамического предсказания ветвлений.

    презентация [220,4 K], добавлен 11.12.2013

  • Изучение методов и этапов создания класса Complex, позволяющего работать с комплексными числами и производить с ними следующие операции: сложение, вычитание, умножение, деление двух комплексных чисел. Написание кода для ввода и вывода исходных данных.

    курсовая работа [628,4 K], добавлен 11.09.2010

  • Анализ аналогов информационно-справочной системы Laboratory of complex and atypical prosthetics. Требования к составу и содержанию работ по подготовке объекта автоматизации к вводу системы в действие. Автоматическое обновление каталогов продукции.

    курсовая работа [4,0 M], добавлен 09.07.2023

  • Description of a program for building routes through sidewalks in Moscow taking into account quality of the road surface. Guidelines of working with maps. Technical requirements for the program, user interface of master. Dispay rated pedestrian areas.

    реферат [3,5 M], добавлен 22.01.2016

  • Сущность понятия "комплексное число". Умножение, деление и сложение. Класс Number и два последующих Rational Number Operation и Complex Number. Схема наследования классов исключений. Тестирование программы. Схема работы приложения. Интерфейс программы.

    курсовая работа [607,3 K], добавлен 17.05.2015

  • American multinational corporation that designs and markets consumer electronics, computer software, and personal computers. Business Strategy Apple Inc. Markets and Distribution. Research and Development. Emerging products – AppleTV, iPad, Ping.

    курсовая работа [679,3 K], добавлен 03.01.2012

  • Анализ деятельности ОАО "Авиадвигатель". Интегрированная логистическая поддержка промышленных изделий как совокупность видов инженерной деятельности, реализуемых посредством информационных технологий. Обзор системы Siemens PLM Software Teamcenter 2007.

    курсовая работа [4,5 M], добавлен 13.01.2013

  • Монтаж и прокладывание локальной сети 10 Base T. Общая схема подключений. Сферы применение компьютерных сетей. Протоколы передачи информации. Используемые в сети топологии. Способы передачи данных. Характеристика основного программного обеспечения.

    курсовая работа [640,0 K], добавлен 25.04.2015

  • Разработка комплекта технических документов на локальную компьютерную сеть 10 Base-T и 100 Base-TX. Топология сети "Шина". Выбор активного сетевого и серверного оборудования, характеристики коммутатора. Безопасность сети, ее пропускная способность.

    курсовая работа [976,9 K], добавлен 08.04.2014

  • История программных продуктов "Borland Software Corporation". Языки программирования Turbo-Pascal, Delphi, CaliberRM, Turbo C++ и основные их принципы работы. Развитие их совместимости с Windows. Создание корпоративных систем на основе Веб-технологий.

    реферат [20,9 K], добавлен 02.04.2010

  • Разработка утилиты кодирования и декодирования формата Base 64 в программной среде Linux с использованием компилятора. Написание программы на языке С++. Кодирование символьной строки любого набора байт в последовательность печатных ASCII символов.

    курсовая работа [1,4 M], добавлен 10.09.2013

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.