Skip to content

Commit 89969f4

Browse files
Ivan ZalutskiyIvan Zalutskiy
Ivan Zalutskiy
authored and
Ivan Zalutskiy
committed
Documentation Eng tasks 55 - 75 Adapter initialization topic fix
1 parent 32811e1 commit 89969f4

File tree

89 files changed

+1623
-13285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1623
-13285
lines changed

Documentation/en/ContentLayout.content

Lines changed: 151 additions & 151 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<topic id="75f3b79f-2edf-4169-8e45-243eef080250" revisionNumber="1">
3+
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
4+
<introduction>
5+
<para>The code below demonstrates how to initialize the
6+
<codeEntityReference>T:StockSharp.AlorHistory.AlorHistoryMessageAdapter</codeEntityReference>
7+
and pass it to the
8+
<codeEntityReference>T:StockSharp.Algo.Connector</codeEntityReference>.</para>
9+
<code language="C#">
10+
<![CDATA[
11+
var messageAdapter = new AlorHistoryMessageAdapter(Connector.TransactionIdGenerator);
12+
13+
Connector.Adapter.InnerAdapters.Add(messageAdapter);
14+
...
15+
]]>
16+
</code>
17+
18+
</introduction>
19+
20+
<relatedTopics>
21+
<link xlink:href="0e99f0d7-9d8a-4bb5-a914-6461677b267b" />
22+
</relatedTopics>
23+
</developerConceptualDocument>
24+
</topic>

Documentation/en/Topics/AlphaVantageSample.aml

