Streams and Functions Class

Created at 14 Apr 2020, 08:03
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
GE

gennimatas

Joined 19.09.2018

Streams and Functions Class
14 Apr 2020, 08:03


Hi

I guess the Functions class is mainly used inside the Indicator.Calculate override.

In Calculate we may have Bars of different than the indicator instance time frames.

Most Functions are accepting an int period and all are assuming as starting index the series.Count.

Everything is fine while IsLastBar = true, but when it is false (initialization phase), everything goes wrong as the assumed

series.Count passed is correct for the series count but not the "manipulated count" for initialization purposes,

which means not the current index which would be wrong anyway because of the different time frame.

So, what is needed is an int StartingIndex in all those functions like series.AnyFunction(int period, int index)

and let the consumer pass the required/converted index to the function.

This would not only straighten things out, but also would add functionality to the system

as the functions would work not only for the last bar but for the entire range of bars also.

Regards


@gennimatas
Replies

PanagiotisCharalampous
14 Apr 2020, 08:38

Hi Takis,

Please use the Suggestions section for suggestions.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

gennimatas
14 Apr 2020, 10:28

RE:

PanagiotisCharalampous said:

Hi Takis,

Please use the Suggestions section for suggestions.

Best Regards,

Panagiotis 

Join us on Telegram

Hi Panagiotis,

This is not a suggestion!

This is a call to fix Functions class that misbehave when LastIndex != true

Thnx


@gennimatas

PanagiotisCharalampous
14 Apr 2020, 10:30

Hi Takis,

This behavior is by design. But even if it was a bug, you are still in the wrong section :).

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

gennimatas
14 Apr 2020, 10:34

RE:

PanagiotisCharalampous said:

Hi Takis,

This behavior is by design. But even if it was a bug, you are still in the wrong section :).

Best Regards,

Panagiotis 

Join us on Telegram

Oh! Am i? lol


@gennimatas