﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/css' href='https://stocksharp.com/css/style.css'?>
<?xml-stylesheet type='text/css' href='https://stocksharp.com/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-04-16T12:02:18Z</updated>
  <logo>https://stocksharp.com/images/logo.png</logo>
  <link href="https://stocksharp.com/handlers/atom.ashx?category=topic&amp;id=10751" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.com/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.com/users/104651/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">Hi,&lt;br /&gt;I&amp;#39;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;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;div class="innercode"&gt;&lt;br /&gt;ParabolicSar psar = new ParabolicSar&lt;br /&gt;            {&lt;br /&gt;                Acceleration = SARSeed,&lt;br /&gt;                AccelerationStep = 0.02M,&lt;br /&gt;                AccelerationMax = 0.2M&lt;br /&gt;            };&lt;br /&gt;            for(int i = 0; i &amp;lt; iBars; i++)&lt;br /&gt;            {&lt;br /&gt;                TimeFrameCandle candle = new TimeFrameCandle()&lt;br /&gt;                {&lt;br /&gt;                    ClosePrice = (decimal)closeArr&amp;#91;i&amp;#93;,&lt;br /&gt;                    HighPrice = (decimal)highArr&amp;#91;i&amp;#93;,&lt;br /&gt;                    LowPrice = (decimal)lowArr&amp;#91;i&amp;#93;,&lt;br /&gt;                    OpenPrice = (decimal)openArr&amp;#91;i&amp;#93;,&lt;br /&gt;                };&lt;br /&gt;                psar.Process(candle);&lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;            var sarValue = psar.GetValue(shift);&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;Thank you</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>