Lines changed: 3 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -2,143 +2,9 @@
22
<topic id="02913c08-eeab-48e3-9e62-35dccea1db59" revisionNumber="1">
33
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
44
<introduction>
5-
<para>The SampleAlphaVantage application shows an example of working with the <codeEntityReference qualifyHint="false">T:StockSharp.AlphaVantage.AlphaVantageTrader</codeEntityReference>
6-
as shown in the figure below. The example source code is in the <legacyItalic>Samples/AlphaVantage</legacyItalic> folder of the installation package.</para>
7-
<mediaLink><image placement="center" xlink:href="AlphaVantageSample"/></mediaLink>
5+
<para>При работе с коннектором требуется указать <legacyBold>Токен</legacyBold> для подключения
6+
к торговой площадке. <legacyBold>Токен</legacyBold>
7+
предоставляются брокером. Для получения API доступа рекомендуется обратиться к брокеру.</para>
88
</introduction>
9-
10-
<procedure>
11-
<steps class="ordered">
12-
<step>
13-
<content>
14-
<para>First, you need to create an instance of the
15-
<codeEntityReference qualifyHint="false">T:StockSharp.AlphaVantage.AlphaVantageTrader</codeEntityReference>:</para>
16-
<code language="C#">
17-
<![CDATA[
18-
Trader = new AlphaVantageTrader();// { LogLevel = LogLevels.Debug };
19-
]]>
20-
</code>
21-
</content>
22-
</step>
23-
<step>
24-
<content>
25-
<para>Next, you should subscribe on required <codeEntityReference qualifyHint="false">T:StockSharp.BusinessEntities.IConnector</codeEntityReference> events:</para>
26-
<code language="C#">
27-
<![CDATA[
28-
// subscribe on successfully connect event
29-
Trader.Connected += () =>
30-
{
31-
// set flag (connection is established)
32-
_isConnected = true;
33-
34-
// update gui labes
35-
this.GuiAsync(() => ChangeConnectStatus(true));
36-
};
37-
38-
// subscribe on connection error event
39-
Trader.ConnectionError += error => this.GuiAsync(() =>
40-
{
41-
// update gui labes
42-
ChangeConnectStatus(false);
43-
44-
MessageBox.Show(this, error.ToString(), "Connection was dropped.");
45-
});
46-
47-
// subscribe on successfully disconnect event
48-
Trader.Disconnected += () => this.GuiAsync(() => ChangeConnectStatus(false));
49-
50-
// subscribe on error event
51-
Trader.Error += error => this.GuiAsync(() => MessageBox.Show(this, error.ToString(), "Data processing error"));
52-
53-
// new securities received
54-
Trader.NewSecurity += security => _securitiesWindow.SecurityPicker.Securities.Add(security);
55-
56-
// new own trades received
57-
Trader.NewMyTrade += trade => _myTradesWindow.TradeGrid.Trades.Add(trade);
58-
59-
// new anonymous trades received
60-
Trader.NewTrade += trade => _tradesWindow.TradeGrid.Trades.Add(trade);
61-
62-
// new orders received
63-
Trader.NewOrder += order => _ordersWindow.OrderGrid.Orders.Add(order);
64-
65-
// new portofolios (=accounts) received
66-
Trader.NewPortfolio += portfolio =>
67-
{
68-
// subscribe on portfolio updates
69-
Trader.RegisterPortfolio(portfolio);
70-
71-
_portfoliosWindow.PortfolioGrid.Portfolios.Add(portfolio);
72-
};
73-
Trader.NewPosition += position => _portfoliosWindow.PortfolioGrid.Positions.Add(position);
74-
75-
// subscribe on error of order registration event
76-
Trader.OrderRegisterFailed += _ordersWindow.OrderGrid.AddRegistrationFail;
77-
// subscribe on error of order cancelling event
78-
Trader.OrderCancelFailed += OrderFailed;
79-
80-
]]>
81-
</code>
82-
</content>
83-
</step>
84-
<step>
85-
<content>
86-
<para>Finally, you need to connect to <token>AlphaVantage</token> server:</para>
87-
<code language="C#">
88-
<![CDATA[
89-
Trader.Connect();
90-
]]>
91-
</code>
92-
</content>
93-
</step>
94-
95-
<step>
96-
<content>
97-
<para>Once connected, you can expect to trigger events:</para>
98-
<list class="bullet">
99-
<listItem>
100-
<para><codeEntityReference qualifyHint="true">E:StockSharp.BusinessEntities.IConnector.SecuritiesChanged</codeEntityReference> –
101-
instrument change (last price, best bid/ask price, etc.) requested through
102-
<codeEntityReference>M:StockSharp.BusinessEntities.IConnector.RegisterSecurity(StockSharp.BusinessEntities.Security,System.Nullable{System.DateTimeOffset},System.Nullable{System.DateTimeOffset},System.Nullable{System.Int64},StockSharp.Messages.MarketDataBuildModes,System.Nullable{StockSharp.Messages.MarketDataTypes})</codeEntityReference> method.</para>
103-
</listItem>
104-
<listItem>
105-
<para><codeEntityReference qualifyHint="true">E:StockSharp.BusinessEntities.IConnector.NewTrade</codeEntityReference> –
106-
new ticks on instruments subscribed by using <codeEntityReference>M:StockSharp.BusinessEntities.IConnector.RegisterTrades(StockSharp.BusinessEntities.Security,System.Nullable{System.DateTimeOffset},System.Nullable{System.DateTimeOffset},System.Nullable{System.Int64},StockSharp.Messages.MarketDataBuildModes,System.Nullable{StockSharp.Messages.MarketDataTypes})</codeEntityReference> method.</para>
107-
</listItem>
108-
</list>
109-
</content>
110-
</step>
111-
<step>
112-
<content>
113-
<para>For updates on the selected instrument and ticks you need to use the
114-
<codeEntityReference>M:StockSharp.BusinessEntities.IConnector.RegisterSecurity(StockSharp.BusinessEntities.Security,System.Nullable{System.DateTimeOffset},System.Nullable{System.DateTimeOffset},System.Nullable{System.Int64},StockSharp.Messages.MarketDataBuildModes,System.Nullable{StockSharp.Messages.MarketDataTypes})</codeEntityReference> and
115-
<codeEntityReference>M:StockSharp.BusinessEntities.IConnector.RegisterTrades(StockSharp.BusinessEntities.Security,System.Nullable{System.DateTimeOffset},System.Nullable{System.DateTimeOffset},System.Nullable{System.Int64},StockSharp.Messages.MarketDataBuildModes,System.Nullable{StockSharp.Messages.MarketDataTypes})</codeEntityReference> methods, respectively:</para>
116-
<code language="C#">
117-
<![CDATA[
118-
private void QuotesClick(object sender, RoutedEventArgs e)
119-
{
120-
var trader = MainWindow.Instance.Trader;
121-
122-
foreach (var security in SecurityPicker.SelectedSecurities)
123-
{
124-
if (trader.RegisteredSecurities.Contains(security))
125-
{
126-
trader.UnRegisterSecurity(security);
127-
trader.UnRegisterTrades(security);
128-
}
129-
else
130-
{
131-
trader.RegisterSecurity(security);
132-
trader.RegisterTrades(security);
133-
}
134-
}
135-
}
136-
]]>
137-
</code>
138-
</content>
139-
</step>
140-
</steps>
141-
</procedure>
142-
1439
</developerConceptualDocument>
14410
</topic>

0 commit comments

Comments
 (0)