﻿<?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">Unable to load existing position from storage</title>
  <id>~/topic/8814/unable-to-load-existing-position-from-storage/</id>
  <rights type="text">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  <updated>2026-06-10T07:40:55Z</updated>
  <logo>https://stocksharp.com/images/logo.png</logo>
  <link href="https://stocksharp.com/handlers/atom.ashx?category=topic&amp;id=8814" rel="self" type="application/rss+xml" />
  <entry>
    <id>https://stocksharp.com/posts/m/41765/</id>
    <title type="text">Thank you for more details. The answer was provided my colleague by email. </title>
    <published>2017-11-21T18:52:26Z</published>
    <updated>2017-11-21T18:52:26Z</updated>
    <author>
      <name>Support</name>
      <uri>https://stocksharp.com/users/97869/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Thank you for more details. The answer was provided my colleague by email.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/41675/</id>
    <title type="text">Hi This will give me the position in the position collection of the _connector. But I need the mytra...</title>
    <published>2017-11-16T10:53:13Z</published>
    <updated>2017-11-16T10:53:13Z</updated>
    <author>
      <name>Johan Kirsten</name>
      <uri>https://stocksharp.com/users/99799/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This will give me the position in the position collection of the _connector. But I need the mytrade loaded into the mytrade collection so that I can access the original user order id. Currently the mytrade collection does not load. How do I get it to load&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/41672/</id>
    <title type="text">Please use the following lines in your code: _connector.NewPosition += _connector_NewPosition; _conn...</title>
    <published>2017-11-15T16:53:37Z</published>
    <updated>2017-11-15T16:53:37Z</updated>
    <author>
      <name>Support</name>
      <uri>https://stocksharp.com/users/97869/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Please use the following lines in your code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;_connector.NewPosition += _connector_NewPosition;
_connector.PositionChanged += _connector_PositionChanged;

private static void _connector_PositionChanged(StockSharp.BusinessEntities.Position obj)
{
	Console.WriteLine(&amp;quot;_connector_PositionChanged:&amp;quot; + obj);
}

private static void _connector_NewPosition(StockSharp.BusinessEntities.Position obj)
{
	Console.WriteLine(&amp;quot;_connector_NewPosition:&amp;quot; + obj);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After modification your sample with sent csv storage should display following output:&lt;/p&gt;
&lt;details&gt;&lt;summary&gt;_connector_NewPortfolio:DU775642
_connector_NewPosition:DU775642-SPXW  171215C02580000@CBOE
_connector_PositionChanged:DU775642-SPXW  171215C02580000@CBOE
_connector_NewPosition:DU775642-SPXW  171215C02580000@ALL
_connector_PositionChanged:DU775642-SPXW  171215C02580000@ALL
_connector_NewPortfolio:DU229525
_connector_NewPosition:DU229525-AAPL@NASDAQ
_connector_PositionChanged:DU229525-AAPL@NASDAQ&lt;/summary&gt;
&lt;/details&gt;
&lt;p&gt;Portfolio - is only money position. To get position for security you should to use Position class instead.&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/41645/</id>
    <title type="text">Johan Kirsten: Hi Is this problem related to not including this code: _entityRegistry.DelayAction.De...</title>
    <published>2017-11-13T15:39:31Z</published>
    <updated>2017-11-13T15:39:31Z</updated>
    <author>
      <name>Support</name>
      <uri>https://stocksharp.com/users/97869/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="@message(41600)" rel="nofollow" target="_blank"&gt;Johan Kirsten&lt;/a&gt;:&lt;/strong&gt;
Hi&lt;/p&gt;
&lt;p&gt;Is this problem related to not including this code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;_entityRegistry.DelayAction.DefaultGroup.WaitFlush(true);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; 
&amp;gt; in the application that must save the position? What does this code do?

We will investigate your archive later.

Yes, this line is necessary because saving process goes in parallel. You application can shut down before all changes will be flushed into disk.
&lt;/code&gt;&lt;/pre&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/41600/</id>
    <title type="text">Hi Is this problem related to not including this code: _entityRegistry.DelayAction.DefaultGroup.Wait...</title>
    <published>2017-11-10T12:10:31Z</published>
    <updated>2017-11-10T12:10:31Z</updated>
    <author>
      <name>Johan Kirsten</name>
      <uri>https://stocksharp.com/users/99799/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Is this problem related to not including this code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
_entityRegistry.DelayAction.DefaultGroup.WaitFlush(true);

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in the application that must save the position? What does this code do?&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
  <entry>
    <id>https://stocksharp.com/posts/m/41599/</id>
    <title type="text">Hi Using my application I opened a position in SPXW call. My application uses CSV storage, so it sho...</title>
    <published>2017-11-10T10:22:07Z</published>
    <updated>2017-11-10T10:22:07Z</updated>
    <author>
      <name>Johan Kirsten</name>
      <uri>https://stocksharp.com/users/99799/</uri>
      <email>info@stocksharp.com</email>
    </author>
    <content type="html">&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Using my application I opened a position in SPXW call. My application uses CSV storage, so it should have been stored. If I open my application the existing position does not get loaded. I have attached a console application that loads and connects using the storage my own application created. I have included the csv store in the zip file. It is in the bin/debug/data directory. Please look at the store. Did the position save to the store? If so, why does it not load? I also included the connector log in the bin/debug/logs directory.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
</content>
    <rights type="html">Copyright @ StockSharp Platform LLC 2010 - 2025</rights>
  </entry>
</feed>