Login
Login

Re: Implementing indicators which require OHLC

Home 21090308 Forums Re: Implementing indicators which require OHLC

#2027
Ryu
Member

Donny,

In AlgoQuant, signal (or indicator) and strategy are two different concepts.

[tt:5zzmwwqw]Signal[/tt:5zzmwwqw] takes prices (and maybe other data)and generate buy, sell signals, etc. It descrbes an aspect of the price process. For example, MA crossover monitors for the crossovers of two averages.

[tt:5zzmwwqw]Strategy[/tt:5zzmwwqw], on the other hand, interacts with the market by sending orders. It determines when/what to buy and sell and how much. A [tt:5zzmwwqw]Strategy[/tt:5zzmwwqw] can montior multiple [tt:5zzmwwqw]Signal[/tt:5zzmwwqw]’s to look at different aspects of the market.

In other words,
[tt:5zzmwwqw]Signal[/tt:5zzmwwqw] is about monitoring the market.
[tt:5zzmwwqw]Strategy[/tt:5zzmwwqw] is a container of [tt:5zzmwwqw]Signal[/tt:5zzmwwqw]’s. Based on the output of the signals, a strategy determines when and what to buy/sell and how much.

In your case, I would implement a class [tt:5zzmwwqw]OHLCIndicator[/tt:5zzmwwqw] as a signal, e.g., [tt:5zzmwwqw]DoubleSignal[/tt:5zzmwwqw]. Then I would create a strategy class that uses this signal.

A cache is usually for preparing data from data sources, e.g., filtering. It is not for implementing signals and strategies.

Hope this helps.