forked from StockSharp/StockSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fc1e9c
commit f0c44bb
Showing
32 changed files
with
1,461 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
T:StockSharp.CoinCap.CoinCapMessageAdapter/summary;DocStr2538 | ||
P:StockSharp.CoinCap.CoinCapMessageAdapter.AllTimeFrames/summary;DocStr206 | ||
M:StockSharp.CoinCap.CoinCapMessageAdapter.#ctor(Ecng.Common.IdGenerator)/summary;DocStr1 | ||
M:StockSharp.CoinCap.CoinCapMessageAdapter.#ctor(Ecng.Common.IdGenerator)/param/transactionIdGenerator;DocStr3311 | ||
M:StockSharp.CoinCap.CoinCapMessageAdapter.OnSendInMessage(StockSharp.Messages.Message)/inheritdoc;DocStr8459 | ||
T:StockSharp.CoinCap.CoinCapTrader/summary;DocStr2539 | ||
M:StockSharp.CoinCap.CoinCapTrader.#ctor/summary;DocStr1 |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application x:Class="SampleCoinCap.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose" DispatcherUnhandledException="ApplicationDispatcherUnhandledException"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace SampleCoinCap | ||
{ | ||
using System.Windows; | ||
using System.Windows.Threading; | ||
|
||
public partial class App | ||
{ | ||
private void ApplicationDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) | ||
{ | ||
MessageBox.Show(MainWindow, e.Exception.ToString()); | ||
e.Handled = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Window x:Class="SampleCoinCap.ChartWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:charting="http://schemas.stocksharp.com/xaml" | ||
Title="ChartWindow" Height="448" Width="758"> | ||
|
||
<charting:Chart x:Name="Chart" /> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
namespace SampleCoinCap | ||
{ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Windows.Media; | ||
|
||
using StockSharp.Algo.Candles; | ||
using StockSharp.CoinCap; | ||
using StockSharp.Xaml.Charting; | ||
|
||
partial class ChartWindow | ||
{ | ||
private readonly CoinCapTrader _trader; | ||
private readonly CandleSeries _candleSeries; | ||
private readonly ChartCandleElement _candleElem; | ||
|
||
public ChartWindow(CandleSeries candleSeries, DateTimeOffset? from = null, DateTimeOffset? to = null) | ||
{ | ||
InitializeComponent(); | ||
|
||
_candleSeries = candleSeries ?? throw new ArgumentNullException(nameof(candleSeries)); | ||
_trader = MainWindow.Instance.Trader; | ||
|
||
Chart.ChartTheme = ChartThemes.ExpressionDark; | ||
|
||
var area = new ChartArea(); | ||
Chart.Areas.Add(area); | ||
|
||
_candleElem = new ChartCandleElement | ||
{ | ||
AntiAliasing = false, | ||
UpFillColor = Colors.White, | ||
UpBorderColor = Colors.Black, | ||
DownFillColor = Colors.Black, | ||
DownBorderColor = Colors.Black, | ||
}; | ||
|
||
area.Elements.Add(_candleElem); | ||
|
||
_trader.CandleSeriesProcessing += ProcessNewCandle; | ||
_trader.SubscribeCandles(_candleSeries, from, to); | ||
|
||
Title = candleSeries.ToString(); | ||
} | ||
|
||
private void ProcessNewCandle(CandleSeries series, Candle candle) | ||
{ | ||
if (series != _candleSeries) | ||
return; | ||
|
||
Chart.Draw(_candleElem, candle); | ||
} | ||
|
||
protected override void OnClosing(CancelEventArgs e) | ||
{ | ||
_trader.UnSubscribeCandles(_candleSeries); | ||
_trader.CandleSeriesProcessing -= ProcessNewCandle; | ||
|
||
base.OnClosing(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Window x:Class="SampleCoinCap.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization" | ||
Title="{x:Static loc:LocalizedStrings.XamlStr540}" Height="110" Width="512" ResizeMode="NoResize"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition /> | ||
<ColumnDefinition /> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
|
||
<Button x:Name="ConnectBtn" Background="LightPink" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Content="{x:Static loc:LocalizedStrings.Connect}" Click="ConnectClick" /> | ||
<Button x:Name="ShowSecurities" Grid.Column="1" Grid.Row="0" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Securities}" Click="ShowSecuritiesClick" /> | ||
|
||
<Button x:Name="ShowTrades" Grid.Column="1" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Ticks}" Click="ShowTradesClick" /> | ||
</Grid> | ||
</Window> |
Oops, something went wrong.