Streams and Functions Class
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
Replies
gennimatas
14 Apr 2020, 10:28
RE:
PanagiotisCharalampous said:
Hi Takis,
Please use the Suggestions section for suggestions.
Best Regards,
Panagiotis
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
@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
Oh! Am i? lol
@gennimatas
PanagiotisCharalampous
14 Apr 2020, 08:38
Hi Takis,
Please use the Suggestions section for suggestions.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous