Fractals confusion

Created at 20 Mar 2024, 14:45
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!
Baluda's avatar

Baluda

Joined 08.02.2024

Fractals confusion
20 Mar 2024, 14:45


Consider this bot:

    public class NewcBot : Robot
    {
        private Fractals _fractal;

        protected override void OnStart()
        {
            _fractal = Indicators.Fractals(10);
        }

        protected override void OnBar()
        {
            for (int i = 1; i < 10; i++)
            {
                Print("i: [{0}] High: [{1:n5}] UpFractal: [{2:n5}]", i, Bars.Last(i).High, _fractal.UpFractal.Last(i));
            }
        }

    }

This prints some values on each new bar. This some sample output:

20/03/2024 15:29:00.867 | i: [8] High: [1,08507] UpFractal: [1,08513]

I would expect to be the High and UpFractal values for bar 8 to be the same.

Am I missing something?

Paul


@Baluda
Replies

firemyst
21 Mar 2024, 08:26

In all honesty, I can't follow this. I'd rather see pictures. Do you have screen capture of the issue you can share?


@firemyst