Layer of candles creation in Os Engine. CandleFactory.

Layer of candles creation in Os Engine. CandleFactory.

In this article, we will discuss the Candle Factory class, where final candle implementations are created.

CandleFactory is a static class visible throughout the project. It knows the names of candle types currently connected in the project and can create an implementation of a type based on the series name and provide it outward.

It is located in the project here:

CandleFactory has only TWO public methods:

1.  GetCandlesNames - returns a list of available candle types in this version of OsEngine.

2.  CreateCandleSeriesRealization - creates an object realization of the series based on the type name.

And takes candle types from two places:

From the file system and from the project sources. Let's discuss both types of storing series implementations.

 

Series from the file system.

Next to the exe file of OsEngine, there is a Custom folder where scripts of robots, indicators, and candle series are stored, which are of interest today:

And if you go to the CandleSeries folder, you can find candle series classes that are dynamically loaded when the OsEngine exe file is launched:

Currently, as an example, the following are stored here:

1.  Renko.

2.  Volume.

With the help of this folder, you can share your personal and private candle series among yourselves and easily switch to a new OsEngine version.

 

Series from the project.

Inside the project, there is a separate Series folder where candle series are stored. Here they are:

You can use them as an example to implement your trading ideas. Remember that if you modify a series from this folder, the project needs to be "built" for OsEngine to pick up the changes. If you store candles in the Custom folder, only an OsEngine restart is required.

Successful algorithms!

Os Engine support