← Zurück

c# API to calculate parabolic sar

Hi, I'm trying to use the parabolic sar class in the S# library inside my C# program. My understanding is I need to populate the SAR object with values using the process() method like this:


ParabolicSar psar = new ParabolicSar
            {
                Acceleration = SARSeed,
                AccelerationStep = 0.02M,
                AccelerationMax = 0.2M
            };
            for(int i = 0; i < iBars; i++)
            {
                TimeFrameCandle candle = new TimeFrameCandle()
                {
                    ClosePrice = (decimal)closeArr[i],
                    HighPrice = (decimal)highArr[i],
                    LowPrice = (decimal)lowArr[i],
                    OpenPrice = (decimal)openArr[i],
                };
                psar.Process(candle);
            }
            
            var sarValue = psar.GetValue(shift);

But I am getting no values and the container is empty. How can I fill it with data to get the correct PSAR value at a specific candle instance. Your help is appreciated.

Thank you

War dieses Thema hilfreich?

Thema teilen

Kommentare (0)

Anmelden oder Konto erstellen, Melden Sie sich an oder registrieren Sie sich, um einen Kommentar zu hinterlassen

Noch keine Kommentare. Seien Sie der Erste!