﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/style.css'?>
<?xml-stylesheet type='text/css' href='https://stocksharp.ru/css/bbeditor.css'?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">c# API to calculate parabolic sar</title>
  <id>~/topic/10751/c-api-to-calculate-parabolic-sar/</id>
  <rights type="text">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  <updated>2026-06-19T13:46:29Z</updated>
  <logo>https://stocksharp.ru/images/logo.png</logo>
  <link href="https://stocksharp.ru/handlers/atom.ashx?category=topic&amp;id=10751" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.ru/posts/m/47615/</id>
    <title type="text">Hi, I&amp;apos;m trying to use the parabolic sar class in the S# library inside my C# program. My understandi...</title>
    <published>2019-05-31T15:47:46Z</published>
    <updated>2019-05-31T15:47:46Z</updated>
    <author>
      <name>Ash</name>
      <uri>https://stocksharp.ru/users/104651/</uri>
      <email>info@stocksharp.ru</email>
    </author>
    <content type="html">&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
ParabolicSar psar = new ParabolicSar
            {
                Acceleration = SARSeed,
                AccelerationStep = 0.02M,
                AccelerationMax = 0.2M
            };
            for(int i = 0; i &amp;lt; 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);

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>