Obtaining Signals from Bitstrings

2 vues (au cours des 30 derniers jours)
Andriy Artemyev
Andriy Artemyev le 10 Jan 2020
Greetings,
I am working on a university project on algorithmic trading. I am trying to replicate an approach found in a mathworks demonstration called AlgoTradingDemo3.m.
What the author does, and what I want to replicate, is to create bitstring and optain a signal from it that has the values 1,-1 or 0. A population of such bitstrings would then be used in a genetic algorithm optimization.
To give backround: The algorithmic trading strategy used in the demo was build based on 2 technical indicators, which each gave a buy (1) or shortsell(0) recommendation.
In the demo a bitstring of length 6 was then created.
The first and fourth element of the bitstring related to the recommendations from the indicators.
the elements between these, ie. the second and third elements, contained the logical connection between the indicator signals.
if the value of these pairs was [0,0] that would mean an AND connection, meaning the bitstring would give a buy or sell recommendation only if both indicators also give the same recommentadion.
if the value of this pairs was [0 1], that would mean an OR connection
if the value of this pairs was [1 0], that would mean an XOR connection
a value of [1 1] is not be defined.
The last 2 elements of the bitstring decide whether a signal obtained from an indicator is active or not. If for example the last element was 0, that would mean the signal obtained from the second indicator would be ignored for the strategy.
In a later demo, the bitstring size was increased as a third technical indicator was added to the strategy.
My question now is, how to I best go about creating a function that generates signals from such bitstrings? The author of the demo had a function that takes in a population of bitstrings as well as a matrix of different indicator signals.

Réponses (0)

Catégories

En savoir plus sur Financial Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by