Add Outlook Inspired and Stock Market demos
10
StockMarketTraderApp/Data/Companies.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Companies>
|
||||
<Company Id="0" Name="MSFT" />
|
||||
<Company Id="1" Name="EBAY" />
|
||||
<Company Id="2" Name="ERTS" />
|
||||
<Company Id="3" Name="YHOO" />
|
||||
<Company Id="4" Name="CSCO" />
|
||||
<Company Id="5" Name="AAPL" />
|
||||
<Company Id="6" Name="IBM" />
|
||||
</Companies>
|
||||
17721
StockMarketTraderApp/Data/StockData.xml
Normal file
21
StockMarketTraderApp/Devexpress.StockMarketTrader.csproj
Normal file
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<AssemblyName>DevExpress.StockMarketTrader</AssemblyName>
|
||||
<RootNamespace>DevExpress.StockMarketTrader</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DevExpress.WindowsDesktop.Win" Version="18.2.4-ctp" />
|
||||
<PackageReference Include="System.ServiceModel.Http" Version="4.5.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="**\*.svg" />
|
||||
<EmbeddedResource Include="Images\DX.ico" />
|
||||
<EmbeddedResource Include="Data\*.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
25
StockMarketTraderApp/Devexpress.StockMarketTrader.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.168
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Devexpress.StockMarketTrader", "Devexpress.StockMarketTrader.csproj", "{769CB4D9-EAF8-4A69-983D-B9320CC01012}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{769CB4D9-EAF8-4A69-983D-B9320CC01012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{769CB4D9-EAF8-4A69-983D-B9320CC01012}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{769CB4D9-EAF8-4A69-983D-B9320CC01012}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{769CB4D9-EAF8-4A69-983D-B9320CC01012}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D0FE8168-9015-4121-A2EB-69EEE072E76E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
StockMarketTraderApp/Images/DX.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
17
StockMarketTraderApp/ImagesSvg/1-5y.svg
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<path class="Black" d="M4.7,8.9v12.9h-2V11.4c-0.4,0.3-0.8,0.5-1.2,0.7c-0.4,0.2-0.9,0.3-1.5,0.5v-1.7c0.3-0.1,0.7-0.2,1-0.4
|
||||
s0.6-0.3,0.9-0.4s0.6-0.3,0.9-0.5s0.6-0.4,1-0.6H4.7z"/>
|
||||
<path class="Black" d="M8.7,22c-0.4,0-0.7-0.1-0.9-0.3c-0.2-0.2-0.4-0.5-0.4-0.8c0-0.3,0.1-0.6,0.4-0.8s0.5-0.4,0.9-0.4
|
||||
c0.4,0,0.7,0.1,0.9,0.4s0.4,0.5,0.4,0.8c0,0.3-0.1,0.6-0.4,0.8C9.4,21.8,9.1,22,8.7,22z"/>
|
||||
<path class="Black" d="M12.2,21.5v-2c0.8,0.6,1.7,0.8,2.5,0.8c0.9,0,1.5-0.2,2.1-0.7c0.5-0.4,0.8-1,0.8-1.7c0-0.7-0.3-1.3-0.8-1.7
|
||||
c-0.5-0.4-1.3-0.6-2.3-0.6c-0.3,0-1,0-2.1,0.1l0.4-6.6h6.2v1.7h-4.5l-0.2,3.2c0.4,0,0.8,0,1.1,0c1.3,0,2.4,0.3,3.1,1
|
||||
c0.7,0.7,1.1,1.6,1.1,2.8c0,1.2-0.4,2.2-1.3,3c-0.8,0.8-2,1.1-3.4,1.1C13.8,22,12.8,21.8,12.2,21.5z"/>
|
||||
<path class="Black" d="M30,12.8l-4.1,10.4c-0.8,1.9-2,2.8-3.6,2.8c-0.4,0-0.8,0-1.1-0.1v-1.7c0.3,0.1,0.6,0.2,0.9,0.2
|
||||
c0.8,0,1.3-0.4,1.7-1.1l0.6-1.5l-3.6-9h2.3l2.1,6.5c0,0.1,0.1,0.3,0.2,0.7h0c0-0.1,0.1-0.3,0.2-0.6l2.3-6.6H30z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
12
StockMarketTraderApp/ImagesSvg/1y.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<path class="Black" d="M25.1,13l-4.1,10.4c-0.8,1.9-2,2.8-3.6,2.8c-0.4,0-0.8,0-1.1-0.1v-1.7c0.3,0.1,0.6,0.2,0.9,0.2
|
||||
c0.8,0,1.3-0.4,1.7-1.1l0.6-1.5L16,13h2.3l2.1,6.5c0,0.1,0.1,0.3,0.2,0.7h0c0-0.1,0.1-0.3,0.2-0.6l2.3-6.6H25.1z"/>
|
||||
<path class="Black" d="M13.4,9.1V22h-2V11.6c-0.4,0.3-0.8,0.5-1.2,0.7c-0.4,0.2-0.9,0.3-1.5,0.5V11c0.3-0.1,0.7-0.2,1-0.4
|
||||
s0.6-0.3,0.9-0.4s0.6-0.3,0.9-0.5s0.6-0.4,1-0.6H13.4z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 824 B |
17
StockMarketTraderApp/ImagesSvg/2y.svg
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<path class="Black" d="M14.8,22H6.9v-1c0-0.4,0.1-0.8,0.2-1.1s0.3-0.7,0.4-1c0.2-0.3,0.4-0.6,0.7-0.9c0.3-0.3,0.5-0.5,0.8-0.8
|
||||
c0.3-0.3,0.6-0.5,0.9-0.7c0.3-0.2,0.6-0.5,0.9-0.7c0.3-0.2,0.5-0.5,0.7-0.7c0.2-0.2,0.4-0.4,0.6-0.7s0.3-0.5,0.4-0.7
|
||||
c0.1-0.3,0.1-0.5,0.1-0.8c0-0.3-0.1-0.6-0.2-0.9c-0.1-0.2-0.2-0.5-0.4-0.6c-0.2-0.2-0.4-0.3-0.7-0.4c-0.3-0.1-0.5-0.1-0.8-0.1
|
||||
c-0.5,0-1,0.1-1.6,0.4s-1,0.6-1.5,1.1v-2c0.3-0.2,0.5-0.4,0.8-0.5s0.5-0.3,0.8-0.4c0.3-0.1,0.6-0.2,0.9-0.2s0.6-0.1,1-0.1
|
||||
c0.6,0,1.1,0.1,1.5,0.2c0.5,0.1,0.9,0.4,1.2,0.7c0.3,0.3,0.6,0.7,0.8,1.1s0.3,0.9,0.3,1.5c0,0.5-0.1,1-0.2,1.4
|
||||
c-0.1,0.4-0.3,0.8-0.5,1.1s-0.5,0.7-0.8,1s-0.7,0.6-1.1,1c-0.3,0.3-0.7,0.5-1,0.8c-0.3,0.3-0.6,0.5-0.9,0.8s-0.5,0.5-0.7,0.7
|
||||
c-0.2,0.3-0.3,0.5-0.3,0.8v0h5.7V22z"/>
|
||||
<path class="Black" d="M25.1,13l-4.1,10.4c-0.8,1.9-2,2.8-3.6,2.8c-0.4,0-0.8,0-1.1-0.1v-1.7c0.3,0.1,0.6,0.2,0.9,0.2
|
||||
c0.8,0,1.3-0.4,1.7-1.1l0.6-1.5L16,13h2.3l2.1,6.5c0,0.1,0.1,0.3,0.2,0.7h0c0-0.1,0.1-0.3,0.2-0.6l2.3-6.6H25.1z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
12
StockMarketTraderApp/ImagesSvg/4y.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<path class="Black" d="M25.1,13l-4.1,10.4c-0.8,1.9-2,2.8-3.6,2.8c-0.4,0-0.8,0-1.1-0.1v-1.7c0.3,0.1,0.6,0.2,0.9,0.2
|
||||
c0.8,0,1.3-0.4,1.7-1.1l0.6-1.5L16,13h2.3l2.1,6.5c0,0.1,0.1,0.3,0.2,0.7h0c0-0.1,0.1-0.3,0.2-0.6l2.3-6.6H25.1z"/>
|
||||
<path class="Black" d="M13.7,9.4v8.1h1.9v1.7h-1.9V22h-2v-2.8H6v-1.7c0.5-0.6,1-1.2,1.6-1.9c0.5-0.7,1.1-1.4,1.6-2.1s1-1.4,1.4-2.1
|
||||
s0.8-1.4,1.1-2H13.7z M11.7,17.5v-5.3c-0.6,1.1-1.3,2.2-1.9,3s-1.2,1.6-1.8,2.3H11.7z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 863 B |
18
StockMarketTraderApp/ImagesSvg/6m.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<path class="Black" d="M12.5,18c0,0.6-0.1,1.2-0.3,1.7s-0.5,1-0.9,1.3C11,21.5,10.5,21.7,10,22c-0.5,0.2-1.1,0.3-1.6,0.3
|
||||
c-0.6,0-1.2-0.1-1.7-0.4s-1-0.6-1.4-1.1S4.6,19.7,4.4,19S4,17.4,4,16.5c0-1.2,0.1-2.2,0.4-3.1s0.7-1.7,1.1-2.3S6.7,10,7.3,9.7
|
||||
s1.4-0.5,2.1-0.5c0.5,0,0.9,0,1.3,0.1s0.7,0.2,0.9,0.3v1.8c-0.3-0.2-0.6-0.3-1-0.4s-0.7-0.2-1.2-0.2c-0.5,0-0.9,0.1-1.4,0.3
|
||||
s-0.8,0.5-1.1,0.9s-0.5,0.9-0.7,1.4s-0.3,1.2-0.3,2h0.1c0.3-0.4,0.6-0.7,1.1-1s1-0.4,1.6-0.4c0.6,0,1,0.1,1.5,0.3s0.8,0.4,1.1,0.8
|
||||
s0.6,0.7,0.7,1.2C12.4,16.8,12.5,17.4,12.5,18z M10.4,18.2c0-0.4,0-0.7-0.1-1s-0.2-0.6-0.4-0.8S9.5,16,9.3,15.9s-0.6-0.2-0.9-0.2
|
||||
s-0.7,0.1-0.9,0.2c-0.3,0.1-0.5,0.3-0.7,0.5s-0.3,0.4-0.4,0.7s-0.1,0.5-0.1,0.8c0,0.3,0,0.6,0.1,0.9s0.2,0.6,0.4,0.9
|
||||
s0.4,0.5,0.7,0.6c0.3,0.2,0.6,0.3,1,0.3c0.3,0,0.6-0.1,0.9-0.2s0.5-0.3,0.6-0.5s0.3-0.5,0.4-0.8S10.4,18.5,10.4,18.2z"/>
|
||||
<path class="Black" d="M28,22h-2v-4.9c0-0.9-0.1-1.6-0.4-2c-0.3-0.4-0.7-0.6-1.3-0.6c-0.5,0-1,0.3-1.4,0.8c-0.4,0.5-0.6,1.2-0.6,1.9
|
||||
V22h-2V17c0-1.7-0.6-2.5-1.8-2.5c-0.6,0-1,0.3-1.4,0.8c-0.4,0.5-0.5,1.2-0.5,2V22h-2v-9h2v1.4h0c0.7-1.1,1.6-1.6,2.8-1.6
|
||||
c0.6,0,1.2,0.2,1.6,0.5c0.5,0.3,0.8,0.8,1,1.3c0.7-1.2,1.7-1.9,3-1.9c2,0,3,1.2,3,3.7V22z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
52
StockMarketTraderApp/ImagesSvg/App Logo.svg
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 280 60" style="enable-background:new 0 0 280 60;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Red{fill:#E80505;}
|
||||
.Black{fill:#2B2B2B;}
|
||||
.st0{fill:#E80505;}
|
||||
.st1{opacity:0.75;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M60,29C59.4,16.2,48.9,6,36,6C22.8,6,12,16.7,12,30c0,1,0.1,1.9,0.2,2.9L7.1,38l2,2L21,28l8,8l17-17l18,18
|
||||
l2-2L60,29z M29,32l-8-8l-6,6c0,0,0,0,0,0c0-11.6,9.4-21,21-21c10.1,0,18.4,7.1,20.5,16.5L46,15L29,32z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="Red" d="M29,40l-8-8L10.9,42.1l2,2l2.2-2.2C19.3,49.1,27.1,54,36,54c10,0,18.6-6.1,22.2-14.8L60,41l2-2L46,23L29,40z
|
||||
M36,51c-8.1,0-15.2-4.6-18.6-11.4L21,36l8,8l17-17l9.8,9.8C53,45.1,45.2,51,36,51z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g class="st1">
|
||||
<path class="Black" d="M82.6,43v-5.6c2,1.6,4,2.4,5.8,2.4c1,0,1.8-0.3,2.3-0.9c0.5-0.6,0.8-1.3,0.8-2.2c0-0.9-0.3-1.6-0.8-2.3
|
||||
c-0.5-0.7-1.5-1.4-3-2.3c-3.5-2.1-5.3-4.8-5.3-8.2c0-2.5,0.7-4.5,2.2-6.1c1.5-1.5,3.5-2.3,5.9-2.3c2.1,0,3.9,0.3,5.4,1v5.2
|
||||
c-1.6-1-3.3-1.5-4.9-1.5c-0.9,0-1.6,0.3-2.2,0.9c-0.6,0.6-0.9,1.3-0.9,2.2c0,1.7,1.1,3.2,3.4,4.5c2.2,1.2,3.7,2.5,4.5,3.8
|
||||
c0.8,1.3,1.3,2.9,1.3,4.7c0,2.4-0.7,4.4-2.2,5.9c-1.5,1.5-3.6,2.3-6.3,2.3c-1,0-2.1-0.1-3.3-0.4C84,43.7,83.1,43.4,82.6,43z"/>
|
||||
<path class="Black" d="M109.4,43.7c-1,0.4-2.2,0.6-3.4,0.6c-3.4,0-5.1-2-5.1-6.1V28.2h-2.4V24h2.4v-4.5c0,0,0.1,0,0.4-0.1
|
||||
c2.9-1,4.5-1.5,4.7-1.5V24h3.4v4.2H106v9.6c0,1.6,0.6,2.3,1.9,2.3c0.6,0,1.1-0.1,1.5-0.4V43.7z"/>
|
||||
<path class="Black" d="M118.9,44.4c-2.6,0-4.6-0.9-6-2.7c-1.4-1.8-2.1-4.4-2.1-7.7c0-3.3,0.7-5.8,2.2-7.6c1.4-1.8,3.4-2.7,6-2.7
|
||||
c2.6,0,4.6,0.9,6,2.7c1.4,1.8,2.1,4.2,2.1,7.4c0,3.4-0.7,6.1-2.1,7.9C123.6,43.4,121.5,44.4,118.9,44.4z M119,27.8
|
||||
c-1.9,0-2.9,2-2.9,6.1c0,4.2,1,6.2,2.9,6.2c1.9,0,2.9-2.1,2.9-6.4C121.8,29.8,120.9,27.8,119,27.8z"/>
|
||||
<path class="Black" d="M141.4,43.2c-1,0.8-2.4,1.2-4.1,1.2c-2.2,0-4.1-0.9-5.6-2.8c-1.5-1.9-2.2-4.2-2.2-7.1c0-3.4,0.8-6,2.3-7.9
|
||||
s3.6-2.9,6.1-2.9c1.6,0,2.8,0.3,3.5,0.8V29c-0.7-0.8-1.6-1.2-2.7-1.2c-1.2,0-2.1,0.6-2.8,1.7c-0.7,1.1-1,2.7-1,4.6
|
||||
c0,2,0.3,3.5,1,4.5c0.6,1,1.5,1.6,2.7,1.6c1.1,0,2.1-0.4,2.9-1.1V43.2z"/>
|
||||
<path class="Black" d="M154.3,44l-4.7-10.2h0V44h-5.1V14.4h5.1v19h0L154,24h5.7l-5.1,9.3L160,44H154.3z"/>
|
||||
<path class="Black" d="M190.7,44V27.7c0-1.4,0.1-3.5,0.2-6.3h-0.1c-0.2,1.2-0.4,2.8-0.8,4.7L185.8,44h-4.9l-4.3-17.7l-0.8-5h-0.2
|
||||
c0.1,2.6,0.2,5.2,0.2,7.8V44h-4.5V16h7.6l3.9,17.1c0.4,1.7,0.6,3.2,0.7,4.3h0.1l0.1-1c0.2-1.6,0.3-2.7,0.5-3.4L188,16h7.3v28H190.7
|
||||
z"/>
|
||||
<path class="Black" d="M208.2,44v-2.6h-0.1c-1,2-2.5,3-4.7,3c-1.4,0-2.5-0.5-3.4-1.6c-0.9-1-1.3-2.5-1.3-4.2c0-3.7,1.9-6,5.6-6.8
|
||||
l4-0.8v-0.5c0-1.8-1-2.7-2.9-2.7c-1.6,0-3.3,0.6-5.2,1.9v-4.5c2.1-1,4.1-1.5,6-1.5c2.6,0,4.4,0.6,5.5,1.9s1.6,3.3,1.6,6.1V44H208.2
|
||||
z M208.2,34.3l-2.3,0.5c-1.5,0.3-2.3,1.3-2.3,3c0,0.8,0.2,1.4,0.6,1.9s0.8,0.6,1.4,0.6c0.8,0,1.5-0.4,1.9-1.1
|
||||
c0.5-0.7,0.7-1.7,0.7-2.9V34.3z"/>
|
||||
<path class="Black" d="M227.7,28.8c-0.6-0.2-1.2-0.4-1.8-0.4c-2.5,0-3.7,1.8-3.7,5.5V44h-5.1V24h5.1v3.3h0.1
|
||||
c0.7-2.4,2.1-3.7,4.1-3.7c0.4,0,0.8,0.1,1.3,0.2V28.8z"/>
|
||||
<path class="Black" d="M239.7,44L235,33.8h0V44h-5.1V14.4h5.1v19h0l4.4-9.4h5.7l-5.1,9.3l5.4,10.7H239.7z"/>
|
||||
<path class="Black" d="M250.8,35.6c0.1,3.1,1.5,4.7,4.4,4.7c1.5,0,3-0.5,4.6-1.4v4.2c-1.7,0.8-3.5,1.2-5.4,1.2
|
||||
c-2.8,0-5-0.9-6.5-2.6s-2.3-4.3-2.3-7.7c0-3,0.7-5.5,2.1-7.5c1.4-1.9,3.4-2.9,6-2.9c2.3,0,4.1,0.8,5.3,2.4c1.2,1.6,1.8,3.9,1.8,6.8
|
||||
v2.7H250.8z M256.2,32c0-1.4-0.2-2.5-0.5-3.3s-1-1.2-1.9-1.2c-1.8,0-2.8,1.5-2.9,4.5H256.2z"/>
|
||||
<path class="Black" d="M272.9,43.7c-1,0.4-2.2,0.6-3.4,0.6c-3.4,0-5.1-2-5.1-6.1V28.2H262V24h2.4v-4.5c0,0,0.1,0,0.4-0.1
|
||||
c2.9-1,4.5-1.5,4.7-1.5V24h3.4v4.2h-3.4v9.6c0,1.6,0.6,2.3,1.9,2.3c0.6,0,1.1-0.1,1.5-0.4V43.7z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
13
StockMarketTraderApp/ImagesSvg/Bars.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Red{fill:#D11C1C;}
|
||||
.Black{fill:#727272;}
|
||||
.Blue{fill:#1177D7;}
|
||||
</style>
|
||||
<rect x="4" y="18" class="Blue" width="6" height="10"/>
|
||||
<rect x="12" y="12" class="Red" width="6" height="16"/>
|
||||
<rect x="20" y="4" class="Black" width="6" height="24"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 633 B |
19
StockMarketTraderApp/ImagesSvg/Candles.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Red{fill:#D11C1C;}
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<polygon class="Red" points="26,12 24,12 24,8 22,8 22,12 20,12 20,26 22,26 22,30 24,30 24,26 26,26 "/>
|
||||
<polygon class="Red" points="10,18 8,18 8,8 6,8 6,18 4,18 4,26 6,26 6,30 8,30 8,26 10,26 "/>
|
||||
<g>
|
||||
<g>
|
||||
<path class="Black" d="M16,6V2h-2v4h-2v12h2v4h2v-4h2V6H16z M16,16h-2V8h2V16z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="Black" d="M16,6V2h-2v4h-2v12h2v4h2v-4h2V6H16z M16,16h-2V8h2V16z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 839 B |
9
StockMarketTraderApp/ImagesSvg/Connected.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.White{fill:#FFFFFF;}
|
||||
</style>
|
||||
<polygon class="White" points="24,4 12,4 6,16 12,16 6,28 24,16 18,16 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 490 B |
73
StockMarketTraderApp/ImagesSvg/DX Logo.svg
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 150 26" style="enable-background:new 0 0 150 26;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Black{fill:#333333;}
|
||||
.st0{opacity:0.5;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<path class="Black" d="M35.8,3.9c-1.6,0-3.2,0.1-4.4,0.4v16.6c0.9,0.1,2.1,0.2,3.7,0.2c2.9,0,5.3-0.7,6.8-2.1
|
||||
c1.3-1.2,2.5-3.3,2.5-6.9c0-3-0.9-5.1-2.5-6.4C40.5,4.5,38.6,3.9,35.8,3.9z M35.9,18.4c-0.4,0-0.9,0-1.2-0.1V6.5
|
||||
c0.4-0.1,0.9-0.1,1.5-0.1c3,0,4.9,1.9,4.9,5.7C41.1,16.5,39,18.4,35.9,18.4z"/>
|
||||
<path class="Black" d="M51.7,8.4c-3.6,0-5.6,3-5.6,6.5c0,3.8,2.1,6.2,5.9,6.2c1.5,0,2.9-0.3,3.9-0.7l-0.5-2.2
|
||||
c-0.8,0.3-1.8,0.5-3,0.5c-1.8,0-3.2-0.8-3.3-2.9h7.3c0.1-0.3,0.1-0.8,0.1-1.3C56.5,10.5,54.6,8.4,51.7,8.4z M49.2,13.5
|
||||
c0.1-1.2,0.7-2.8,2.3-2.8c1.6,0,2.1,1.6,2.1,2.8H49.2z"/>
|
||||
<path class="Black" d="M65.6,8.6l-1.5,5.9c-0.3,1.1-0.5,2.1-0.7,3.1h-0.1c-0.2-1-0.4-2.1-0.7-3.1L61,8.6h-3.5l4.1,12.2h3.1
|
||||
l4.2-12.2H65.6z"/>
|
||||
<path class="Black" d="M1.7,19.7c-0.6,0.8-1.1,1.4-1.4,2.1C0.2,22,0,22.4,0,22.7v0.4c0,0.8,0.6,1.4,1.4,1.4h21.3
|
||||
c0.8,0,1.4-0.6,1.4-1.4V6.8C12.4,8.9,5.3,15.2,1.7,19.7z"/>
|
||||
<polygon class="Black" points="74.1,13.4 79.6,13.4 79.6,10.8 74.1,10.8 74.1,6.7 79.9,6.7 79.9,4 70.8,4 70.8,20.8 80.2,20.8
|
||||
80.2,18.1 74.1,18.1 "/>
|
||||
<path class="Black" d="M92.5,8.6H89l-1.1,2.2c-0.3,0.6-0.6,1.3-0.9,1.9h0c-0.3-0.6-0.6-1.2-0.9-1.9l-1.2-2.2h-3.6l3.6,6l-3.7,6.2
|
||||
h3.5l1.1-2.4c0.3-0.6,0.6-1.3,0.9-1.9h0c0.3,0.7,0.6,1.3,0.9,1.9l1.2,2.4h3.6l-3.7-6.3L92.5,8.6z"/>
|
||||
<path class="Black" d="M100.7,8.4c-1.6,0-2.8,0.7-3.6,1.9h0l-0.2-1.7h-2.8c0,1.1,0.1,2.4,0.1,4v13.1h3.2v-6.1h0
|
||||
c0.5,0.8,1.6,1.4,2.9,1.4c2.5,0,5-2,5-6.5C105.3,10.9,103.4,8.4,100.7,8.4z M99.6,18.5c-1.1,0-2.2-0.9-2.2-2.6v-2.3
|
||||
c0-1.5,1-2.6,2.2-2.6c1.6,0,2.4,1.6,2.4,3.7C102.1,16.9,101.2,18.5,99.6,18.5z"/>
|
||||
<path class="Black" d="M110.5,10.8L110.5,10.8l-0.2-2.1h-2.8c0,1.1,0.1,2.3,0.1,3.8v8.4h3.2v-6.3c0-2.1,1.1-3.1,2.6-3.1
|
||||
c0.3,0,0.6,0,0.8,0.1V8.5c-0.2,0-0.4-0.1-0.7-0.1C112.4,8.4,111.1,9.2,110.5,10.8z"/>
|
||||
<path class="Black" d="M121,8.4c-3.6,0-5.6,3-5.6,6.5c0,3.8,2.1,6.2,5.9,6.2c1.5,0,2.9-0.3,3.9-0.7l-0.5-2.2
|
||||
c-0.8,0.3-1.8,0.5-3,0.5c-1.8,0-3.2-0.8-3.3-2.9h7.3c0.1-0.3,0.1-0.8,0.1-1.3C125.9,10.5,124,8.4,121,8.4z M118.5,13.5
|
||||
c0.1-1.2,0.7-2.8,2.3-2.8c1.6,0,2.1,1.6,2.1,2.8H118.5z"/>
|
||||
<path class="Black" d="M132.6,13.5c-1.4-0.6-1.9-0.9-1.9-1.6c0-0.7,0.5-1.2,1.5-1.2c0.9,0,1.8,0.3,2.3,0.6l0.6-2.3
|
||||
c-0.7-0.4-1.8-0.7-3-0.7c-2.7,0-4.5,1.7-4.5,3.9c0,1.3,0.8,2.6,3.1,3.5c1.3,0.6,1.8,1,1.8,1.7c0,0.7-0.5,1.2-1.7,1.2
|
||||
c-1,0-2.2-0.4-2.8-0.8l-0.6,2.3c0.8,0.5,2.1,0.8,3.4,0.8c3,0,4.8-1.5,4.8-3.9C135.7,15.5,134.7,14.3,132.6,13.5z"/>
|
||||
<path class="Black" d="M142.3,13.5c-1.4-0.6-1.9-0.9-1.9-1.6c0-0.7,0.5-1.2,1.5-1.2c0.9,0,1.8,0.3,2.3,0.6l0.6-2.3
|
||||
c-0.7-0.4-1.8-0.7-3-0.7c-2.7,0-4.5,1.7-4.5,3.9c0,1.3,0.8,2.6,3.1,3.5c1.3,0.6,1.8,1,1.8,1.7c0,0.7-0.5,1.2-1.7,1.2
|
||||
c-1,0-2.2-0.4-2.8-0.8l-0.6,2.3c0.8,0.5,2.1,0.8,3.4,0.8c3,0,4.8-1.5,4.8-3.9C145.4,15.5,144.4,14.3,142.3,13.5z"/>
|
||||
<path class="Black" d="M22.6,0.5H1.4C0.6,0.5,0,1.2,0,1.9v12.7c4.2-4.4,11.7-9.3,23.1-10.6c0.3,0,0.9-0.2,0.9-1V1.9
|
||||
C24,1.2,23.4,0.5,22.6,0.5z"/>
|
||||
<path class="Black" d="M148.5,7.9L148.5,7.9c0.4-0.1,0.5-0.3,0.5-0.6c0-0.2-0.1-0.3-0.2-0.5c-0.1-0.1-0.4-0.2-0.6-0.2h-0.7v2.2h0.4
|
||||
V8h0.2c0.1,0,0.2,0.1,0.3,0.3l0.2,0.6h0.5l-0.3-0.6C148.7,8.1,148.6,8,148.5,7.9z M148.2,7.7h-0.3V7.1h0.3c0.3,0,0.4,0.1,0.4,0.3
|
||||
c0,0.1,0,0.2-0.1,0.2C148.4,7.7,148.3,7.7,148.2,7.7z"/>
|
||||
<path class="Black" d="M149.5,6.6c-0.3-0.3-0.8-0.5-1.3-0.5c-0.5,0-1,0.2-1.3,0.5c-0.4,0.3-0.5,0.8-0.5,1.3c0,0.5,0.2,0.9,0.5,1.3
|
||||
c0.3,0.3,0.8,0.5,1.3,0.5c0.5,0,0.9-0.2,1.3-0.5c0.4-0.3,0.5-0.8,0.5-1.3C150,7.3,149.8,6.9,149.5,6.6z M149.3,8.9
|
||||
c-0.3,0.3-0.7,0.4-1.1,0.4c-0.4,0-0.8-0.1-1.1-0.4c-0.3-0.3-0.4-0.7-0.4-1.1c0-0.4,0.1-0.8,0.4-1.1c0.3-0.3,0.7-0.4,1.1-0.4
|
||||
c0.4,0,0.8,0.1,1.1,0.4c0.3,0.3,0.4,0.7,0.4,1.1C149.7,8.3,149.6,8.6,149.3,8.9z"/>
|
||||
<g class="st0">
|
||||
<path class="Black" d="M113.2,0.1c0.3,0,0.6-0.1,1.1-0.1c0.5,0,0.9,0.1,1.2,0.3c0.3,0.2,0.4,0.5,0.4,0.9c0,1.1-0.9,1.4-1.5,1.4
|
||||
c-0.1,0-0.2,0-0.2,0V4h-0.9V0.1z M114.1,1.9c0.1,0,0.1,0,0.2,0c0.4,0,0.6-0.3,0.6-0.6c0-0.4-0.2-0.6-0.6-0.6c-0.1,0-0.2,0-0.3,0
|
||||
V1.9z"/>
|
||||
<path class="Black" d="M119.6,2c0,1.4-0.7,2.1-1.7,2.1c-1.1,0-1.6-0.9-1.6-2c0-1.1,0.6-2,1.7-2C119.1,0,119.6,1,119.6,2z M117.2,2
|
||||
c0,0.8,0.3,1.3,0.7,1.3c0.5,0,0.7-0.5,0.7-1.3c0-0.7-0.2-1.3-0.7-1.3C117.4,0.7,117.2,1.3,117.2,2z"/>
|
||||
<path class="Black" d="M124.5,0.1l-0.9,4h-1l-0.3-1.4c-0.1-0.4-0.1-0.8-0.2-1.2h0c-0.1,0.5-0.1,0.9-0.2,1.3L121.7,4h-1l-0.8-4h1
|
||||
l0.2,1.5c0.1,0.5,0.1,1,0.2,1.4h0c0.1-0.5,0.2-0.9,0.2-1.4l0.3-1.5h0.9l0.3,1.6c0.1,0.5,0.1,0.9,0.2,1.4h0
|
||||
c0.1-0.5,0.1-0.9,0.2-1.4l0.2-1.5H124.5z"/>
|
||||
<path class="Black" d="M127.3,4h-2.2v-4h2.2v0.8H126v0.8h1.2v0.7H126v0.9h1.3V4z"/>
|
||||
<path class="Black" d="M130,2.2c0.3,0.1,0.4,0.4,0.5,0.7c0.1,0.4,0.2,1,0.3,1.1h-0.9c-0.1-0.1-0.2-0.5-0.2-0.9
|
||||
c-0.1-0.5-0.2-0.6-0.5-0.6h-0.2V4H128V0.1c0.3,0,0.7-0.1,1.1-0.1c0.5,0,1.6,0.1,1.6,1.1C130.6,1.6,130.3,2,130,2.2L130,2.2z
|
||||
M129.1,1.8c0.4,0,0.6-0.2,0.6-0.6c0-0.4-0.3-0.5-0.5-0.5c-0.1,0-0.2,0-0.3,0v1.1H129.1z"/>
|
||||
<path class="Black" d="M133.6,4h-2.2v-4h2.2v0.8h-1.3v0.8h1.2v0.7h-1.2v0.9h1.3V4z"/>
|
||||
<path class="Black" d="M134.3,0.1c0.3,0,0.6-0.1,1-0.1c0.7,0,1.1,0.1,1.4,0.4c0.4,0.3,0.6,0.8,0.6,1.5c0,0.8-0.3,1.4-0.6,1.6
|
||||
c-0.4,0.3-0.9,0.4-1.6,0.4c-0.4,0-0.7,0-0.9-0.1V0.1z M135.2,3.3c0.1,0,0.1,0,0.2,0c0.6,0,1-0.4,1-1.4c0-0.8-0.4-1.2-0.9-1.2
|
||||
c-0.1,0-0.2,0-0.3,0V3.3z"/>
|
||||
<path class="Black" d="M141.2,1.9c0.5,0.1,0.7,0.5,0.7,0.9c0,0.3-0.1,0.6-0.4,0.8c-0.3,0.2-0.7,0.4-1.5,0.4c-0.4,0-0.7,0-0.9-0.1
|
||||
V0.1c0.2,0,0.7-0.1,1.1-0.1c0.5,0,0.8,0.1,1.1,0.2c0.3,0.2,0.4,0.4,0.4,0.8C141.8,1.4,141.6,1.7,141.2,1.9L141.2,1.9z M140.3,1.6
|
||||
c0.4,0,0.6-0.2,0.6-0.5c0-0.3-0.2-0.5-0.5-0.5c-0.1,0-0.2,0-0.3,0v0.9H140.3z M140.1,3.4c0.1,0,0.1,0,0.3,0c0.3,0,0.6-0.2,0.6-0.5
|
||||
c0-0.4-0.3-0.5-0.7-0.5h-0.2V3.4z"/>
|
||||
<path class="Black" d="M145.4,0.1l-1.1,2.4V4h-0.9V2.5l-1.1-2.4h1l0.3,0.9c0.1,0.3,0.2,0.5,0.2,0.8h0c0.1-0.3,0.1-0.5,0.2-0.8
|
||||
l0.3-0.9H145.4z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.3 KiB |
9
StockMarketTraderApp/ImagesSvg/Down.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Red{fill:#D11C1C;}
|
||||
</style>
|
||||
<polygon class="Red" points="16,28 26,18 20,18 20,4 12,4 12,18 6,18 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 487 B |
12
StockMarketTraderApp/ImagesSvg/FibonacciArcs.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Blue{fill:#1177D7;}
|
||||
</style>
|
||||
<path class="Blue" d="M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M16,28C9.4,28,4,22.6,4,16C4,9.4,9.4,4,16,4
|
||||
s12,5.4,12,12C28,22.6,22.6,28,16,28z"/>
|
||||
<path class="Blue" d="M16,10c-3.3,0-6,2.7-6,6s2.7,6,6,6s6-2.7,6-6S19.3,10,16,10z M16,20c-2.2,0-4-1.8-4-4c0-2.2,1.8-4,4-4
|
||||
c2.2,0,4,1.8,4,4C20,18.2,18.2,20,16,20z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 752 B |
9
StockMarketTraderApp/ImagesSvg/FibonacciFans.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<polygon class="Black" points="28.2,16.6 9.1,24.3 21.8,11.6 20.2,10.4 7.8,22.7 13.7,5.3 12,4 4,28 30,18 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 525 B |
12
StockMarketTraderApp/ImagesSvg/FibonacciRetracement.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Green{fill:#039C23;}
|
||||
</style>
|
||||
<rect x="4" y="6" class="Green" width="24" height="2"/>
|
||||
<rect x="4" y="18" class="Green" width="24" height="2"/>
|
||||
<rect x="4" y="24" class="Green" width="24" height="2"/>
|
||||
<rect x="4" y="12" class="Green" width="24" height="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 647 B |
15
StockMarketTraderApp/ImagesSvg/Help.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.White{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="White" d="M16,2C8.3,2,2,8.3,2,16s6.3,14,14,14s14-6.3,14-14S23.7,2,16,2z M16,28C9.4,28,4,22.6,4,16C4,9.4,9.4,4,16,4
|
||||
s12,5.4,12,12C28,22.6,22.6,28,16,28z"/>
|
||||
<path class="White" d="M14.5,19.2c0-1,0.1-1.7,0.4-2.3c0.3-0.6,0.8-1.2,1.5-1.9c0.8-0.7,1.2-1.2,1.4-1.4c0.3-0.4,0.5-0.9,0.5-1.4
|
||||
c0-0.7-0.2-1.2-0.5-1.5c-0.4-0.4-0.9-0.5-1.6-0.5c-0.7,0-1.2,0.2-1.6,0.5c-0.4,0.3-0.6,0.8-0.6,1.4h-2.8c0-1.3,0.5-2.3,1.4-3
|
||||
C13.4,8.3,14.6,8,16.2,8c1.6,0,2.8,0.4,3.7,1.1c0.9,0.7,1.3,1.8,1.3,3.1c0,1.2-0.6,2.3-1.8,3.5l-1.4,1.3c-0.5,0.5-0.8,1.3-0.8,2.4
|
||||
H14.5z"/>
|
||||
<circle class="White" cx="16" cy="22.4" r="1.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
18
StockMarketTraderApp/ImagesSvg/Remove.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Red{fill:#D11C1C;}
|
||||
.Blue{fill:#1177D7;}
|
||||
</style>
|
||||
<path class="Red" d="M25.5,13.8l-8,8l-7.2-7.2l8-8c0.7-0.7,1.9-0.7,2.6,0l4.6,4.6C26.2,11.9,26.2,13,25.5,13.8z"/>
|
||||
<g>
|
||||
<g>
|
||||
<path class="Blue" d="M16.1,23.1l-7.2-7.2l-4.4,4.3c-0.7,0.7-0.7,1.9,0,2.6L7.6,26h5.5L16.1,23.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="Blue" d="M16.1,23.1l-7.2-7.2l-4.4,4.3c-0.7,0.7-0.7,1.9,0,2.6L7.6,26h5.5L16.1,23.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 791 B |
12
StockMarketTraderApp/ImagesSvg/Stock.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Red{fill:#D11C1C;}
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<polygon class="Red" points="6,2 6,6 2,6 2,8 6,8 6,20 8,20 8,2 "/>
|
||||
<polygon class="Black" points="16,24 16,12 14,12 14,30 16,30 16,26 20,26 20,24 "/>
|
||||
<polygon class="Red" points="24,14 24,6 22,6 22,20 24,20 24,16 28,16 28,14 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 670 B |
22
StockMarketTraderApp/ImagesSvg/Swatches.svg
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.White{fill:#FFFFFF;}
|
||||
.st0{opacity:0.5;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<rect x="2" y="2" class="White" width="8" height="8"/>
|
||||
</g>
|
||||
<rect x="12" y="2" class="White" width="8" height="8"/>
|
||||
<rect x="22" y="2" class="White" width="8" height="8"/>
|
||||
<rect x="2" y="12" class="White" width="8" height="8"/>
|
||||
<rect x="12" y="22" class="White" width="8" height="8"/>
|
||||
<g class="st0">
|
||||
<rect x="12" y="12" class="White" width="8" height="8"/>
|
||||
<rect x="22" y="12" class="White" width="8" height="8"/>
|
||||
<rect x="2" y="22" class="White" width="8" height="8"/>
|
||||
<rect x="22" y="22" class="White" width="8" height="8"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1004 B |
11
StockMarketTraderApp/ImagesSvg/TrendLine.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Red{fill:#D11C1C;}
|
||||
.Black{fill:#727272;}
|
||||
</style>
|
||||
<polygon class="Red" points="2,26 24,4 26,6 4,28 "/>
|
||||
<polygon class="Black" points="1.2,19.3 29.2,11.3 30,14 2,22 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 558 B |
9
StockMarketTraderApp/ImagesSvg/Up.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.Green{fill:#039C23;}
|
||||
</style>
|
||||
<polygon class="Green" points="16,4 6,14 12,14 12,28 20,28 20,14 26,14 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 492 B |
65
StockMarketTraderApp/Model/BusinessObjects.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using DevExpress.StockMarketTrader.StockDataServiceReference;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Model.BusinessObjects {
|
||||
public class TradingData {
|
||||
public DateTime Date { get; set; }
|
||||
public double Price { get; set; }
|
||||
public double Open { get; set; }
|
||||
public double Close { get; set; }
|
||||
public double High { get; set; }
|
||||
public double Low { get; set; }
|
||||
public double Volume { get; set; }
|
||||
|
||||
public TradingData() {
|
||||
}
|
||||
public TradingData(TradingData data) {
|
||||
Assign(data);
|
||||
}
|
||||
public void Assign(TradingData data) {
|
||||
Date = data.Date;
|
||||
Price = data.Price;
|
||||
Open = data.Open;
|
||||
Close = data.Close;
|
||||
High = data.High;
|
||||
Low = data.Low;
|
||||
Volume = data.Volume;
|
||||
}
|
||||
}
|
||||
|
||||
public class CompanyTradingData : TradingData {
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
public CompanyTradingData(TradingData data, string companyName) : base(data) {
|
||||
CompanyName = companyName;
|
||||
}
|
||||
public CompanyTradingData(StockData data, string companyName) {
|
||||
Date = data.Date;
|
||||
Close = (double)data.CloseP;
|
||||
Open = (double)data.OpenP;
|
||||
Price = (double)data.Price;
|
||||
High = (double)data.HighP;
|
||||
Low = (double)data.LowP;
|
||||
Volume = data.Volumne;
|
||||
CompanyName = companyName;
|
||||
}
|
||||
}
|
||||
|
||||
public class TransactionData {
|
||||
string transactionType;
|
||||
int volume;
|
||||
double price;
|
||||
|
||||
public int Ask { get { return transactionType == "Ask" ? volume : 0; } }
|
||||
public int Bid { get { return transactionType == "Bid" ? volume : 0; } }
|
||||
public int Volume { get { return volume; } set { volume = value; } }
|
||||
public double Price { get { return price; } set { price = value; } }
|
||||
public string TransactionType { get { return transactionType; } }
|
||||
|
||||
public TransactionData(string transactionType, int volume, double price) {
|
||||
this.volume = volume;
|
||||
this.price = price;
|
||||
this.transactionType = transactionType;
|
||||
}
|
||||
}
|
||||
}
|
||||
121
StockMarketTraderApp/Model/Executor.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Model {
|
||||
public enum ActionPriority {
|
||||
Normal,
|
||||
High,
|
||||
Blocked
|
||||
}
|
||||
|
||||
public enum ExecutorStatus {
|
||||
Enabled,
|
||||
Disabled,
|
||||
Offline
|
||||
}
|
||||
|
||||
public class UserStateParams {
|
||||
public Delegate Callback { get; private set; }
|
||||
public int ActionID { get; set; }
|
||||
|
||||
public UserStateParams(Delegate callback, int actionID) {
|
||||
if(callback != null)
|
||||
Callback = callback;
|
||||
ActionID = actionID;
|
||||
}
|
||||
}
|
||||
|
||||
public class ExecutorAction {
|
||||
readonly Delegate method;
|
||||
readonly ActionPriority priority;
|
||||
readonly object[] args;
|
||||
|
||||
public object[] Args { get { return args; } }
|
||||
public Delegate Method { get { return method; } }
|
||||
public ActionPriority Priority { get { return priority; } }
|
||||
|
||||
public ExecutorAction(Delegate method, ActionPriority priority, object[] args) {
|
||||
this.method = method;
|
||||
this.priority = priority;
|
||||
this.args = args;
|
||||
}
|
||||
}
|
||||
|
||||
public class Executor {
|
||||
readonly Stack<ExecutorAction> actions;
|
||||
readonly NetworkMonitor networkMonitor;
|
||||
ExecutorAction currentAction;
|
||||
ExecutorStatus status = ExecutorStatus.Disabled;
|
||||
int userID = 0, executingActions = 0;
|
||||
|
||||
public event EventHandler ExecuteFailed;
|
||||
|
||||
public int UserID { get { return userID; } }
|
||||
public int ExecutingActions { get { return executingActions; } }
|
||||
public ExecutorStatus Status {
|
||||
get { return status; }
|
||||
set {
|
||||
status = value;
|
||||
if (value == ExecutorStatus.Enabled)
|
||||
TryExecute(false);
|
||||
if (value == ExecutorStatus.Disabled && currentAction != null)
|
||||
actions.Push(currentAction);
|
||||
}
|
||||
}
|
||||
|
||||
public Executor(NetworkMonitor networkMonitor) {
|
||||
this.networkMonitor = networkMonitor;
|
||||
actions = new Stack<ExecutorAction>();
|
||||
}
|
||||
bool CanExecuteByNetwork() {
|
||||
bool isAvaliable = networkMonitor.IsInternetAvaliable;
|
||||
return isAvaliable || (!isAvaliable && status == ExecutorStatus.Offline);
|
||||
}
|
||||
void RaiseExecuteFailed() {
|
||||
ExecuteFailed(this, EventArgs.Empty);
|
||||
}
|
||||
void TryExecute(bool isForceExecute) {
|
||||
if (CanExecuteByNetwork() && actions.Count != 0 && (status != ExecutorStatus.Disabled && (actions.Peek().Priority != ActionPriority.Blocked || isForceExecute))) {
|
||||
currentAction = actions.Pop();
|
||||
BeginExecute(currentAction);
|
||||
}
|
||||
}
|
||||
void BeginExecute(ExecutorAction action) {
|
||||
try {
|
||||
executingActions++;
|
||||
action.Method.DynamicInvoke(action.Args);
|
||||
}
|
||||
catch {
|
||||
RaiseExecuteFailed();
|
||||
}
|
||||
}
|
||||
void Completed(object sender, EventArgs e) {
|
||||
ExecuteCompleted();
|
||||
}
|
||||
public void AddAction(ExecutorAction action) {
|
||||
actions.Push(action);
|
||||
TryExecute(false);
|
||||
}
|
||||
public void ExecuteCompleted() {
|
||||
TryExecute(false);
|
||||
}
|
||||
public void ChangeUserID() {
|
||||
actions.Clear();
|
||||
userID++;
|
||||
}
|
||||
public void ForceExecute() {
|
||||
TryExecute(true);
|
||||
}
|
||||
public void EndExecute(IAsyncResult result) {
|
||||
try {
|
||||
executingActions--;
|
||||
UserStateParams state = result.AsyncState as UserStateParams;
|
||||
if (state.ActionID == userID && state.Callback != null && status != ExecutorStatus.Disabled && CanExecuteByNetwork())
|
||||
state.Callback.DynamicInvoke(new object[] { result });
|
||||
}
|
||||
catch {
|
||||
RaiseExecuteFailed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
46
StockMarketTraderApp/Model/NetWorkMonitor.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Model {
|
||||
public class NetworkMonitor {
|
||||
const string serverName = "google.com";
|
||||
|
||||
readonly Timer timer;
|
||||
readonly Ping ping;
|
||||
bool isInit = false;
|
||||
|
||||
public event EventHandler<EventArgs> InternetAvaliableChanged;
|
||||
|
||||
public bool IsInternetAvaliable { get; private set; }
|
||||
|
||||
public NetworkMonitor() {
|
||||
ping = new Ping();
|
||||
ping.PingCompleted += PingCompleted;
|
||||
timer = new Timer() { Interval = 1 };
|
||||
timer.Tick += OnTimerTick;
|
||||
timer.Start();
|
||||
}
|
||||
void OnTimerTick(object sender, EventArgs e) {
|
||||
timer.Stop();
|
||||
ping.SendAsync(serverName, null);
|
||||
}
|
||||
void PingCompleted(object sender, PingCompletedEventArgs e) {
|
||||
bool isAvaliable = e.Reply == null || e.Reply.Status != IPStatus.Success ? false : true;
|
||||
if (isAvaliable != IsInternetAvaliable) {
|
||||
isInit = true;
|
||||
IsInternetAvaliable = isAvaliable;
|
||||
RaiseInternetAvaliableChanged();
|
||||
}
|
||||
else if (!isInit) {
|
||||
isInit = true;
|
||||
RaiseInternetAvaliableChanged();
|
||||
}
|
||||
//timer.Start();
|
||||
}
|
||||
void RaiseInternetAvaliableChanged() {
|
||||
if (InternetAvaliableChanged != null)
|
||||
InternetAvaliableChanged(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
209
StockMarketTraderApp/Model/RealTimeDataModel.cs
Normal file
@@ -0,0 +1,209 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DevExpress.StockMarketTrader.Model.BusinessObjects;
|
||||
using DevExpress.StockMarketTrader.Model.Offline;
|
||||
using DevExpress.StockMarketTrader.StockDataServiceReference;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Model {
|
||||
public class PriceAscedingComparer : IComparer<TransactionData> {
|
||||
public int Compare(TransactionData x, TransactionData y) {
|
||||
if (x == null || y == null)
|
||||
return 0;
|
||||
if (x.Price == y.Price) {
|
||||
if (y.Bid == 0 && x.Ask == 0)
|
||||
return -1;
|
||||
else return 1;
|
||||
}
|
||||
if (x.Price < y.Price)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public class RealTimeDataEventArgs : EventArgs {
|
||||
public bool CanNewUpdate { get; set; }
|
||||
public string Key { get; set; }
|
||||
public string ExceptionMessage { get; set; }
|
||||
public object Data { get; set; }
|
||||
|
||||
public RealTimeDataEventArgs(object data, string key, bool canNewUpdate) {
|
||||
Data = data;
|
||||
Key = key;
|
||||
CanNewUpdate = canNewUpdate;
|
||||
}
|
||||
public RealTimeDataEventArgs(string message) {
|
||||
ExceptionMessage = message;
|
||||
}
|
||||
}
|
||||
|
||||
public class RealTimeDataModel {
|
||||
const string RemoteServerUnavailableMessage = "The remote server is not responding. Check your internet connection.";
|
||||
|
||||
readonly Executor executor;
|
||||
readonly NetworkMonitor networkMonitor;
|
||||
readonly Random rand;
|
||||
readonly List<TransactionData> transactions;
|
||||
readonly IComparer<TransactionData> comparer;
|
||||
bool isInitialized = false;
|
||||
StockDataOfflineService offlineService;
|
||||
|
||||
public event EventHandler<RealTimeDataEventArgs> UpdateFailed;
|
||||
public event EventHandler<EventArgs> Initialized;
|
||||
|
||||
public IStockDataService Service { get; set; }
|
||||
public bool IsOnline { get { return networkMonitor.IsInternetAvaliable; } }
|
||||
public int CurrentPriceIndex { get; private set; }
|
||||
public string NetworkState { get { return IsOnline ? "Connected" : "Offline"; } }
|
||||
|
||||
public RealTimeDataModel() {
|
||||
networkMonitor = new NetworkMonitor();
|
||||
networkMonitor.InternetAvaliableChanged += OnInternetAvaliableChanged;
|
||||
executor = new Executor(networkMonitor);
|
||||
executor.ExecuteFailed += new EventHandler(OnExecuteFailed);
|
||||
transactions = new List<TransactionData>();
|
||||
comparer = new PriceAscedingComparer();
|
||||
rand = new Random();
|
||||
}
|
||||
void OnInternetAvaliableChanged(object sender, EventArgs e) {
|
||||
executor.Status = networkMonitor.IsInternetAvaliable == true ? ExecutorStatus.Enabled : ExecutorStatus.Offline;
|
||||
if (!isInitialized)
|
||||
InitServer();
|
||||
else
|
||||
{
|
||||
ChangeUserState();
|
||||
UpdateService();
|
||||
}
|
||||
}
|
||||
void RaiseInitialized() {
|
||||
if (this.Initialized != null)
|
||||
this.Initialized(this, EventArgs.Empty);
|
||||
}
|
||||
void RaiseUpdateFailed() {
|
||||
Service = CreateOfflineService();
|
||||
UpdateFailed(this, new RealTimeDataEventArgs(RemoteServerUnavailableMessage));
|
||||
}
|
||||
void OnExecuteFailed(object sender, EventArgs e) {
|
||||
RaiseUpdateFailed();
|
||||
}
|
||||
public void InitServer() {
|
||||
try {
|
||||
isInitialized = true;
|
||||
UpdateService();
|
||||
RaiseInitialized();
|
||||
}
|
||||
catch {
|
||||
RaiseUpdateFailed();
|
||||
}
|
||||
}
|
||||
public void UpdateService() {
|
||||
Service = CreateOfflineService();
|
||||
}
|
||||
void CorrectTransactionData() {
|
||||
if (transactions.Count > 30) {
|
||||
int transactionsCount = 0;
|
||||
if (CurrentPriceIndex > 0)
|
||||
transactionsCount = transactions.Count - CurrentPriceIndex;
|
||||
bool isDominating = transactionsCount > (transactions.Count - transactionsCount) ? true : false;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
CurrentPriceIndex--;
|
||||
if (isDominating)
|
||||
transactions.RemoveAt(0);
|
||||
else
|
||||
transactions.RemoveAt(transactions.Count - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
void CorrectOnOneTransactionTypeExists() {
|
||||
if (CurrentPriceIndex == -1 && transactions.Count != 0) {
|
||||
int lastIndex = transactions.Count - 1;
|
||||
string transantionType = transactions[0].Bid == 0 ? "Bid" : "Ask";
|
||||
int volume = transactions[lastIndex].Volume + 5;
|
||||
double price;
|
||||
if (comparer.GetType() == typeof(PriceAscedingComparer))
|
||||
price = IsDownMoving(transantionType) ? transactions[lastIndex].Price + 0.5 : transactions[0].Price - 0.5;
|
||||
else
|
||||
price = IsDownMoving(transantionType) ? transactions[lastIndex].Price - 0.5 : transactions[0].Price + 0.5;
|
||||
TransactionData tdvm = new TransactionData(transantionType, volume, price);
|
||||
transactions.Add(tdvm);
|
||||
CurrentPriceIndex = transactions.IndexOf(tdvm);
|
||||
}
|
||||
}
|
||||
void CheckTransactions(int currentIndex, double price, string trantctionType) {
|
||||
bool isDownMoving = IsDownMoving(trantctionType);
|
||||
int index = isDownMoving ? 1 : -1;
|
||||
int i = currentIndex + index;
|
||||
while ((i < transactions.Count && i > -1) && transactions[i].TransactionType != transactions[currentIndex].TransactionType) {
|
||||
int delta = transactions[currentIndex].Volume - transactions[i].Volume;
|
||||
if (delta == 0) {
|
||||
if (isDownMoving) {
|
||||
transactions.Remove(transactions[i]);
|
||||
transactions.Remove(transactions[currentIndex]);
|
||||
}
|
||||
else {
|
||||
transactions.Remove(transactions[currentIndex]);
|
||||
transactions.Remove(transactions[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (delta < 0) {
|
||||
transactions[i].Volume = -delta;
|
||||
transactions.Remove(transactions[currentIndex]);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
transactions[currentIndex].Volume = delta;
|
||||
transactions.Remove(transactions[i]);
|
||||
if (!isDownMoving) { currentIndex--; i--; }
|
||||
}
|
||||
}
|
||||
}
|
||||
void AddNewTransaction(double currentPrice, string transactionType) {
|
||||
int maxVolumeValue = 100;
|
||||
double price = GetNewTransactionPrice(currentPrice);
|
||||
int volume = 1 + rand.Next(maxVolumeValue);
|
||||
TransactionData currentTransaction = new TransactionData(transactionType, volume, price);
|
||||
transactions.Add(currentTransaction);
|
||||
transactions.Sort(comparer);
|
||||
CheckTransactions(transactions.IndexOf(currentTransaction), price, transactionType);
|
||||
}
|
||||
int FindNewCurrentPriceIndex() {
|
||||
for (int i = 0; i < transactions.Count; i++) {
|
||||
if (i < transactions.Count - 1 && transactions[i].TransactionType != transactions[i + 1].TransactionType)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
bool IsDownMoving(string trantctionType) {
|
||||
Type type = comparer.GetType();
|
||||
return type == typeof(PriceAscedingComparer) && trantctionType == "Bid";
|
||||
}
|
||||
double GetNewTransactionPrice(double currentPrice) {
|
||||
double factor = currentPrice * 0.1 * rand.NextDouble();
|
||||
factor = rand.NextDouble() > 0.5 ? factor : -factor;
|
||||
double price = currentPrice + factor;
|
||||
return Math.Round(price, 2);
|
||||
}
|
||||
IStockDataService CreateOfflineService() {
|
||||
return offlineService ?? (offlineService = new StockDataOfflineService());
|
||||
}
|
||||
public void ChangeUserState() {
|
||||
executor.ChangeUserID();
|
||||
}
|
||||
public void ClearTransactions() {
|
||||
transactions.Clear();
|
||||
}
|
||||
public List<TransactionData> GetTransactions(double currentPrice) {
|
||||
int maxTransactionCount = 3;
|
||||
int numOfTransactions = 1 + rand.Next(maxTransactionCount);
|
||||
for(int i = 0; i < numOfTransactions; i++) {
|
||||
AddNewTransaction(currentPrice, "Bid");
|
||||
AddNewTransaction(currentPrice, "Ask");
|
||||
}
|
||||
CurrentPriceIndex = FindNewCurrentPriceIndex();
|
||||
CorrectTransactionData();
|
||||
CorrectOnOneTransactionTypeExists();
|
||||
return transactions;
|
||||
}
|
||||
}
|
||||
}
|
||||
417
StockMarketTraderApp/Model/StockDataOfflineProvider.cs
Normal file
@@ -0,0 +1,417 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.ServiceModel;
|
||||
using System.Xml;
|
||||
using DevExpress.StockMarketTrader.StockDataServiceReference;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Model.Offline {
|
||||
public class Company {
|
||||
public int ID { get; set; }
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
public Company() {
|
||||
}
|
||||
}
|
||||
|
||||
public class OfflineStockData {
|
||||
public double CloseP { get; set; }
|
||||
public double HighP { get; set; }
|
||||
public double LowP { get; set; }
|
||||
public double OpenP { get; set; }
|
||||
public double Price { get; set; }
|
||||
public int CompanyID { get; set; }
|
||||
public int Volume { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public OfflineStockData() {
|
||||
}
|
||||
}
|
||||
|
||||
public class XmlStockDataProvider {
|
||||
const string companiesPath = "DevExpress.StockMarketTrader.Data.Companies.xml";
|
||||
const string dataPath = "DevExpress.StockMarketTrader.Data.StockData.xml";
|
||||
|
||||
static List<Company> companies;
|
||||
static List<OfflineStockData> stockData;
|
||||
|
||||
static XmlStockDataProvider() {
|
||||
PopulateCompanies();
|
||||
PopulateStockData();
|
||||
}
|
||||
static void PopulateStockData() {
|
||||
Stream stream = GetResourceStream(dataPath);
|
||||
if (stream != null) {
|
||||
stockData = new List<OfflineStockData>();
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(stream);
|
||||
var nodes = doc.LastChild.SelectNodes("//StockData");
|
||||
foreach (XmlNode node in nodes) {
|
||||
var data = new OfflineStockData() {
|
||||
CompanyID = Int32.Parse(node.Attributes["Name"].Value),
|
||||
Date = DateTime.Parse(node.Attributes["Date"].Value, CultureInfo.InvariantCulture),
|
||||
Price = Double.Parse(node.Attributes["Price"].Value, CultureInfo.InvariantCulture),
|
||||
OpenP = Double.Parse(node.Attributes["Open"].Value, CultureInfo.InvariantCulture),
|
||||
CloseP = Double.Parse(node.Attributes["Close"].Value, CultureInfo.InvariantCulture),
|
||||
HighP = Double.Parse(node.Attributes["High"].Value, CultureInfo.InvariantCulture),
|
||||
LowP = Double.Parse(node.Attributes["Low"].Value, CultureInfo.InvariantCulture),
|
||||
Volume = int.Parse(node.Attributes["Volume"].Value, CultureInfo.InvariantCulture),
|
||||
};
|
||||
stockData.Add(data);
|
||||
}
|
||||
}
|
||||
stream.Close();
|
||||
}
|
||||
static void PopulateCompanies() {
|
||||
Stream stream = GetResourceStream(companiesPath);
|
||||
if (stream != null) {
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(stream);
|
||||
var nodes = doc.LastChild.SelectNodes("//Company");
|
||||
companies = new List<Company>();
|
||||
foreach (XmlNode node in nodes) {
|
||||
companies.Add(new Company() { ID = Int32.Parse(node.Attributes["Id"].Value), CompanyName = node.Attributes["Name"].Value });
|
||||
}
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
}
|
||||
static Stream GetResourceStream(string path) {
|
||||
return Assembly.GetExecutingAssembly().GetManifestResourceStream(path);
|
||||
}
|
||||
|
||||
public List<Company> Companies { get { return companies; } }
|
||||
public List<OfflineStockData> StockData { get { return stockData; } }
|
||||
}
|
||||
|
||||
public class StockDataOfflineService :/* ClientBase<IStockDataService>,*/ IStockDataService {
|
||||
static DateTime[] dates;
|
||||
|
||||
readonly XmlStockDataProvider dataProvider;
|
||||
readonly Dictionary<IAsyncResult, Delegate> executions;
|
||||
readonly List<string> sem = new List<string>();
|
||||
|
||||
public StockDataOfflineService() {
|
||||
dataProvider = new XmlStockDataProvider();
|
||||
executions = new Dictionary<IAsyncResult, Delegate>();
|
||||
}
|
||||
#region IStockDataService Members
|
||||
string IStockDataService.Test() {
|
||||
return string.Empty;
|
||||
}
|
||||
void IStockDataService.Initialize() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
void StockDataServiceReference.IStockDataService.EndInitialize(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
int[] IStockDataService.GetTopRatedCompanyIDs(DateTime date) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
int[] IStockDataService.EndGetTopRatedCompanyIDs(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
double IStockDataService.GetHighestPrice(string companyName, DateTime start, DateTime end) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
double IStockDataService.EndGetHighestPrice(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
double IStockDataService.GetLowestPrice(string companyName, DateTime start, DateTime end) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
double IStockDataService.EndGetLowestPrice(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
string IStockDataService.EndTest(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
StockData[] IStockDataService.GetAllPeriodData(string companyName) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
StockData[] IStockDataService.EndGetCompanyStockDataSL(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
StockData[] IStockDataService.EndGetAllPeriodData(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
StockData[] IStockDataService.GetCompanyStockDataSL(DateTime newDate, DateTime oldDate, string companyName) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginInitialize(AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginTest(AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginGetAllPeriodData(string companyName, AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginGetCompanyStockDataSL(DateTime newDate, DateTime oldDate, string companyName, AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginGetHighestPrice(string companyName, DateTime start, DateTime end, AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginGetLowestPrice(string companyName, DateTime start, DateTime end, AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginGetTopRatedCompanyIDs(DateTime date, AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginGetTopRatedCompaniesDataSL(DateTime start, DateTime end, string selectedCompany, AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
IAsyncResult IStockDataService.BeginGetCompanyData(DateTime newDate, DateTime oldDate, string companyName, AsyncCallback callback, object asyncState) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
CompanyData IStockDataService.GetCompanyData(DateTime newDate, DateTime oldDate, string companyName) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
CompanyData IStockDataService.EndGetCompanyData(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
TopRatedCompanyData[] IStockDataService.GetTopRatedCompaniesDataSL(DateTime start, DateTime end, string selectedCompany) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
TopRatedCompanyData[] IStockDataService.EndGetTopRatedCompaniesDataSL(IAsyncResult result) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
void AddExecution(Delegate d, IAsyncResult result) {
|
||||
executions.Add(result, d);
|
||||
}
|
||||
void RemoveExecution(IAsyncResult result) {
|
||||
executions.Remove(result);
|
||||
}
|
||||
string GetCompanyNameByID(int id) {
|
||||
lock (sem) {
|
||||
return GetCompanies().Where(e => e.ID == id).Select(e => e.CompanyName).ToArray()[0];
|
||||
}
|
||||
}
|
||||
double GetHighLowPriceBetweenDates(OfflineStockData[] data, DateTime start, DateTime end, string companyName, bool isMax) {
|
||||
int id = GetCompanyID(companyName);
|
||||
if (isMax)
|
||||
return (double)data.Where(e => e.Date >= start && e.Date <= end && e.CompanyID == id).Select(e => e.HighP).Max();
|
||||
else
|
||||
return (double)data.Where(e => e.Date >= start && e.Date <= end && e.CompanyID == id).Select(e => e.LowP).Min();
|
||||
}
|
||||
int GetCompanyID(string companyName) {
|
||||
lock (sem) {
|
||||
return GetCompanies().Where(e => e.CompanyName == companyName).Select(e => e.ID).ToList().FirstOrDefault();
|
||||
}
|
||||
}
|
||||
int[] GetTopRatedCompanyIDs(DateTime date) {
|
||||
IOrderedEnumerable<OfflineStockData> data = GetStockDataByDate2(date).OrderByDescending((e => e.Volume));
|
||||
int[] ids = data.Select(e => e.CompanyID).ToArray();
|
||||
int[] result = new int[ids.Length];
|
||||
for (int i = 0; i < result.Length; i++) {
|
||||
result[i] = ids[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Delegate GetExecution(IAsyncResult result) {
|
||||
return executions[result];
|
||||
}
|
||||
StockData GetServiceStockData(OfflineStockData data) {
|
||||
return new StockData() {
|
||||
CompanyID = data.CompanyID,
|
||||
Date = data.Date,
|
||||
Price = Convert.ToDecimal(data.Price),
|
||||
OpenP = Convert.ToDecimal(data.OpenP),
|
||||
CloseP = Convert.ToDecimal(data.CloseP),
|
||||
HighP = Convert.ToDecimal(data.HighP),
|
||||
LowP = Convert.ToDecimal(data.LowP),
|
||||
Volumne = data.Volume
|
||||
};
|
||||
}
|
||||
OfflineStockData[] GetMultipleCompanyStockData(List<DateTime> datesList, string companyName) {
|
||||
int id = GetCompanyID(companyName);
|
||||
return GetStockData().Where(e => e.CompanyID == id && datesList.Contains(e.Date)).Select(e => e).OrderBy(e => e.Date).ToArray();
|
||||
}
|
||||
OfflineStockData[] GetStockDataByDate2(DateTime currentDate) {
|
||||
List<OfflineStockData> data = GetStockData();
|
||||
OfflineStockData[] result = data.Where(e => e.Date == currentDate).OrderBy(e => e.CompanyID).ToArray();
|
||||
return result;
|
||||
}
|
||||
public string[] GetCompaniesName() {
|
||||
lock (sem) {
|
||||
return GetCompanies().Select(e => e.CompanyName).ToArray();
|
||||
}
|
||||
}
|
||||
public string[] EndGetCompaniesName(IAsyncResult result) {
|
||||
var endResult = ((Func<string[]>)GetExecution(result)).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endResult;
|
||||
}
|
||||
public IAsyncResult BeginGetCompanyMultipleDataFromPeriod(int currentDate, int count, int periodSize, string companyName, AsyncCallback callback, object asyncState) {
|
||||
Func<int, int, int, string, CompanyData[]> f = new Func<int, int, int, string, CompanyData[]>(GetCompanyMultipleDataFromPeriod);
|
||||
var result = f.BeginInvoke(currentDate, count, periodSize, companyName, callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public IAsyncResult BeginGetStockDataFromPeriodByCompanyList(int currentDate, int count, int periodSize, string[] companies, AsyncCallback callback, object asyncState) {
|
||||
Func<int, int, int, string[], CompanyStockData[]> f = new Func<int, int, int, string[], CompanyStockData[]>(GetStockDataFromPeriodByCompanyList);
|
||||
var result = f.BeginInvoke(currentDate, count, periodSize, companies, callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public IAsyncResult BeginGetStockDataFromDateByCompanyList(DateTime date, string[] companies, AsyncCallback callback, object asyncState) {
|
||||
Func<DateTime, string[], StockDataServiceReference.CompanyStockData[]> f = new Func<DateTime, string[], StockDataServiceReference.CompanyStockData[]>(GetStockDataFromDateByCompanyList);
|
||||
var result = f.BeginInvoke(date, companies, callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public IAsyncResult BeginGetDates(AsyncCallback callback, object asyncState) {
|
||||
Func<DateTime[]> f = new Func<DateTime[]>(GetDates);
|
||||
var result = f.BeginInvoke(callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public IAsyncResult BeginGetStockDataByDate(DateTime currentDate, AsyncCallback callback, object asyncState) {
|
||||
Func<DateTime, StockData[]> f = new Func<DateTime, StockData[]>(GetStockDataByDate);
|
||||
var result = f.BeginInvoke(currentDate, callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public IAsyncResult BeginGetCompaniesName(AsyncCallback callback, object asyncState) {
|
||||
Func<string[]> f = new Func<string[]>(GetCompaniesName);
|
||||
var result = f.BeginInvoke(callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public IAsyncResult BeginGetCompanyStockData(DateTime date, string companyName, AsyncCallback callback, object asyncState) {
|
||||
Func<DateTime, string, StockData[]> f = new Func<DateTime, string, StockData[]>(GetCompanyStockData);
|
||||
var result = f.BeginInvoke(date, companyName, callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public IAsyncResult BeginGetCompaniesVolumeFromPeriod(DateTime start, DateTime end, AsyncCallback callback, object asyncState) {
|
||||
Func<DateTime, DateTime, CompaniesVolumeData[]> f = new Func<DateTime, DateTime, CompaniesVolumeData[]>(GetCompaniesVolumeFromPeriod);
|
||||
var result = f.BeginInvoke(start, end, callback, asyncState);
|
||||
AddExecution(f, result);
|
||||
return result;
|
||||
}
|
||||
public CompanyData[] GetCompanyMultipleDataFromPeriod(int currentDate, int count, int periodSize, string companyName) {
|
||||
lock (sem) {
|
||||
List<DateTime> datesList = new List<DateTime>();
|
||||
int dateCount = currentDate;
|
||||
for (int i = 0; i < (count + 1) * periodSize; i++) {
|
||||
if (dateCount < dates.Length) {
|
||||
datesList.Add(dates[dateCount]);
|
||||
dateCount++;
|
||||
}
|
||||
}
|
||||
OfflineStockData[] data = GetMultipleCompanyStockData(datesList, companyName);
|
||||
List<CompanyData> result = new List<CompanyData>();
|
||||
for (int i = 0; i < count; i++) {
|
||||
DateTime nextDate = datesList[(i + 1) * periodSize];
|
||||
double closePrice = (double)data[(i + 1) * periodSize].CloseP;
|
||||
double highPrice = GetHighLowPriceBetweenDates(data, dates[currentDate], dates[currentDate + periodSize], companyName, true);
|
||||
double lowPrice = GetHighLowPriceBetweenDates(data, dates[currentDate], dates[currentDate + periodSize], companyName, false);
|
||||
currentDate += periodSize;
|
||||
result.Add(new CompanyData() { Data = GetServiceStockData(data[i * periodSize]), HighPrice = highPrice, LowPrice = lowPrice, ClosePrice = closePrice });
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
public CompanyData[] EndGetCompanyMultipleDataFromPeriod(IAsyncResult result) {
|
||||
var endResult = ((Func<int, int, int, string, CompanyData[]>)GetExecution(result)).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endResult;
|
||||
}
|
||||
public CompanyStockData[] GetStockDataFromPeriodByCompanyList(int currentDate, int count, int periodSize, string[] companies) {
|
||||
lock(sem) {
|
||||
List<CompanyStockData> result = new List<CompanyStockData>();
|
||||
foreach (string company in companies)
|
||||
{
|
||||
var data = GetCompanyMultipleDataFromPeriod(currentDate, count, periodSize, company);
|
||||
if (data != null)
|
||||
result.Add(new CompanyStockData() { Data = data.Select(d => d.Data).ToArray(), CompanyName = company });
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
public CompanyStockData[] EndGetStockDataFromPeriodByCompanyList(IAsyncResult result) {
|
||||
var endResult = ((Func<int, int, int, string[], CompanyStockData[]>)GetExecution(result)).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endResult;
|
||||
}
|
||||
public CompanyStockData[] GetStockDataFromDateByCompanyList(DateTime date, string[] companies) {
|
||||
lock(sem) {
|
||||
List<CompanyStockData> result = new List<CompanyStockData>();
|
||||
foreach(string company in companies) {
|
||||
StockData[] data = ((IStockDataService)this).GetCompanyStockData(date, company);
|
||||
result.Add(new CompanyStockData() { Data = data, CompanyName = company });
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
public CompanyStockData[] EndGetStockDataFromDateByCompanyList(IAsyncResult result) {
|
||||
var endResult = ((Func<DateTime, string[], StockDataServiceReference.CompanyStockData[]>)GetExecution(result)).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endResult;
|
||||
}
|
||||
public List<Company> GetCompanies() {
|
||||
return dataProvider.Companies;
|
||||
}
|
||||
public List<OfflineStockData> GetStockData() {
|
||||
return dataProvider.StockData;
|
||||
}
|
||||
public DateTime[] GetDates() {
|
||||
if (dates == null || dates.Length == 0) {
|
||||
lock (sem) {
|
||||
dates = GetStockData().Select(e => e.Date).Distinct().OrderBy(e => e.Date).ToArray();
|
||||
}
|
||||
}
|
||||
return dates;
|
||||
}
|
||||
public DateTime[] EndGetDates(IAsyncResult result) {
|
||||
var endResult = ((Func<DateTime[]>)executions[result]).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endResult;
|
||||
}
|
||||
public StockData[] GetStockDataByDate(DateTime currentDate) {
|
||||
lock (sem) {
|
||||
StockData[] result = GetStockData().Where(e => e.Date == currentDate).OrderBy(e => e.CompanyID).Select(e => GetServiceStockData(e)).ToArray();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public StockData[] EndGetStockDataByDate(IAsyncResult result) {
|
||||
var endResult = ((Func<DateTime, StockData[]>)GetExecution(result)).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endResult;
|
||||
}
|
||||
public StockData[] GetCompanyStockData(DateTime date, string companyName) {
|
||||
lock (sem) {
|
||||
int id = GetCompanyID(companyName);
|
||||
return GetStockData().Where(e => e.CompanyID == id && e.Date == date).Select(e => GetServiceStockData(e)).ToArray();
|
||||
}
|
||||
}
|
||||
public StockData[] EndGetCompanyStockData(IAsyncResult result) {
|
||||
var endresult = ((Func<DateTime, string, StockData[]>)GetExecution(result)).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endresult;
|
||||
}
|
||||
public CompaniesVolumeData[] GetCompaniesVolumeFromPeriod(DateTime start, DateTime end) {
|
||||
lock (sem) {
|
||||
int[] topIds = GetTopRatedCompanyIDs(start);
|
||||
CompaniesVolumeData[] result = new CompaniesVolumeData[topIds.Length];
|
||||
for (int i = 0; i < topIds.Length; i++) {
|
||||
int volume = GetStockData().Where(e => e.Date >= start && e.CompanyID == topIds[i]).Select(e => e.Volume).ToArray()[0];
|
||||
CompaniesVolumeData data = new CompaniesVolumeData() { CompanyName = GetCompanyNameByID(topIds[i]), Volume = (int)volume };
|
||||
result[i] = data;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public CompaniesVolumeData[] EndGetCompaniesVolumeFromPeriod(IAsyncResult result) {
|
||||
var endResult = ((Func<DateTime, DateTime, CompaniesVolumeData[]>)GetExecution(result)).EndInvoke(result);
|
||||
RemoveExecution(result);
|
||||
return endResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
6
StockMarketTraderApp/NuGet.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositoryPath" value="..\" />
|
||||
</config>
|
||||
</configuration>
|
||||
28
StockMarketTraderApp/Program.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.LookAndFeel;
|
||||
using DevExpress.Skins;
|
||||
using System.Drawing;
|
||||
using DevExpress.XtraEditors;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
static class Program {
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main() {
|
||||
WindowsFormsSettings.ForceDirectXPaint();
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
|
||||
WindowsFormsSettings.SetDPIAware();
|
||||
DevExpress.Utils.AppearanceObject.DefaultFont = new Font("Segoe UI", 8.5F, FontStyle.Regular);
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
SkinManager.EnableFormSkins();
|
||||
UserLookAndFeel.Default.SetStyle(LookAndFeelStyle.Skin, false, false, "The Bezier");
|
||||
Application.Run(new StockMarketView());
|
||||
}
|
||||
}
|
||||
}
|
||||
46
StockMarketTraderApp/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("StockMarketTrader")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)]
|
||||
[assembly: AssemblyProduct("StockMarketTrader")]
|
||||
[assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion(AssemblyInfo.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfo.Version)]
|
||||
107
StockMarketTraderApp/SplashScreen1.Designer.cs
generated
Normal file
@@ -0,0 +1,107 @@
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
partial class SplashScreen1 {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.marqueeProgressBarControl1 = new DevExpress.XtraEditors.MarqueeProgressBarControl();
|
||||
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
|
||||
this.lblCaption = new DevExpress.XtraEditors.LabelControl();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.pictureBox2 = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.marqueeProgressBarControl1.Properties)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// marqueeProgressBarControl1
|
||||
//
|
||||
this.marqueeProgressBarControl1.EditValue = 0;
|
||||
this.marqueeProgressBarControl1.Location = new System.Drawing.Point(25, 100);
|
||||
this.marqueeProgressBarControl1.Name = "marqueeProgressBarControl1";
|
||||
this.marqueeProgressBarControl1.Size = new System.Drawing.Size(404, 12);
|
||||
this.marqueeProgressBarControl1.TabIndex = 5;
|
||||
//
|
||||
// labelControl1
|
||||
//
|
||||
this.labelControl1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.labelControl1.Location = new System.Drawing.Point(25, 145);
|
||||
this.labelControl1.Name = "labelControl1";
|
||||
this.labelControl1.Size = new System.Drawing.Size(91, 13);
|
||||
this.labelControl1.TabIndex = 6;
|
||||
this.labelControl1.Text = "Copyright © 1998-";
|
||||
//
|
||||
// lblCaption
|
||||
//
|
||||
this.lblCaption.Location = new System.Drawing.Point(25, 75);
|
||||
this.lblCaption.Name = "lblCaption";
|
||||
this.lblCaption.Size = new System.Drawing.Size(50, 13);
|
||||
this.lblCaption.TabIndex = 7;
|
||||
this.lblCaption.Text = "Starting...";
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(271, 136);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(158, 31);
|
||||
this.pictureBox1.TabIndex = 8;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// pictureBox2
|
||||
//
|
||||
this.pictureBox2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pictureBox2.Location = new System.Drawing.Point(87, 12);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.Size = new System.Drawing.Size(279, 61);
|
||||
this.pictureBox2.TabIndex = 9;
|
||||
this.pictureBox2.TabStop = false;
|
||||
//
|
||||
// SplashScreen1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(447, 189);
|
||||
this.Controls.Add(this.pictureBox2);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.lblCaption);
|
||||
this.Controls.Add(this.labelControl1);
|
||||
this.Controls.Add(this.marqueeProgressBarControl1);
|
||||
this.Name = "SplashScreen1";
|
||||
this.Text = "Form1";
|
||||
((System.ComponentModel.ISupportInitialize)(this.marqueeProgressBarControl1.Properties)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.MarqueeProgressBarControl marqueeProgressBarControl1;
|
||||
private DevExpress.XtraEditors.LabelControl labelControl1;
|
||||
private DevExpress.XtraEditors.LabelControl lblCaption;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.PictureBox pictureBox2;
|
||||
}
|
||||
}
|
||||
18
StockMarketTraderApp/SplashScreen1.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using DevExpress.Utils.Design;
|
||||
using DevExpress.Utils.Svg;
|
||||
using DevExpress.XtraSplashScreen;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public partial class SplashScreen1 : SplashScreen {
|
||||
public SplashScreen1() {
|
||||
InitializeComponent();
|
||||
labelControl1.Text += DateTime.Now.Year.ToString();
|
||||
ISvgPaletteProvider palette = SvgPaletteHelper.GetSvgPalette(this.TargetLookAndFeel.ActiveLookAndFeel, DevExpress.Utils.Drawing.ObjectState.Normal);
|
||||
SvgImage svg = SvgResources.GetSvgImage("DX Logo");
|
||||
pictureBox1.Image = new SvgBitmap(svg).Render(palette);
|
||||
svg = SvgResources.GetSvgImage("App Logo");
|
||||
pictureBox2.Image = new SvgBitmap(svg).Render(palette);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StockMarketTraderApp/SplashScreen1.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
107
StockMarketTraderApp/StockChart/AdvancedIndicatorsItems.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using DevExpress.XtraCharts;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public class MedianPriceItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Median Price"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new MedianPrice();
|
||||
}
|
||||
}
|
||||
|
||||
public class TypicalPriceItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Typical Price"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new TypicalPrice();
|
||||
}
|
||||
}
|
||||
|
||||
public class WeightedCloseItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Weighted Close"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new WeightedClose();
|
||||
}
|
||||
}
|
||||
|
||||
public class AverageTrueRangeItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Average True Range"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new AverageTrueRange();
|
||||
}
|
||||
}
|
||||
|
||||
public class CommodityChannelIndexItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Commodity Channel Index"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new CommodityChannelIndex();
|
||||
}
|
||||
}
|
||||
|
||||
public class DetrendedPriceOscillatorItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Detrended Price Oscillator"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new DetrendedPriceOscillator();
|
||||
}
|
||||
}
|
||||
|
||||
public class MassIndexItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Mass Index"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new MassIndex();
|
||||
}
|
||||
}
|
||||
|
||||
public class MovingAverageConvergenceDivergenceItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Moving Average Convergence Divergence"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new MovingAverageConvergenceDivergence();
|
||||
}
|
||||
}
|
||||
|
||||
public class RateOfChangeItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Rate Of Change"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new RateOfChange();
|
||||
}
|
||||
}
|
||||
|
||||
public class RelativeStrengthIndexItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Relative Strength Index"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new RelativeStrengthIndex();
|
||||
}
|
||||
}
|
||||
|
||||
public class StandardDeviationItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Standard Deviation"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new StandardDeviation();
|
||||
}
|
||||
}
|
||||
|
||||
public class ChaikinsVolatilityItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Chaikins Volatility"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new ChaikinsVolatility();
|
||||
}
|
||||
}
|
||||
|
||||
public class WilliamsRItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return "Williams %R"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new WilliamsR();
|
||||
}
|
||||
}
|
||||
}
|
||||
68
StockMarketTraderApp/StockChart/ChartHelper.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.Collections.Generic;
|
||||
using DevExpress.XtraCharts;
|
||||
using DevExpress.XtraCharts.Native;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public static class ChartHelper {
|
||||
static void InitializeNewPaneLegend(ChartControl chart, SeparatePaneIndicator indicator) {
|
||||
Legend legend = new Legend();
|
||||
chart.Legends.Add(legend);
|
||||
indicator.Legend = legend;
|
||||
legend.Tag = indicator.Tag;
|
||||
legend.DockTarget = indicator.Pane;
|
||||
legend.AlignmentHorizontal = LegendAlignmentHorizontal.Left;
|
||||
legend.Margins.All = chart.Legend.Margins.All;
|
||||
}
|
||||
static void UpdateAxisXVisibilityInPanes(XYDiagram diagram) {
|
||||
List<XYDiagramPaneBase> panes = diagram.GetAllPanes();
|
||||
for (int i = 0; i < panes.Count; i++)
|
||||
diagram.AxisX.SetVisibilityInPane(i == panes.Count - 1, panes[i]);
|
||||
}
|
||||
public static void InitializeSeparatePaneIndicator(ChartControl chart, SeparatePaneIndicator separatePaneIndicator) {
|
||||
XYDiagram diagram = chart.Diagram as XYDiagram;
|
||||
if (diagram != null) {
|
||||
XYDiagramPane pane = new XYDiagramPane(separatePaneIndicator.Name + " Pane");
|
||||
pane.Tag = separatePaneIndicator.Tag;
|
||||
diagram.Panes.Add(pane);
|
||||
SecondaryAxisY axisY = new SecondaryAxisY(separatePaneIndicator.Name + " Axis");
|
||||
axisY.Tag = separatePaneIndicator.Tag;
|
||||
axisY.Alignment = AxisAlignment.Far;
|
||||
axisY.GridLines.Visible = true;
|
||||
axisY.GridLines.MinorVisible = true;
|
||||
axisY.WholeRange.AlwaysShowZeroLevel = false;
|
||||
diagram.SecondaryAxesY.Add(axisY);
|
||||
separatePaneIndicator.Pane = pane;
|
||||
separatePaneIndicator.AxisY = axisY;
|
||||
InitializeNewPaneLegend(chart, separatePaneIndicator);
|
||||
UpdateAxisXVisibilityInPanes(diagram);
|
||||
}
|
||||
}
|
||||
public static void RemoveIndicator(ChartControl chart, XYDiagramSeriesViewBase view, Indicator indicator) {
|
||||
SeparatePaneIndicator separatePaneIndicator = indicator as SeparatePaneIndicator;
|
||||
if (separatePaneIndicator != null ) {
|
||||
foreach (Legend legend in chart.Legends) {
|
||||
if (legend.Tag == separatePaneIndicator.Tag) {
|
||||
chart.Legends.Remove(legend);
|
||||
break;
|
||||
}
|
||||
}
|
||||
XYDiagram diagram = chart.Diagram as XYDiagram;
|
||||
if (diagram != null) {
|
||||
foreach (XYDiagramPane pane in diagram.Panes) {
|
||||
if (pane.Tag == separatePaneIndicator.Tag) {
|
||||
diagram.Panes.Remove(pane);
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (SecondaryAxisY axisY in diagram.SecondaryAxesY) {
|
||||
if (axisY.Tag == separatePaneIndicator.Tag) {
|
||||
diagram.SecondaryAxesY.Remove(axisY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
view.Indicators.Remove(indicator);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
StockMarketTraderApp/StockChart/IndicatorItems.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using DevExpress.XtraCharts;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public abstract class IndicatorItem {
|
||||
protected abstract string Name { get; }
|
||||
|
||||
protected abstract Indicator CreateIndicator();
|
||||
public override string ToString() {
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class CheckedIndicatorItem : IndicatorItem {
|
||||
bool indicatorVisible;
|
||||
|
||||
protected virtual string IndicatorName { get { return Name; } }
|
||||
|
||||
public void UpdateIndicator(ChartControl chart, XYDiagramSeriesViewBase seriesView, bool indicatorVisible) {
|
||||
if (this.indicatorVisible != indicatorVisible) {
|
||||
if (indicatorVisible) {
|
||||
Indicator indicator = CreateIndicator();
|
||||
if (indicator != null) {
|
||||
indicator.Tag = GetHashCode();
|
||||
indicator.Name = IndicatorName;
|
||||
indicator.ShowInLegend = true;
|
||||
seriesView.Indicators.Add(indicator);
|
||||
if (indicator is SeparatePaneIndicator)
|
||||
ChartHelper.InitializeSeparatePaneIndicator(chart, (SeparatePaneIndicator)indicator);
|
||||
}
|
||||
}
|
||||
else {
|
||||
int tag = GetHashCode();
|
||||
foreach (Indicator indicator in seriesView.Indicators) {
|
||||
if (indicator.Tag is int && (int)indicator.Tag == tag) {
|
||||
ChartHelper.RemoveIndicator(chart, seriesView, indicator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.indicatorVisible = indicatorVisible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
54
StockMarketTraderApp/StockChart/MovingAveragesItems.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using DevExpress.XtraCharts;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public abstract class MovingAverageItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return IndicatorName + " Moving Average"; } }
|
||||
|
||||
protected abstract MovingAverage CreateMovingAverage();
|
||||
protected override Indicator CreateIndicator() {
|
||||
MovingAverage movingAverage = CreateMovingAverage();
|
||||
movingAverage.ValueLevel = ValueLevel.Close;
|
||||
return movingAverage;
|
||||
}
|
||||
}
|
||||
|
||||
public class SimpleMovingAverageItem : MovingAverageItem {
|
||||
protected override string IndicatorName { get { return "Simple"; } }
|
||||
|
||||
protected override MovingAverage CreateMovingAverage() {
|
||||
return new SimpleMovingAverage();
|
||||
}
|
||||
}
|
||||
|
||||
public class ExponentialMovingAverageItem : MovingAverageItem {
|
||||
protected override string IndicatorName { get { return "Exponential"; } }
|
||||
|
||||
protected override MovingAverage CreateMovingAverage() {
|
||||
return new ExponentialMovingAverage();
|
||||
}
|
||||
}
|
||||
|
||||
public class TripleExponentialMovingAverageItem : MovingAverageItem {
|
||||
protected override string IndicatorName { get { return "Triple Exponential"; } }
|
||||
|
||||
protected override MovingAverage CreateMovingAverage() {
|
||||
return new TripleExponentialMovingAverageTema();
|
||||
}
|
||||
}
|
||||
|
||||
public class TriangularMovingAverageItem : MovingAverageItem {
|
||||
protected override string IndicatorName { get { return "Triangular"; } }
|
||||
|
||||
protected override MovingAverage CreateMovingAverage() {
|
||||
return new TriangularMovingAverage();
|
||||
}
|
||||
}
|
||||
|
||||
public class WeightedMovingAverageItem : MovingAverageItem {
|
||||
protected override string IndicatorName { get { return "Weighted"; } }
|
||||
|
||||
protected override MovingAverage CreateMovingAverage() {
|
||||
return new WeightedMovingAverage();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
StockMarketTraderApp/StockChart/RegressionItems.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using DevExpress.XtraCharts;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public abstract class RegressionItem : CheckedIndicatorItem {
|
||||
protected override string Name { get { return IndicatorName + " Regression"; } }
|
||||
}
|
||||
|
||||
public class LinearRegressionItem : RegressionItem {
|
||||
protected override string IndicatorName { get { return "Linear"; } }
|
||||
|
||||
protected override Indicator CreateIndicator() {
|
||||
return new RegressionLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
606
StockMarketTraderApp/StockChart/StockChartUC.Designer.cs
generated
Normal file
@@ -0,0 +1,606 @@
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
partial class StockChartUC {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.components = new System.ComponentModel.Container();
|
||||
DevExpress.Utils.SuperToolTip superToolTip1 = new DevExpress.Utils.SuperToolTip();
|
||||
DevExpress.Utils.ToolTipTitleItem toolTipTitleItem1 = new DevExpress.Utils.ToolTipTitleItem();
|
||||
DevExpress.Utils.ToolTipItem toolTipItem1 = new DevExpress.Utils.ToolTipItem();
|
||||
DevExpress.Utils.SuperToolTip superToolTip2 = new DevExpress.Utils.SuperToolTip();
|
||||
DevExpress.Utils.ToolTipTitleItem toolTipTitleItem2 = new DevExpress.Utils.ToolTipTitleItem();
|
||||
DevExpress.Utils.ToolTipItem toolTipItem2 = new DevExpress.Utils.ToolTipItem();
|
||||
DevExpress.Utils.SuperToolTip superToolTip3 = new DevExpress.Utils.SuperToolTip();
|
||||
DevExpress.Utils.ToolTipTitleItem toolTipTitleItem3 = new DevExpress.Utils.ToolTipTitleItem();
|
||||
DevExpress.Utils.ToolTipItem toolTipItem3 = new DevExpress.Utils.ToolTipItem();
|
||||
DevExpress.Utils.SuperToolTip superToolTip4 = new DevExpress.Utils.SuperToolTip();
|
||||
DevExpress.Utils.ToolTipTitleItem toolTipTitleItem4 = new DevExpress.Utils.ToolTipTitleItem();
|
||||
DevExpress.Utils.ToolTipItem toolTipItem4 = new DevExpress.Utils.ToolTipItem();
|
||||
DevExpress.Utils.SuperToolTip superToolTip5 = new DevExpress.Utils.SuperToolTip();
|
||||
DevExpress.Utils.ToolTipTitleItem toolTipTitleItem5 = new DevExpress.Utils.ToolTipTitleItem();
|
||||
DevExpress.Utils.ToolTipItem toolTipItem5 = new DevExpress.Utils.ToolTipItem();
|
||||
DevExpress.Utils.SuperToolTip superToolTip6 = new DevExpress.Utils.SuperToolTip();
|
||||
DevExpress.Utils.ToolTipTitleItem toolTipTitleItem6 = new DevExpress.Utils.ToolTipTitleItem();
|
||||
DevExpress.Utils.ToolTipItem toolTipItem6 = new DevExpress.Utils.ToolTipItem();
|
||||
DevExpress.Utils.SuperToolTip superToolTip7 = new DevExpress.Utils.SuperToolTip();
|
||||
DevExpress.Utils.ToolTipTitleItem toolTipTitleItem7 = new DevExpress.Utils.ToolTipTitleItem();
|
||||
DevExpress.Utils.ToolTipItem toolTipItem7 = new DevExpress.Utils.ToolTipItem();
|
||||
DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram();
|
||||
DevExpress.XtraCharts.CustomAxisLabel customAxisLabel1 = new DevExpress.XtraCharts.CustomAxisLabel();
|
||||
DevExpress.XtraCharts.XYDiagramPane xyDiagramPane1 = new DevExpress.XtraCharts.XYDiagramPane();
|
||||
DevExpress.XtraCharts.SecondaryAxisY secondaryAxisY1 = new DevExpress.XtraCharts.SecondaryAxisY();
|
||||
DevExpress.XtraCharts.Legend legend1 = new DevExpress.XtraCharts.Legend();
|
||||
DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
|
||||
DevExpress.XtraCharts.CandleStickSeriesView candleStickSeriesView1 = new DevExpress.XtraCharts.CandleStickSeriesView();
|
||||
DevExpress.XtraCharts.Series series2 = new DevExpress.XtraCharts.Series();
|
||||
DevExpress.XtraCharts.SideBySideBarSeriesLabel sideBySideBarSeriesLabel1 = new DevExpress.XtraCharts.SideBySideBarSeriesLabel();
|
||||
DevExpress.XtraCharts.SideBySideBarSeriesView sideBySideBarSeriesView1 = new DevExpress.XtraCharts.SideBySideBarSeriesView();
|
||||
DevExpress.XtraCharts.CandleStickSeriesView candleStickSeriesView2 = new DevExpress.XtraCharts.CandleStickSeriesView();
|
||||
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
|
||||
this.barMain = new DevExpress.XtraBars.Bar();
|
||||
this.stockBarCheckItem = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.candleStickBarCheckItem = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.volumesBarCheckItem = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItem3 = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItem4 = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItem5 = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItem6 = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItem7 = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barStaticItemPeriod = new DevExpress.XtraBars.BarStaticItem();
|
||||
this.comboBoxBarEditItem = new DevExpress.XtraBars.BarEditItem();
|
||||
this.repositoryItemComboBoxPeriod = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
|
||||
this.barCheckItemTrendLine = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItemFibonacciArcs = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItemFibonacciFans = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItemFibonacciRetracement = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barCheckItemRemoveIndicator = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.barStaticItemAdvancedIndicators = new DevExpress.XtraBars.BarStaticItem();
|
||||
this.barEditItemAdvancedIndicators = new DevExpress.XtraBars.BarEditItem();
|
||||
this.repositoryItemCheckedComboBoxEditAdvancedIndicators = new DevExpress.XtraEditors.Repository.RepositoryItemCheckedComboBoxEdit();
|
||||
this.barAndDockingController1 = new DevExpress.XtraBars.BarAndDockingController(this.components);
|
||||
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
|
||||
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
|
||||
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
|
||||
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
|
||||
this.barCheckItemRegressionLine = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.repositoryItemCheckedComboBoxEditMovingAverages = new DevExpress.XtraEditors.Repository.RepositoryItemCheckedComboBoxEdit();
|
||||
this.repositoryItemComboBoxRegression = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
|
||||
this.stockChart = new DevExpress.XtraCharts.ChartControl();
|
||||
this.barCheckItem1 = new DevExpress.XtraBars.BarCheckItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemComboBoxPeriod)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckedComboBoxEditAdvancedIndicators)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.barAndDockingController1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckedComboBoxEditMovingAverages)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemComboBoxRegression)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.stockChart)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(xyDiagram1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(xyDiagramPane1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(secondaryAxisY1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(candleStickSeriesView1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesLabel1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesView1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(candleStickSeriesView2)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// barManager1
|
||||
//
|
||||
this.barManager1.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
|
||||
this.barMain});
|
||||
this.barManager1.Controller = this.barAndDockingController1;
|
||||
this.barManager1.DockControls.Add(this.barDockControlTop);
|
||||
this.barManager1.DockControls.Add(this.barDockControlBottom);
|
||||
this.barManager1.DockControls.Add(this.barDockControlLeft);
|
||||
this.barManager1.DockControls.Add(this.barDockControlRight);
|
||||
this.barManager1.Form = this;
|
||||
this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
|
||||
this.stockBarCheckItem,
|
||||
this.candleStickBarCheckItem,
|
||||
this.volumesBarCheckItem,
|
||||
this.barCheckItem3,
|
||||
this.barCheckItem4,
|
||||
this.barCheckItem5,
|
||||
this.barCheckItem6,
|
||||
this.barCheckItem7,
|
||||
this.barStaticItemPeriod,
|
||||
this.comboBoxBarEditItem,
|
||||
this.barCheckItemTrendLine,
|
||||
this.barCheckItemFibonacciArcs,
|
||||
this.barCheckItemFibonacciFans,
|
||||
this.barCheckItemFibonacciRetracement,
|
||||
this.barCheckItemRemoveIndicator,
|
||||
this.barCheckItemRegressionLine,
|
||||
this.barStaticItemAdvancedIndicators,
|
||||
this.barEditItemAdvancedIndicators});
|
||||
this.barManager1.MaxItemId = 37;
|
||||
this.barManager1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
|
||||
this.repositoryItemComboBoxPeriod,
|
||||
this.repositoryItemCheckedComboBoxEditMovingAverages,
|
||||
this.repositoryItemComboBoxRegression,
|
||||
this.repositoryItemCheckedComboBoxEditAdvancedIndicators});
|
||||
//
|
||||
// barMain
|
||||
//
|
||||
this.barMain.BarName = "Main";
|
||||
this.barMain.DockCol = 0;
|
||||
this.barMain.DockRow = 0;
|
||||
this.barMain.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
|
||||
this.barMain.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.stockBarCheckItem, true),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.candleStickBarCheckItem),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.volumesBarCheckItem),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItem3, true),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItem4),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItem5),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItem6),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItem7),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(((DevExpress.XtraBars.BarLinkUserDefines)((DevExpress.XtraBars.BarLinkUserDefines.Caption | DevExpress.XtraBars.BarLinkUserDefines.PaintStyle))), this.barStaticItemPeriod, "Period:", true, true, true, 0, null, DevExpress.XtraBars.BarItemPaintStyle.Caption),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.Width, this.comboBoxBarEditItem, "", false, true, true, 79),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItemTrendLine, true),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItemFibonacciArcs),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItemFibonacciFans),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItemFibonacciRetracement),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barCheckItemRemoveIndicator),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barStaticItemAdvancedIndicators, true),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barEditItemAdvancedIndicators)});
|
||||
this.barMain.OptionsBar.AllowQuickCustomization = false;
|
||||
this.barMain.OptionsBar.DrawBorder = false;
|
||||
this.barMain.OptionsBar.DrawDragBorder = false;
|
||||
this.barMain.OptionsBar.UseWholeRow = true;
|
||||
this.barMain.Text = "Main";
|
||||
//
|
||||
// stockBarCheckItem
|
||||
//
|
||||
this.stockBarCheckItem.Caption = "Stock";
|
||||
this.stockBarCheckItem.GroupIndex = 2;
|
||||
this.stockBarCheckItem.Id = 16;
|
||||
this.stockBarCheckItem.Name = "stockBarCheckItem";
|
||||
this.stockBarCheckItem.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.ChangeViewToStock);
|
||||
//
|
||||
// candleStickBarCheckItem
|
||||
//
|
||||
this.candleStickBarCheckItem.BindableChecked = true;
|
||||
this.candleStickBarCheckItem.Caption = "Candle Stick";
|
||||
this.candleStickBarCheckItem.Checked = true;
|
||||
this.candleStickBarCheckItem.GroupIndex = 2;
|
||||
this.candleStickBarCheckItem.Id = 15;
|
||||
this.candleStickBarCheckItem.Name = "candleStickBarCheckItem";
|
||||
this.candleStickBarCheckItem.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.ChangeViewToCandleStick);
|
||||
//
|
||||
// volumesBarCheckItem
|
||||
//
|
||||
this.volumesBarCheckItem.BindableChecked = true;
|
||||
this.volumesBarCheckItem.Caption = "Volume";
|
||||
this.volumesBarCheckItem.Checked = true;
|
||||
this.volumesBarCheckItem.Id = 2;
|
||||
this.volumesBarCheckItem.Name = "volumesBarCheckItem";
|
||||
this.volumesBarCheckItem.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.OnShowVolumeChartChanged);
|
||||
//
|
||||
// barCheckItem3
|
||||
//
|
||||
this.barCheckItem3.Caption = "6m";
|
||||
this.barCheckItem3.GroupIndex = 1;
|
||||
this.barCheckItem3.Id = 4;
|
||||
this.barCheckItem3.Name = "barCheckItem3";
|
||||
this.barCheckItem3.Tag = 120;
|
||||
this.barCheckItem3.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.OnPeriodChanged);
|
||||
//
|
||||
// barCheckItem4
|
||||
//
|
||||
this.barCheckItem4.Caption = "1y";
|
||||
this.barCheckItem4.GroupIndex = 1;
|
||||
this.barCheckItem4.Id = 5;
|
||||
this.barCheckItem4.Name = "barCheckItem4";
|
||||
this.barCheckItem4.Tag = 240;
|
||||
this.barCheckItem4.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.OnPeriodChanged);
|
||||
//
|
||||
// barCheckItem5
|
||||
//
|
||||
this.barCheckItem5.BindableChecked = true;
|
||||
this.barCheckItem5.Caption = "1.5y";
|
||||
this.barCheckItem5.GroupIndex = 1;
|
||||
this.barCheckItem5.Id = 6;
|
||||
this.barCheckItem5.Name = "barCheckItem5";
|
||||
this.barCheckItem5.Tag = 360;
|
||||
this.barCheckItem5.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.OnPeriodChanged);
|
||||
//
|
||||
// barCheckItem6
|
||||
//
|
||||
this.barCheckItem6.Caption = "2y";
|
||||
this.barCheckItem6.GroupIndex = 1;
|
||||
this.barCheckItem6.Id = 7;
|
||||
this.barCheckItem6.Name = "barCheckItem6";
|
||||
this.barCheckItem6.Tag = 480;
|
||||
this.barCheckItem6.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.OnPeriodChanged);
|
||||
//
|
||||
// barCheckItem7
|
||||
//
|
||||
this.barCheckItem7.Caption = "4y";
|
||||
this.barCheckItem7.GroupIndex = 1;
|
||||
this.barCheckItem7.Checked = true;
|
||||
this.barCheckItem7.Id = 8;
|
||||
this.barCheckItem7.Name = "barCheckItem7";
|
||||
this.barCheckItem7.Tag = 960;
|
||||
this.barCheckItem7.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.OnPeriodChanged);
|
||||
//
|
||||
// barStaticItemPeriod
|
||||
//
|
||||
this.barStaticItemPeriod.Caption = "Period:";
|
||||
this.barStaticItemPeriod.Id = 9;
|
||||
this.barStaticItemPeriod.Name = "barStaticItemPeriod";
|
||||
//
|
||||
// comboBoxBarEditItem
|
||||
//
|
||||
this.comboBoxBarEditItem.Caption = "Period";
|
||||
this.comboBoxBarEditItem.Edit = this.repositoryItemComboBoxPeriod;
|
||||
this.comboBoxBarEditItem.EditWidth = 65;
|
||||
this.comboBoxBarEditItem.Id = 13;
|
||||
this.comboBoxBarEditItem.Name = "comboBoxBarEditItem";
|
||||
this.comboBoxBarEditItem.EditValueChanged += new System.EventHandler(this.OnTicksChanged);
|
||||
//
|
||||
// repositoryItemComboBoxPeriod
|
||||
//
|
||||
this.repositoryItemComboBoxPeriod.AutoHeight = false;
|
||||
this.repositoryItemComboBoxPeriod.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
|
||||
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
|
||||
this.repositoryItemComboBoxPeriod.Name = "repositoryItemComboBoxPeriod";
|
||||
this.repositoryItemComboBoxPeriod.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
|
||||
//
|
||||
// barCheckItemTrendLine
|
||||
//
|
||||
this.barCheckItemTrendLine.Caption = "Trend Line";
|
||||
this.barCheckItemTrendLine.Id = 19;
|
||||
this.barCheckItemTrendLine.Name = "barCheckItemTrendLine";
|
||||
toolTipTitleItem1.Text = "Trend Line";
|
||||
toolTipItem1.LeftIndent = 6;
|
||||
toolTipItem1.Text = "To add a Trend Line, click on the first series point and drag mouse to the secon" +
|
||||
"d series point.";
|
||||
superToolTip1.Items.Add(toolTipTitleItem1);
|
||||
superToolTip1.Items.Add(toolTipItem1);
|
||||
this.barCheckItemTrendLine.SuperTip = superToolTip1;
|
||||
this.barCheckItemTrendLine.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.UpdateDrawingItems);
|
||||
//
|
||||
// barCheckItemFibonacciArcs
|
||||
//
|
||||
this.barCheckItemFibonacciArcs.Caption = "Fibonacci Arcs";
|
||||
this.barCheckItemFibonacciArcs.Id = 20;
|
||||
this.barCheckItemFibonacciArcs.Name = "barCheckItemFibonacciArcs";
|
||||
toolTipTitleItem2.Text = "Fibonacci Arcs";
|
||||
toolTipItem2.LeftIndent = 6;
|
||||
toolTipItem2.Text = "To add a Fibonacci Arcs, click on the first series point and drag mouse to the s" +
|
||||
"econd series point.";
|
||||
superToolTip2.Items.Add(toolTipTitleItem2);
|
||||
superToolTip2.Items.Add(toolTipItem2);
|
||||
this.barCheckItemFibonacciArcs.SuperTip = superToolTip2;
|
||||
this.barCheckItemFibonacciArcs.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.UpdateDrawingItems);
|
||||
//
|
||||
// barCheckItemFibonacciFans
|
||||
//
|
||||
this.barCheckItemFibonacciFans.Caption = "Fibonacci Fans";
|
||||
this.barCheckItemFibonacciFans.Id = 21;
|
||||
this.barCheckItemFibonacciFans.Name = "barCheckItemFibonacciFans";
|
||||
toolTipTitleItem3.Text = "Fibonacci Fans";
|
||||
toolTipItem3.LeftIndent = 6;
|
||||
toolTipItem3.Text = "To add a Fibonacci Fans, click on the first series point and drag mouse to the s" +
|
||||
"econd series point.";
|
||||
superToolTip3.Items.Add(toolTipTitleItem3);
|
||||
superToolTip3.Items.Add(toolTipItem3);
|
||||
this.barCheckItemFibonacciFans.SuperTip = superToolTip3;
|
||||
this.barCheckItemFibonacciFans.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.UpdateDrawingItems);
|
||||
//
|
||||
// barCheckItemFibonacciRetracement
|
||||
//
|
||||
this.barCheckItemFibonacciRetracement.Caption = "Fibonacci Retracement";
|
||||
this.barCheckItemFibonacciRetracement.Id = 22;
|
||||
this.barCheckItemFibonacciRetracement.Name = "barCheckItemFibonacciRetracement";
|
||||
toolTipTitleItem4.Text = "Fibonacci Retracement";
|
||||
toolTipItem4.LeftIndent = 6;
|
||||
toolTipItem4.Text = "To add a Fibonacci Retracement, click on the first series point and drag mouse t" +
|
||||
"o the second series point.";
|
||||
superToolTip4.Items.Add(toolTipTitleItem4);
|
||||
superToolTip4.Items.Add(toolTipItem4);
|
||||
this.barCheckItemFibonacciRetracement.SuperTip = superToolTip4;
|
||||
this.barCheckItemFibonacciRetracement.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.UpdateDrawingItems);
|
||||
//
|
||||
// barCheckItemRemoveIndicator
|
||||
//
|
||||
this.barCheckItemRemoveIndicator.Caption = "Remove Indicator";
|
||||
this.barCheckItemRemoveIndicator.Id = 27;
|
||||
this.barCheckItemRemoveIndicator.Name = "barCheckItemRemoveIndicator";
|
||||
toolTipTitleItem5.Text = "Remove Indicator";
|
||||
toolTipItem5.LeftIndent = 6;
|
||||
toolTipItem5.Text = "To remove an indicator, click it or its label.";
|
||||
superToolTip5.Items.Add(toolTipTitleItem5);
|
||||
superToolTip5.Items.Add(toolTipItem5);
|
||||
this.barCheckItemRemoveIndicator.SuperTip = superToolTip5;
|
||||
this.barCheckItemRemoveIndicator.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.barCheckItemRemoveIndicator_CheckedChanged);
|
||||
//
|
||||
// barStaticItemAdvancedIndicators
|
||||
//
|
||||
this.barStaticItemAdvancedIndicators.Border = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.barStaticItemAdvancedIndicators.Caption = "Indicators:";
|
||||
this.barStaticItemAdvancedIndicators.Id = 35;
|
||||
this.barStaticItemAdvancedIndicators.Name = "barStaticItemAdvancedIndicators";
|
||||
toolTipTitleItem6.Text = "Advanced Indicators";
|
||||
toolTipItem6.LeftIndent = 6;
|
||||
toolTipItem6.Text = "To add an indicator, check it in a drop down list.";
|
||||
superToolTip6.Items.Add(toolTipTitleItem6);
|
||||
superToolTip6.Items.Add(toolTipItem6);
|
||||
this.barStaticItemAdvancedIndicators.SuperTip = superToolTip6;
|
||||
//
|
||||
// barEditItemAdvancedIndicators
|
||||
//
|
||||
this.barEditItemAdvancedIndicators.Caption = "Advanced Indicators";
|
||||
this.barEditItemAdvancedIndicators.Edit = this.repositoryItemCheckedComboBoxEditAdvancedIndicators;
|
||||
this.barEditItemAdvancedIndicators.EditWidth = 80;
|
||||
this.barEditItemAdvancedIndicators.Id = 36;
|
||||
this.barEditItemAdvancedIndicators.Name = "barEditItemAdvancedIndicators";
|
||||
toolTipTitleItem7.Text = "Advanced Indicators";
|
||||
toolTipItem7.LeftIndent = 6;
|
||||
toolTipItem7.Text = "To add an indicator, check it in a drop down list.";
|
||||
superToolTip7.Items.Add(toolTipTitleItem7);
|
||||
superToolTip7.Items.Add(toolTipItem7);
|
||||
this.barEditItemAdvancedIndicators.SuperTip = superToolTip7;
|
||||
this.barEditItemAdvancedIndicators.EditValueChanged += new System.EventHandler(this.barEditItemAdvancedIndicators_EditValueChanged);
|
||||
//
|
||||
// repositoryItemCheckedComboBoxEditAdvancedIndicators
|
||||
//
|
||||
this.repositoryItemCheckedComboBoxEditAdvancedIndicators.AutoHeight = false;
|
||||
this.repositoryItemCheckedComboBoxEditAdvancedIndicators.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
|
||||
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
|
||||
this.repositoryItemCheckedComboBoxEditAdvancedIndicators.Name = "repositoryItemCheckedComboBoxEditAdvancedIndicators";
|
||||
this.repositoryItemCheckedComboBoxEditAdvancedIndicators.PopupFormSize = new System.Drawing.Size(240, 410);
|
||||
this.repositoryItemCheckedComboBoxEditAdvancedIndicators.SelectAllItemVisible = false;
|
||||
//
|
||||
// barAndDockingController1
|
||||
//
|
||||
this.barAndDockingController1.PropertiesBar.AllowLinkLighting = false;
|
||||
this.barAndDockingController1.PropertiesDocking.ViewStyle = DevExpress.XtraBars.Docking2010.Views.DockingViewStyle.Classic;
|
||||
//
|
||||
// barDockControlTop
|
||||
//
|
||||
this.barDockControlTop.CausesValidation = false;
|
||||
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
|
||||
this.barDockControlTop.Manager = this.barManager1;
|
||||
this.barDockControlTop.Size = new System.Drawing.Size(1157, 20);
|
||||
//
|
||||
// barDockControlBottom
|
||||
//
|
||||
this.barDockControlBottom.CausesValidation = false;
|
||||
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.barDockControlBottom.Location = new System.Drawing.Point(0, 536);
|
||||
this.barDockControlBottom.Manager = this.barManager1;
|
||||
this.barDockControlBottom.Size = new System.Drawing.Size(1157, 0);
|
||||
//
|
||||
// barDockControlLeft
|
||||
//
|
||||
this.barDockControlLeft.CausesValidation = false;
|
||||
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.barDockControlLeft.Location = new System.Drawing.Point(0, 20);
|
||||
this.barDockControlLeft.Manager = this.barManager1;
|
||||
this.barDockControlLeft.Size = new System.Drawing.Size(0, 516);
|
||||
//
|
||||
// barDockControlRight
|
||||
//
|
||||
this.barDockControlRight.CausesValidation = false;
|
||||
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.barDockControlRight.Location = new System.Drawing.Point(1157, 20);
|
||||
this.barDockControlRight.Manager = this.barManager1;
|
||||
this.barDockControlRight.Size = new System.Drawing.Size(0, 516);
|
||||
//
|
||||
// barCheckItemRegressionLine
|
||||
//
|
||||
this.barCheckItemRegressionLine.Caption = "Regression Line";
|
||||
this.barCheckItemRegressionLine.Id = 28;
|
||||
this.barCheckItemRegressionLine.Name = "barCheckItemRegressionLine";
|
||||
//
|
||||
// repositoryItemCheckedComboBoxEditMovingAverages
|
||||
//
|
||||
this.repositoryItemCheckedComboBoxEditMovingAverages.AutoHeight = false;
|
||||
this.repositoryItemCheckedComboBoxEditMovingAverages.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
|
||||
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
|
||||
this.repositoryItemCheckedComboBoxEditMovingAverages.Name = "repositoryItemCheckedComboBoxEditMovingAverages";
|
||||
this.repositoryItemCheckedComboBoxEditMovingAverages.SelectAllItemVisible = false;
|
||||
//
|
||||
// repositoryItemComboBoxRegression
|
||||
//
|
||||
this.repositoryItemComboBoxRegression.AutoHeight = false;
|
||||
this.repositoryItemComboBoxRegression.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
|
||||
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
|
||||
this.repositoryItemComboBoxRegression.Name = "repositoryItemComboBoxRegression";
|
||||
this.repositoryItemComboBoxRegression.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
|
||||
//
|
||||
// stockChart
|
||||
//
|
||||
this.stockChart.AccessibleRole = System.Windows.Forms.AccessibleRole.Application;
|
||||
this.stockChart.AutoLayout = false;
|
||||
this.stockChart.BorderOptions.Visibility = DevExpress.Utils.DefaultBoolean.False;
|
||||
//this.stockChart.CrosshairOptions.ArgumentLineColor = System.Drawing.Color.White;
|
||||
this.stockChart.CrosshairOptions.ShowOnlyInFocusedPane = false;
|
||||
//this.stockChart.CrosshairOptions.ValueLineColor = System.Drawing.Color.White;
|
||||
xyDiagram1.AxisX.DateTimeScaleOptions.MeasureUnit = DevExpress.XtraCharts.DateTimeMeasureUnit.Week;
|
||||
xyDiagram1.AxisX.GridLines.MinorVisible = true;
|
||||
xyDiagram1.AxisX.GridLines.Visible = true;
|
||||
xyDiagram1.AxisX.VisibleInPanesSerializable = "0";
|
||||
xyDiagram1.AxisY.Alignment = DevExpress.XtraCharts.AxisAlignment.Far;
|
||||
customAxisLabel1.AxisValueSerializable = "1";
|
||||
customAxisLabel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(71)))), ((int)(((byte)(71)))), ((int)(((byte)(71)))));
|
||||
customAxisLabel1.Name = "$1,0";
|
||||
//customAxisLabel1.TextColor = System.Drawing.Color.White;
|
||||
xyDiagram1.AxisY.CustomLabels.AddRange(new DevExpress.XtraCharts.CustomAxisLabel[] {
|
||||
customAxisLabel1});
|
||||
xyDiagram1.AxisY.GridLines.MinorVisible = true;
|
||||
xyDiagram1.AxisY.Label.ResolveOverlappingOptions.AllowHide = false;
|
||||
xyDiagram1.AxisY.Label.ResolveOverlappingOptions.AllowRotate = false;
|
||||
xyDiagram1.AxisY.Label.ResolveOverlappingOptions.AllowStagger = false;
|
||||
xyDiagram1.AxisY.Label.TextPattern = "${V:F1}";
|
||||
xyDiagram1.AxisY.LabelVisibilityMode = DevExpress.XtraCharts.AxisLabelVisibilityMode.AutoGeneratedAndCustom;
|
||||
xyDiagram1.AxisY.Title.Text = "";
|
||||
xyDiagram1.AxisY.VisibleInPanesSerializable = "-1";
|
||||
xyDiagram1.AxisY.WholeRange.AlwaysShowZeroLevel = false;
|
||||
xyDiagram1.DefaultPane.LayoutOptions.RowSpan = 2;
|
||||
xyDiagram1.PaneDistance = 5;
|
||||
xyDiagramPane1.Name = "Volume Pane";
|
||||
xyDiagramPane1.PaneID = 0;
|
||||
xyDiagram1.Panes.AddRange(new DevExpress.XtraCharts.XYDiagramPane[] {
|
||||
xyDiagramPane1});
|
||||
secondaryAxisY1.AxisID = 1;
|
||||
secondaryAxisY1.GridLines.MinorVisible = true;
|
||||
secondaryAxisY1.GridLines.Visible = true;
|
||||
secondaryAxisY1.Label.TextPattern = "{V:F1}M";
|
||||
secondaryAxisY1.Name = "Volume Axis";
|
||||
secondaryAxisY1.VisibleInPanesSerializable = "0";
|
||||
xyDiagram1.SecondaryAxesY.AddRange(new DevExpress.XtraCharts.SecondaryAxisY[] {
|
||||
secondaryAxisY1});
|
||||
this.stockChart.Diagram = xyDiagram1;
|
||||
this.stockChart.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stockChart.Legend.AlignmentHorizontal = DevExpress.XtraCharts.LegendAlignmentHorizontal.Left;
|
||||
this.stockChart.Legend.Margins.Bottom = 10;
|
||||
this.stockChart.Legend.Margins.Left = 10;
|
||||
this.stockChart.Legend.Margins.Right = 10;
|
||||
this.stockChart.Legend.Margins.Top = 10;
|
||||
this.stockChart.Legend.Name = "Default Legend";
|
||||
this.stockChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True;
|
||||
legend1.AlignmentHorizontal = DevExpress.XtraCharts.LegendAlignmentHorizontal.Left;
|
||||
legend1.DockTargetName = "Volume Pane";
|
||||
legend1.Margins.Bottom = 10;
|
||||
legend1.Margins.Left = 10;
|
||||
legend1.Margins.Right = 10;
|
||||
legend1.Margins.Top = 10;
|
||||
legend1.Name = "Volume Legend";
|
||||
this.stockChart.Legends.AddRange(new DevExpress.XtraCharts.Legend[] {
|
||||
legend1});
|
||||
this.stockChart.Location = new System.Drawing.Point(0, 20);
|
||||
this.stockChart.Name = "stockChart";
|
||||
this.stockChart.SelectionMode = DevExpress.XtraCharts.ElementSelectionMode.Single;
|
||||
series1.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.DateTime;
|
||||
series1.Name = "Price";
|
||||
candleStickSeriesView1.LevelLineLength = 0.3D;
|
||||
candleStickSeriesView1.LineThickness = 1;
|
||||
series1.View = candleStickSeriesView1;
|
||||
series2.ArgumentScaleType = DevExpress.XtraCharts.ScaleType.DateTime;
|
||||
series2.CrosshairLabelPattern = "{S} : {V}M";
|
||||
sideBySideBarSeriesLabel1.LineVisibility = DevExpress.Utils.DefaultBoolean.False;
|
||||
series2.Label = sideBySideBarSeriesLabel1;
|
||||
series2.LegendName = "Volume Legend";
|
||||
series2.LegendTextPattern = "{A}";
|
||||
series2.Name = "Volume";
|
||||
sideBySideBarSeriesView1.AxisYName = "Volume Axis";
|
||||
sideBySideBarSeriesView1.BarWidth = 0.8D;
|
||||
sideBySideBarSeriesView1.PaneName = "Volume Pane";
|
||||
series2.View = sideBySideBarSeriesView1;
|
||||
this.stockChart.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
|
||||
series1,
|
||||
series2};
|
||||
this.stockChart.SeriesTemplate.View = candleStickSeriesView2;
|
||||
this.stockChart.SideBySideBarDistanceFixed = 0;
|
||||
this.stockChart.Size = new System.Drawing.Size(1157, 516);
|
||||
this.stockChart.TabIndex = 5;
|
||||
this.stockChart.ObjectSelected += new DevExpress.XtraCharts.HotTrackEventHandler(this.stockChart_ObjectSelected);
|
||||
this.stockChart.ObjectHotTracked += new DevExpress.XtraCharts.HotTrackEventHandler(this.stockChart_ObjectHotTracked);
|
||||
this.stockChart.BoundDataChanged += new DevExpress.XtraCharts.BoundDataChangedEventHandler(this.stockChart_BoundDataChanged);
|
||||
this.stockChart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.stockChart_MouseDown);
|
||||
this.stockChart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.stockChart_MouseMove);
|
||||
this.stockChart.MouseUp += new System.Windows.Forms.MouseEventHandler(this.stockChart_MouseUp);
|
||||
//
|
||||
// barCheckItem1
|
||||
//
|
||||
this.barCheckItem1.BindableChecked = true;
|
||||
this.barCheckItem1.Caption = "Crosshair";
|
||||
this.barCheckItem1.Checked = true;
|
||||
this.barCheckItem1.GroupIndex = 3;
|
||||
this.barCheckItem1.Id = 23;
|
||||
this.barCheckItem1.Name = "barCheckItem1";
|
||||
//
|
||||
// StockChartUC
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.stockChart);
|
||||
this.Controls.Add(this.barDockControlLeft);
|
||||
this.Controls.Add(this.barDockControlRight);
|
||||
this.Controls.Add(this.barDockControlBottom);
|
||||
this.Controls.Add(this.barDockControlTop);
|
||||
this.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Name = "StockChartUC";
|
||||
this.Size = new System.Drawing.Size(1157, 536);
|
||||
this.Load += new System.EventHandler(this.StockChartUC_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemComboBoxPeriod)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckedComboBoxEditAdvancedIndicators)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.barAndDockingController1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckedComboBoxEditMovingAverages)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemComboBoxRegression)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(xyDiagramPane1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(secondaryAxisY1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(xyDiagram1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(candleStickSeriesView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesLabel1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(candleStickSeriesView2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.stockChart)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private XtraBars.BarManager barManager1;
|
||||
private XtraBars.Bar barMain;
|
||||
private XtraBars.BarCheckItem volumesBarCheckItem;
|
||||
private XtraBars.BarCheckItem barCheckItem3;
|
||||
private XtraBars.BarCheckItem barCheckItem4;
|
||||
private XtraBars.BarCheckItem barCheckItem5;
|
||||
private XtraBars.BarCheckItem barCheckItem6;
|
||||
private XtraBars.BarCheckItem barCheckItem7;
|
||||
private XtraBars.BarStaticItem barStaticItemPeriod;
|
||||
private XtraBars.BarDockControl barDockControlTop;
|
||||
private XtraBars.BarDockControl barDockControlBottom;
|
||||
private XtraBars.BarDockControl barDockControlLeft;
|
||||
private XtraBars.BarDockControl barDockControlRight;
|
||||
public XtraCharts.ChartControl stockChart;
|
||||
private XtraBars.BarEditItem comboBoxBarEditItem;
|
||||
private XtraEditors.Repository.RepositoryItemComboBox repositoryItemComboBoxPeriod;
|
||||
private XtraBars.BarCheckItem stockBarCheckItem;
|
||||
private XtraBars.BarCheckItem candleStickBarCheckItem;
|
||||
private XtraBars.BarCheckItem barCheckItemTrendLine;
|
||||
private XtraBars.BarCheckItem barCheckItemFibonacciArcs;
|
||||
private XtraBars.BarCheckItem barCheckItemFibonacciFans;
|
||||
private XtraBars.BarCheckItem barCheckItemFibonacciRetracement;
|
||||
private XtraBars.BarCheckItem barCheckItemRemoveIndicator;
|
||||
private XtraBars.BarCheckItem barCheckItem1;
|
||||
private XtraBars.BarCheckItem barCheckItemRegressionLine;
|
||||
private XtraEditors.Repository.RepositoryItemCheckedComboBoxEdit repositoryItemCheckedComboBoxEditMovingAverages;
|
||||
private XtraBars.BarAndDockingController barAndDockingController1;
|
||||
private XtraEditors.Repository.RepositoryItemComboBox repositoryItemComboBoxRegression;
|
||||
private XtraBars.BarStaticItem barStaticItemAdvancedIndicators;
|
||||
private XtraBars.BarEditItem barEditItemAdvancedIndicators;
|
||||
private XtraEditors.Repository.RepositoryItemCheckedComboBoxEdit repositoryItemCheckedComboBoxEditAdvancedIndicators;
|
||||
}
|
||||
}
|
||||
296
StockMarketTraderApp/StockChart/StockChartUC.cs
Normal file
@@ -0,0 +1,296 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.Utils.Drawing;
|
||||
using DevExpress.Utils.Svg;
|
||||
using DevExpress.XtraBars;
|
||||
using DevExpress.XtraCharts;
|
||||
using DevExpress.XtraEditors.Controls;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public partial class StockChartUC : UserControl {
|
||||
const string PriceSeriesName = "Price";
|
||||
const string VolumeSeriesName = "Volume";
|
||||
const int MinCandleCount = 20;
|
||||
|
||||
readonly List<PeriodItem> periods = new List<PeriodItem>() { new PeriodItem("1 Week", 5), new PeriodItem("2 Week", 10), new PeriodItem("1 Month", 20) };
|
||||
bool isSelection = false;
|
||||
bool isDrawing = false;
|
||||
int daysCount = 105;
|
||||
FinancialIndicator draggingIndicator;
|
||||
ConstantLine trendlineBorder;
|
||||
|
||||
XYDiagram Diagram { get { return (XYDiagram)stockChart.Diagram; } }
|
||||
Series PriceSeries { get { return stockChart.Series[PriceSeriesName]; } }
|
||||
FinancialSeriesViewBase PriceSeriesView { get { return (FinancialSeriesViewBase)PriceSeries.View; } }
|
||||
SideBySideBarSeriesView VolumeSeriesView { get { return (SideBySideBarSeriesView)stockChart.Series[VolumeSeriesName].View; } }
|
||||
|
||||
public StockChartUC() {
|
||||
InitializeComponent();
|
||||
InitializeAdvancedIndicators();
|
||||
barStaticItemAdvancedIndicators.LeftIndent = 11;
|
||||
barStaticItemPeriod.LeftIndent = 11;
|
||||
this.stockChart.LookAndFeel.StyleChanged += LookAndFeel_StyleChanged;
|
||||
LookAndFeel_StyleChanged(null, null);
|
||||
}
|
||||
void LookAndFeel_StyleChanged(object sender, EventArgs e) {
|
||||
XYDiagram xYDiagram = stockChart.Diagram as XYDiagram;
|
||||
CustomAxisLabel customAxisLabel = xYDiagram.AxisY.CustomLabels[0];
|
||||
customAxisLabel.BackColor = Skins.CommonSkins.GetSkin(stockChart.LookAndFeel).SvgPalettes[ObjectState.Normal].GetColor("Gray");
|
||||
customAxisLabel.TextColor = Skins.CommonSkins.GetSkin(stockChart.LookAndFeel).SvgPalettes[ObjectState.Normal].GetColor("White");
|
||||
}
|
||||
void InitializeAdvancedIndicators() {
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new LinearRegressionItem());
|
||||
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new SimpleMovingAverageItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new ExponentialMovingAverageItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new TripleExponentialMovingAverageItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new TriangularMovingAverageItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new WeightedMovingAverageItem());
|
||||
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new MedianPriceItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new TypicalPriceItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new WeightedCloseItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new AverageTrueRangeItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new CommodityChannelIndexItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new DetrendedPriceOscillatorItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new MassIndexItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new MovingAverageConvergenceDivergenceItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new RateOfChangeItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new RelativeStrengthIndexItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new StandardDeviationItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new ChaikinsVolatilityItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items.Add(new WilliamsRItem());
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.CustomDisplayText += Empty_CustomDisplayText;
|
||||
}
|
||||
void StockChartUC_Load(object sender, EventArgs e) {
|
||||
if(StockMarketView.defaultViewModel == null)
|
||||
return;
|
||||
|
||||
stockBarCheckItem.ImageOptions.SvgImage = SvgResources.GetSvgImage("Stock");
|
||||
candleStickBarCheckItem.ImageOptions.SvgImage = SvgResources.GetSvgImage("Candles");
|
||||
volumesBarCheckItem.ImageOptions.SvgImage = SvgResources.GetSvgImage("Bars");
|
||||
barCheckItem3.ImageOptions.SvgImage = SvgResources.GetSvgImage("6m");
|
||||
barCheckItem4.ImageOptions.SvgImage = SvgResources.GetSvgImage("1y");
|
||||
barCheckItem5.ImageOptions.SvgImage = SvgResources.GetSvgImage("1-5y");
|
||||
barCheckItem6.ImageOptions.SvgImage = SvgResources.GetSvgImage("2y");
|
||||
barCheckItem7.ImageOptions.SvgImage = SvgResources.GetSvgImage("4y");
|
||||
barCheckItemRemoveIndicator.ImageOptions.SvgImage = SvgResources.GetSvgImage("Remove");
|
||||
barCheckItemTrendLine.ImageOptions.SvgImage = SvgResources.GetSvgImage("TrendLine");
|
||||
barCheckItemFibonacciArcs.ImageOptions.SvgImage = SvgResources.GetSvgImage("FibonacciArcs");
|
||||
barCheckItemFibonacciFans.ImageOptions.SvgImage = SvgResources.GetSvgImage("FibonacciFans");
|
||||
barCheckItemFibonacciRetracement.ImageOptions.SvgImage = SvgResources.GetSvgImage("FibonacciRetracement");
|
||||
//StockMarketView.defaultViewModel.model.InitServer();
|
||||
OnPeriodChanged(barCheckItem7, null);
|
||||
for(int i = 0; i < 6; i++)
|
||||
repositoryItemCheckedComboBoxEditAdvancedIndicators.Items[i].CheckState = CheckState.Checked;
|
||||
|
||||
barEditItemAdvancedIndicators.EditValue = "Default";
|
||||
}
|
||||
void OnShowVolumeChartChanged(object sender, ItemClickEventArgs e) {
|
||||
Diagram.Panes[0].Visibility = volumesBarCheckItem.Checked ? ChartElementVisibility.Visible : ChartElementVisibility.Hidden;
|
||||
}
|
||||
void OnPeriodChanged(object sender, ItemClickEventArgs e) {
|
||||
BarCheckItem barCheckItem = sender as BarCheckItem;
|
||||
if(barCheckItem != null && barCheckItem.Checked != false) {
|
||||
daysCount = (int)barCheckItem.Tag;
|
||||
repositoryItemComboBoxPeriod.Items.Clear();
|
||||
foreach(PeriodItem periodItem in periods) {
|
||||
int numberOfCandles = daysCount / periodItem.Ticks;
|
||||
if(numberOfCandles >= MinCandleCount)
|
||||
repositoryItemComboBoxPeriod.Items.Add(periodItem);
|
||||
}
|
||||
comboBoxBarEditItem.EditValue = repositoryItemComboBoxPeriod.Items[0];
|
||||
OnTicksChanged(comboBoxBarEditItem, null);
|
||||
}
|
||||
}
|
||||
void OnTicksChanged(object sender, EventArgs e) {
|
||||
if(!ViewModel.RealTimeDataViewModel.IsReady) return;
|
||||
BarEditItem barEditItem = sender as BarEditItem;
|
||||
if(barEditItem != null && barEditItem.Name == "comboBoxBarEditItem") {
|
||||
var vm = StockMarketView.defaultViewModel;
|
||||
if(vm != null) {
|
||||
int numberOfTicks = ((PeriodItem)barEditItem.EditValue).Ticks;
|
||||
int newCandlesCount = daysCount / numberOfTicks;
|
||||
if(vm.Ticks != numberOfTicks || vm.CandlesCount != newCandlesCount) {
|
||||
vm.SetTicks(numberOfTicks);
|
||||
vm.CandlesCount = newCandlesCount;
|
||||
vm.OnCandlesCountChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateSeriesView();
|
||||
}
|
||||
void UpdateSeriesView() {
|
||||
if(comboBoxBarEditItem.EditValue != null) {
|
||||
switch(comboBoxBarEditItem.EditValue.ToString()) {
|
||||
case "1 week":
|
||||
Diagram.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Week;
|
||||
PriceSeriesView.LevelLineLength = 0.3;
|
||||
VolumeSeriesView.BarWidth = 0.8D;
|
||||
break;
|
||||
case "2 week":
|
||||
Diagram.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Week;
|
||||
PriceSeriesView.LevelLineLength = 0.6;
|
||||
VolumeSeriesView.BarWidth = 1.6D;
|
||||
break;
|
||||
case "1 month":
|
||||
Diagram.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Month;
|
||||
PriceSeriesView.LevelLineLength = 0.3;
|
||||
VolumeSeriesView.BarWidth = 0.8D;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void ChangeViewToCandleStick(object sender, ItemClickEventArgs e) {
|
||||
stockChart.Series[PriceSeriesName].ChangeView(ViewType.CandleStick);
|
||||
}
|
||||
void ChangeViewToStock(object sender, ItemClickEventArgs e) {
|
||||
stockChart.Series[PriceSeriesName].ChangeView(ViewType.Stock);
|
||||
}
|
||||
void stockChart_MouseMove(object sender, MouseEventArgs e) {
|
||||
if(isDrawing) {
|
||||
DiagramCoordinates coords = Diagram.PointToDiagram(e.Location);
|
||||
draggingIndicator.Point2.Argument = coords.DateTimeArgument;
|
||||
trendlineBorder.AxisValue = coords.DateTimeArgument;
|
||||
}
|
||||
}
|
||||
void stockChart_MouseUp(object sender, MouseEventArgs e) {
|
||||
if(!isSelection) {
|
||||
draggingIndicator = null;
|
||||
Diagram.AxisX.ConstantLines.Remove(trendlineBorder);
|
||||
trendlineBorder = null;
|
||||
isDrawing = false;
|
||||
stockChart.Capture = false;
|
||||
}
|
||||
}
|
||||
void stockChart_MouseDown(object sender, MouseEventArgs e) {
|
||||
if(!isSelection) {
|
||||
draggingIndicator = CreateDraggingIndicator();
|
||||
if(draggingIndicator == null)
|
||||
return;
|
||||
|
||||
DiagramCoordinates coords = Diagram.PointToDiagram(e.Location);
|
||||
draggingIndicator.Point1.Argument = coords.DateTimeArgument;
|
||||
draggingIndicator.Point1.ValueLevel = ValueLevel.Close;
|
||||
draggingIndicator.Point2.Argument = coords.DateTimeArgument;
|
||||
draggingIndicator.Point2.ValueLevel = ValueLevel.Close;
|
||||
|
||||
PriceSeriesView.Indicators.Add(draggingIndicator);
|
||||
|
||||
trendlineBorder = new ConstantLine();
|
||||
trendlineBorder.AxisValue = coords.DateTimeArgument;
|
||||
trendlineBorder.LineStyle.DashStyle = DashStyle.Dash;
|
||||
trendlineBorder.LineStyle.Thickness = 1;
|
||||
trendlineBorder.ShowInLegend = false;
|
||||
Diagram.AxisX.ConstantLines.Add(trendlineBorder);
|
||||
stockChart.Capture = true;
|
||||
|
||||
isDrawing = true;
|
||||
stockChart.Capture = true;
|
||||
}
|
||||
}
|
||||
void stockChart_ObjectHotTracked(object sender, HotTrackEventArgs e) {
|
||||
if(!isSelection || !e.HitInfo.InIndicator)
|
||||
e.Cancel = true;
|
||||
else if(e.HitInfo.InIndicator) {
|
||||
Indicator indicator = e.HitInfo.Indicator;
|
||||
if(!(indicator is TrendLine) && !(indicator is FibonacciIndicator))
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
void stockChart_ObjectSelected(object sender, HotTrackEventArgs e) {
|
||||
if(isSelection && e.HitInfo.InIndicator) {
|
||||
Indicator indicator = e.HitInfo.Indicator;
|
||||
if(indicator is TrendLine || indicator is FibonacciIndicator)
|
||||
ChartHelper.RemoveIndicator(stockChart, PriceSeriesView, indicator);
|
||||
}
|
||||
e.Cancel = true;
|
||||
}
|
||||
void barEditItemMovingAverageIndicators_EditValueChanged(object sender, EventArgs e) {
|
||||
foreach(CheckedListBoxItem item in repositoryItemCheckedComboBoxEditMovingAverages.Items) {
|
||||
CheckedIndicatorItem movingAverage = (CheckedIndicatorItem)item.Value;
|
||||
movingAverage.UpdateIndicator(stockChart, PriceSeriesView, item.CheckState == CheckState.Checked);
|
||||
}
|
||||
}
|
||||
void barEditItemAdvancedIndicators_EditValueChanged(object sender, EventArgs e) {
|
||||
foreach(CheckedListBoxItem item in repositoryItemCheckedComboBoxEditAdvancedIndicators.Items) {
|
||||
CheckedIndicatorItem indicatorItem = (CheckedIndicatorItem)item.Value;
|
||||
indicatorItem.UpdateIndicator(stockChart, PriceSeriesView, item.CheckState == CheckState.Checked);
|
||||
}
|
||||
}
|
||||
void Empty_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) {
|
||||
if(string.IsNullOrEmpty(e.DisplayText))
|
||||
e.DisplayText = "None";
|
||||
}
|
||||
void UpdateDrawingItemChecked(BarCheckItem item, BarCheckItem changedItem) {
|
||||
if(item != changedItem)
|
||||
item.Checked = false;
|
||||
}
|
||||
void UpdateDrawingItems(object sender, ItemClickEventArgs e) {
|
||||
BarCheckItem item = (BarCheckItem)sender;
|
||||
if(item.Checked) {
|
||||
UpdateDrawingItemChecked(barCheckItemTrendLine, item);
|
||||
UpdateDrawingItemChecked(barCheckItemFibonacciArcs, item);
|
||||
UpdateDrawingItemChecked(barCheckItemFibonacciFans, item);
|
||||
UpdateDrawingItemChecked(barCheckItemFibonacciRetracement, item);
|
||||
UpdateDrawingItemChecked(barCheckItemRemoveIndicator, item);
|
||||
}
|
||||
stockChart.CrosshairEnabled = barCheckItemTrendLine.Checked || barCheckItemFibonacciArcs.Checked || barCheckItemFibonacciFans.Checked ||
|
||||
barCheckItemFibonacciRetracement.Checked || barCheckItemRemoveIndicator.Checked ? DefaultBoolean.False : DefaultBoolean.True;
|
||||
}
|
||||
void barCheckItemRemoveIndicator_CheckedChanged(object sender, ItemClickEventArgs e) {
|
||||
isSelection = ((BarCheckItem)sender).Checked;
|
||||
UpdateDrawingItems(sender, e);
|
||||
}
|
||||
void stockChart_BoundDataChanged(object sender, EventArgs e) {
|
||||
if(PriceSeries.Points.Count > 0) {
|
||||
Diagram.AxisY.CustomLabels[0].AxisValue = PriceSeries.Points[PriceSeries.Points.Count - 1].Values[3];
|
||||
Diagram.AxisY.CustomLabels[0].Name = String.Format("${0:F1}", Diagram.AxisY.CustomLabels[0].AxisValue);
|
||||
}
|
||||
}
|
||||
FinancialIndicator CreateDraggingIndicator() {
|
||||
if(barCheckItemTrendLine.Checked)
|
||||
return new TrendLine("TrendLine");
|
||||
if(barCheckItemFibonacciArcs.Checked)
|
||||
return new FibonacciIndicator(FibonacciIndicatorKind.FibonacciArcs, "FibonacciArcs");
|
||||
if(barCheckItemFibonacciFans.Checked)
|
||||
return new FibonacciIndicator(FibonacciIndicatorKind.FibonacciFans, "FibonacciFans");
|
||||
if(barCheckItemFibonacciRetracement.Checked)
|
||||
return new FibonacciIndicator(FibonacciIndicatorKind.FibonacciRetracement, "FibonacciRetracement");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public class PeriodItem {
|
||||
public PeriodItem(string caption, int ticks) {
|
||||
Caption = caption;
|
||||
Ticks = ticks;
|
||||
}
|
||||
public override string ToString() {
|
||||
return Caption;
|
||||
}
|
||||
public string Caption {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
public int Ticks {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
}
|
||||
//
|
||||
public class SvgResources {
|
||||
const string prefix = "DevExpress.StockMarketTrader.ImagesSvg.";
|
||||
const string ext = ".svg";
|
||||
readonly static Dictionary<string, SvgImage> svgImages = new Dictionary<string, SvgImage>(20);
|
||||
public static SvgImage GetSvgImage(string imageName) {
|
||||
SvgImage svgImage;
|
||||
if(!svgImages.TryGetValue(imageName, out svgImage)) {
|
||||
svgImage = ResourceImageHelper.CreateSvgImageFromResources(prefix + imageName + ext, typeof(SvgResources).Assembly);
|
||||
svgImages.Add(imageName, svgImage);
|
||||
}
|
||||
return svgImage;
|
||||
}
|
||||
}
|
||||
}
|
||||
126
StockMarketTraderApp/StockChart/StockChartUC.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="barManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="barAndDockingController1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>142, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
63
StockMarketTraderApp/StockMarketView.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraEditors;
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
partial class StockMarketView {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.stockWorkspacesUC2 = new DevExpress.StockMarketTrader.StockWorkspacesUC();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// stockWorkspacesUC2
|
||||
//
|
||||
this.stockWorkspacesUC2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stockWorkspacesUC2.Location = new System.Drawing.Point(0, 0);
|
||||
this.stockWorkspacesUC2.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.stockWorkspacesUC2.MinimumSize = new System.Drawing.Size(500, 350);
|
||||
this.stockWorkspacesUC2.Name = "stockWorkspacesUC2";
|
||||
this.stockWorkspacesUC2.Size = new System.Drawing.Size(1299, 676);
|
||||
this.stockWorkspacesUC2.TabIndex = 11;
|
||||
//
|
||||
// StockMarketView
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1299, 676);
|
||||
this.Controls.Add(this.stockWorkspacesUC2);
|
||||
this.MinimumSize = new System.Drawing.Size(1160, 675);
|
||||
this.Name = "StockMarketView";
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//private UserControl1 userControl11;
|
||||
private StockWorkspacesUC stockWorkspacesUC2;
|
||||
|
||||
}
|
||||
}
|
||||
42
StockMarketTraderApp/StockMarketView.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.StockMarketTrader.Tiles;
|
||||
using DevExpress.StockMarketTrader.ViewModel;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraLayout.Utils;
|
||||
using DevExpress.XtraSplashScreen;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public partial class StockMarketView : XtraForm {
|
||||
public static RealTimeDataViewModel defaultViewModel = null;
|
||||
public StockMarketView() {
|
||||
DevExpress.Utils.About.UAlgo.Default.DoEventObject(DevExpress.Utils.About.UAlgo.kDemo, DevExpress.Utils.About.UAlgo.pWinForms, this); //DEMO_REMOVE
|
||||
SplashScreenManager.ShowForm(this, typeof(SplashScreen1), true, true);
|
||||
InitializeComponent();
|
||||
|
||||
defaultViewModel = new RealTimeDataViewModel(new System.Windows.Forms.Timer());
|
||||
Load += StockMarketView_Load;
|
||||
}
|
||||
void StockMarketView_Load(object sender, EventArgs e) {
|
||||
SplashScreenManager.CloseForm();
|
||||
ShowIcon = true;
|
||||
Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(@"DevExpress.StockMarketTrader.Images.DX.ico"));
|
||||
Text = "DevExpress Stock Market (.Net Core 3.0)";
|
||||
stockWorkspacesUC2.panelContainer1.Size = new Size((int)(Width * 0.33), stockWorkspacesUC2.panelContainer1.Height);
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e) {
|
||||
base.OnShown(e);
|
||||
RealTimeDataViewModel.IsReady = true;
|
||||
}
|
||||
|
||||
protected Image DrawControlToImage(Control control) {
|
||||
Bitmap bmp = new Bitmap(control.Width, control.Height);
|
||||
control.Invalidate();
|
||||
control.DrawToBitmap(bmp, new Rectangle(Point.Empty, control.Size));
|
||||
return bmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StockMarketTraderApp/StockMarketView.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
646
StockMarketTraderApp/StockWorkspacesUC.Designer.cs
generated
Normal file
@@ -0,0 +1,646 @@
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
partial class StockWorkspacesUC {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.components = new System.ComponentModel.Container();
|
||||
DevExpress.XtraCharts.SimpleDiagram simpleDiagram2 = new DevExpress.XtraCharts.SimpleDiagram();
|
||||
DevExpress.XtraCharts.Series series2 = new DevExpress.XtraCharts.Series();
|
||||
DevExpress.XtraCharts.DoughnutSeriesLabel doughnutSeriesLabel3 = new DevExpress.XtraCharts.DoughnutSeriesLabel();
|
||||
DevExpress.XtraCharts.DoughnutSeriesView doughnutSeriesView3 = new DevExpress.XtraCharts.DoughnutSeriesView();
|
||||
DevExpress.XtraCharts.DoughnutSeriesLabel doughnutSeriesLabel4 = new DevExpress.XtraCharts.DoughnutSeriesLabel();
|
||||
DevExpress.XtraCharts.DoughnutSeriesView doughnutSeriesView4 = new DevExpress.XtraCharts.DoughnutSeriesView();
|
||||
this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.barManagerStockChart = new DevExpress.XtraBars.BarManager(this.components);
|
||||
this.barWorckspace = new DevExpress.XtraBars.Bar();
|
||||
this.ViewSubitem = new DevExpress.XtraBars.BarSubItem();
|
||||
this.barSubItem1 = new DevExpress.XtraBars.BarSubItem();
|
||||
this.watchListbarCheckItem = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.transactionGridbarCheckItem = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.topVolumesbarCheckItem = new DevExpress.XtraBars.BarCheckItem();
|
||||
this.bbiSwatches = new DevExpress.XtraBars.BarButtonItem();
|
||||
this.helpBarItemButton = new DevExpress.XtraBars.BarSubItem();
|
||||
this.bsiConnectedStatus = new DevExpress.XtraBars.BarStaticItem();
|
||||
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
|
||||
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
|
||||
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
|
||||
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
|
||||
this.dockManager1 = new DevExpress.XtraBars.Docking.DockManager(this.components);
|
||||
this.panelContainer1 = new DevExpress.XtraBars.Docking.DockPanel();
|
||||
this.watchListDockPanel = new DevExpress.XtraBars.Docking.DockPanel();
|
||||
this.watchListDockPanel_Container = new DevExpress.XtraBars.Docking.ControlContainer();
|
||||
this.watchListGrid = new DevExpress.XtraGrid.GridControl();
|
||||
this.watchListGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.panelContainerTopVolumesAndTransaction = new DevExpress.XtraBars.Docking.DockPanel();
|
||||
this.topVolumesDockPanel = new DevExpress.XtraBars.Docking.DockPanel();
|
||||
this.topVolumesDockPanel_Container = new DevExpress.XtraBars.Docking.ControlContainer();
|
||||
this.volumeChart = new DevExpress.XtraCharts.ChartControl();
|
||||
this.transactionGridDockPanel = new DevExpress.XtraBars.Docking.DockPanel();
|
||||
this.transactionGridDockPanel_Container = new DevExpress.XtraBars.Docking.ControlContainer();
|
||||
this.transactionGrid = new DevExpress.XtraGrid.GridControl();
|
||||
this.transactionGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.barButtonItem1 = new DevExpress.XtraBars.BarButtonItem();
|
||||
this.barEditItem1 = new DevExpress.XtraBars.BarEditItem();
|
||||
this.repositoryItemTextEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
|
||||
this.repositoryItemTextEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
|
||||
this.repositoryItemTextEdit3 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
|
||||
this.stockChartUC = new DevExpress.StockMarketTrader.StockChartUC();
|
||||
this.documentManager1 = new DevExpress.XtraBars.Docking2010.DocumentManager(this.components);
|
||||
this.noDocumentsView1 = new DevExpress.XtraBars.Docking2010.Views.NoDocuments.NoDocumentsView(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.barManagerStockChart)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dockManager1)).BeginInit();
|
||||
this.panelContainer1.SuspendLayout();
|
||||
this.watchListDockPanel.SuspendLayout();
|
||||
this.watchListDockPanel_Container.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.watchListGrid)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.watchListGridView)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
|
||||
this.panelContainerTopVolumesAndTransaction.SuspendLayout();
|
||||
this.topVolumesDockPanel.SuspendLayout();
|
||||
this.topVolumesDockPanel_Container.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.volumeChart)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(simpleDiagram2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesLabel3)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesView3)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesLabel4)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesView4)).BeginInit();
|
||||
this.transactionGridDockPanel.SuspendLayout();
|
||||
this.transactionGridDockPanel_Container.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.transactionGrid)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.transactionGridView)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit3)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.documentManager1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.noDocumentsView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// gridColumn1
|
||||
//
|
||||
this.gridColumn1.Caption = "Ask";
|
||||
this.gridColumn1.FieldName = "Ask";
|
||||
this.gridColumn1.Name = "gridColumn1";
|
||||
this.gridColumn1.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
|
||||
this.gridColumn1.Visible = true;
|
||||
this.gridColumn1.VisibleIndex = 0;
|
||||
//
|
||||
// gridColumn3
|
||||
//
|
||||
this.gridColumn3.Caption = "Bid";
|
||||
this.gridColumn3.FieldName = "Bid";
|
||||
this.gridColumn3.Name = "gridColumn3";
|
||||
this.gridColumn3.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
|
||||
this.gridColumn3.Visible = true;
|
||||
this.gridColumn3.VisibleIndex = 2;
|
||||
//
|
||||
// gridColumn2
|
||||
//
|
||||
this.gridColumn2.Caption = "Price";
|
||||
this.gridColumn2.FieldName = "Price";
|
||||
this.gridColumn2.Name = "gridColumn2";
|
||||
this.gridColumn2.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
|
||||
this.gridColumn2.Visible = true;
|
||||
this.gridColumn2.VisibleIndex = 1;
|
||||
//
|
||||
// barManagerStockChart
|
||||
//
|
||||
this.barManagerStockChart.AllowCustomization = false;
|
||||
this.barManagerStockChart.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
|
||||
this.barWorckspace});
|
||||
this.barManagerStockChart.DockControls.Add(this.barDockControlTop);
|
||||
this.barManagerStockChart.DockControls.Add(this.barDockControlBottom);
|
||||
this.barManagerStockChart.DockControls.Add(this.barDockControlLeft);
|
||||
this.barManagerStockChart.DockControls.Add(this.barDockControlRight);
|
||||
this.barManagerStockChart.DockManager = this.dockManager1;
|
||||
this.barManagerStockChart.Form = this;
|
||||
this.barManagerStockChart.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
|
||||
this.barButtonItem1,
|
||||
this.helpBarItemButton,
|
||||
this.ViewSubitem,
|
||||
this.barSubItem1,
|
||||
this.watchListbarCheckItem,
|
||||
this.transactionGridbarCheckItem,
|
||||
this.topVolumesbarCheckItem,
|
||||
this.barEditItem1,
|
||||
this.bsiConnectedStatus,
|
||||
this.bbiSwatches});
|
||||
this.barManagerStockChart.MainMenu = this.barWorckspace;
|
||||
this.barManagerStockChart.MaxItemId = 20;
|
||||
this.barManagerStockChart.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
|
||||
this.repositoryItemTextEdit1,
|
||||
this.repositoryItemTextEdit2,
|
||||
this.repositoryItemTextEdit3});
|
||||
//
|
||||
// barWorckspace
|
||||
//
|
||||
this.barWorckspace.BarAppearance.Disabled.Font = new System.Drawing.Font("Segoe UI", 8.25F);
|
||||
this.barWorckspace.BarAppearance.Disabled.Options.UseFont = true;
|
||||
this.barWorckspace.BarAppearance.Hovered.Font = new System.Drawing.Font("Segoe UI", 8.25F);
|
||||
this.barWorckspace.BarAppearance.Hovered.Options.UseFont = true;
|
||||
this.barWorckspace.BarAppearance.Normal.Font = new System.Drawing.Font("Segoe UI", 8.25F);
|
||||
this.barWorckspace.BarAppearance.Normal.Options.UseFont = true;
|
||||
this.barWorckspace.BarAppearance.Pressed.Font = new System.Drawing.Font("Segoe UI", 8.25F);
|
||||
this.barWorckspace.BarAppearance.Pressed.Options.UseFont = true;
|
||||
this.barWorckspace.BarName = "Main menu";
|
||||
this.barWorckspace.DockCol = 0;
|
||||
this.barWorckspace.DockRow = 0;
|
||||
this.barWorckspace.DockStyle = DevExpress.XtraBars.BarDockStyle.Bottom;
|
||||
this.barWorckspace.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.ViewSubitem, true),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.bbiSwatches),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.helpBarItemButton),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.bsiConnectedStatus)});
|
||||
this.barWorckspace.OptionsBar.AllowQuickCustomization = false;
|
||||
this.barWorckspace.OptionsBar.DrawDragBorder = false;
|
||||
this.barWorckspace.OptionsBar.UseWholeRow = true;
|
||||
this.barWorckspace.Text = "Main menu";
|
||||
//
|
||||
// ViewSubitem
|
||||
//
|
||||
this.ViewSubitem.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
|
||||
this.ViewSubitem.Caption = "View";
|
||||
this.ViewSubitem.Id = 4;
|
||||
this.ViewSubitem.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.barSubItem1)});
|
||||
this.ViewSubitem.Name = "ViewSubitem";
|
||||
//
|
||||
// barSubItem1
|
||||
//
|
||||
this.barSubItem1.Caption = "Panels";
|
||||
this.barSubItem1.Id = 6;
|
||||
this.barSubItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.watchListbarCheckItem),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.transactionGridbarCheckItem),
|
||||
new DevExpress.XtraBars.LinkPersistInfo(this.topVolumesbarCheckItem)});
|
||||
this.barSubItem1.Name = "barSubItem1";
|
||||
//
|
||||
// watchListbarCheckItem
|
||||
//
|
||||
this.watchListbarCheckItem.BindableChecked = true;
|
||||
this.watchListbarCheckItem.Caption = "Watch List";
|
||||
this.watchListbarCheckItem.Checked = true;
|
||||
this.watchListbarCheckItem.Id = 7;
|
||||
this.watchListbarCheckItem.Name = "watchListbarCheckItem";
|
||||
this.watchListbarCheckItem.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.PanelsCheckedChanged);
|
||||
//
|
||||
// transactionGridbarCheckItem
|
||||
//
|
||||
this.transactionGridbarCheckItem.BindableChecked = true;
|
||||
this.transactionGridbarCheckItem.Caption = "Transaction";
|
||||
this.transactionGridbarCheckItem.Checked = true;
|
||||
this.transactionGridbarCheckItem.Id = 9;
|
||||
this.transactionGridbarCheckItem.Name = "transactionGridbarCheckItem";
|
||||
this.transactionGridbarCheckItem.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.PanelsCheckedChanged);
|
||||
//
|
||||
// topVolumesbarCheckItem
|
||||
//
|
||||
this.topVolumesbarCheckItem.BindableChecked = true;
|
||||
this.topVolumesbarCheckItem.Caption = "Top Volumes";
|
||||
this.topVolumesbarCheckItem.Checked = true;
|
||||
this.topVolumesbarCheckItem.Id = 10;
|
||||
this.topVolumesbarCheckItem.Name = "topVolumesbarCheckItem";
|
||||
this.topVolumesbarCheckItem.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.PanelsCheckedChanged);
|
||||
//
|
||||
// bbiSwatches
|
||||
//
|
||||
this.bbiSwatches.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
|
||||
this.bbiSwatches.Caption = "Swatches";
|
||||
this.bbiSwatches.Id = 19;
|
||||
this.bbiSwatches.Name = "bbiSwatches";
|
||||
this.bbiSwatches.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
|
||||
this.bbiSwatches.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.bbiSwatches_ItemClick);
|
||||
//
|
||||
// helpBarItemButton
|
||||
//
|
||||
this.helpBarItemButton.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
|
||||
this.helpBarItemButton.Caption = "Help";
|
||||
this.helpBarItemButton.Id = 3;
|
||||
this.helpBarItemButton.Name = "helpBarItemButton";
|
||||
this.helpBarItemButton.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
|
||||
this.helpBarItemButton.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.helpBarItemButton_ItemClick);
|
||||
//
|
||||
// bsiConnectedStatus
|
||||
//
|
||||
this.bsiConnectedStatus.Caption = "Disconnected";
|
||||
this.bsiConnectedStatus.Id = 18;
|
||||
this.bsiConnectedStatus.Name = "bsiConnectedStatus";
|
||||
this.bsiConnectedStatus.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
|
||||
//
|
||||
// barDockControlTop
|
||||
//
|
||||
this.barDockControlTop.CausesValidation = false;
|
||||
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
|
||||
this.barDockControlTop.Manager = this.barManagerStockChart;
|
||||
this.barDockControlTop.Size = new System.Drawing.Size(989, 1);
|
||||
//
|
||||
// barDockControlBottom
|
||||
//
|
||||
this.barDockControlBottom.CausesValidation = false;
|
||||
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.barDockControlBottom.Location = new System.Drawing.Point(0, 519);
|
||||
this.barDockControlBottom.Manager = this.barManagerStockChart;
|
||||
this.barDockControlBottom.Size = new System.Drawing.Size(989, 20);
|
||||
//
|
||||
// barDockControlLeft
|
||||
//
|
||||
this.barDockControlLeft.CausesValidation = false;
|
||||
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.barDockControlLeft.Location = new System.Drawing.Point(0, 1);
|
||||
this.barDockControlLeft.Manager = this.barManagerStockChart;
|
||||
this.barDockControlLeft.Size = new System.Drawing.Size(0, 518);
|
||||
//
|
||||
// barDockControlRight
|
||||
//
|
||||
this.barDockControlRight.CausesValidation = false;
|
||||
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.barDockControlRight.Location = new System.Drawing.Point(989, 1);
|
||||
this.barDockControlRight.Manager = this.barManagerStockChart;
|
||||
this.barDockControlRight.Size = new System.Drawing.Size(0, 518);
|
||||
//
|
||||
// dockManager1
|
||||
//
|
||||
this.dockManager1.DockingOptions.ShowMaximizeButton = false;
|
||||
this.dockManager1.Form = this;
|
||||
this.dockManager1.MenuManager = this.barManagerStockChart;
|
||||
this.dockManager1.RootPanels.AddRange(new DevExpress.XtraBars.Docking.DockPanel[] {
|
||||
this.panelContainer1});
|
||||
this.dockManager1.Style = DevExpress.XtraBars.Docking2010.Views.DockingViewStyle.Light;
|
||||
this.dockManager1.TopZIndexControls.AddRange(new string[] {
|
||||
"DevExpress.XtraBars.BarDockControl",
|
||||
"DevExpress.XtraBars.StandaloneBarDockControl",
|
||||
"System.Windows.Forms.StatusBar",
|
||||
"System.Windows.Forms.MenuStrip",
|
||||
"System.Windows.Forms.StatusStrip",
|
||||
"DevExpress.XtraBars.Ribbon.RibbonStatusBar",
|
||||
"DevExpress.XtraBars.Ribbon.RibbonControl"});
|
||||
//
|
||||
// panelContainer1
|
||||
//
|
||||
this.panelContainer1.Controls.Add(this.watchListDockPanel);
|
||||
this.panelContainer1.Controls.Add(this.panelContainerTopVolumesAndTransaction);
|
||||
this.panelContainer1.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left;
|
||||
this.panelContainer1.ID = new System.Guid("1b1d5e12-d87c-4a81-a868-82f0a735d9de");
|
||||
this.panelContainer1.Location = new System.Drawing.Point(0, 1);
|
||||
this.panelContainer1.Name = "panelContainer1";
|
||||
this.panelContainer1.OriginalSize = new System.Drawing.Size(399, 259);
|
||||
this.panelContainer1.SavedSizeFactor = 0D;
|
||||
this.panelContainer1.Size = new System.Drawing.Size(399, 518);
|
||||
this.panelContainer1.Text = "panelContainer1";
|
||||
//
|
||||
// watchListDockPanel
|
||||
//
|
||||
this.watchListDockPanel.Controls.Add(this.watchListDockPanel_Container);
|
||||
this.watchListDockPanel.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill;
|
||||
this.watchListDockPanel.ID = new System.Guid("4267c8de-af74-47af-a136-093eaa4b9652");
|
||||
this.watchListDockPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.watchListDockPanel.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.watchListDockPanel.Name = "watchListDockPanel";
|
||||
this.watchListDockPanel.OriginalSize = new System.Drawing.Size(399, 259);
|
||||
this.watchListDockPanel.SavedSizeFactor = 0D;
|
||||
this.watchListDockPanel.Size = new System.Drawing.Size(399, 259);
|
||||
this.watchListDockPanel.Text = "Watch List";
|
||||
this.watchListDockPanel.ClosedPanel += new DevExpress.XtraBars.Docking.DockPanelEventHandler(this.watchListDockPanel_ClosedPanel);
|
||||
//
|
||||
// watchListDockPanel_Container
|
||||
//
|
||||
this.watchListDockPanel_Container.Controls.Add(this.watchListGrid);
|
||||
this.watchListDockPanel_Container.Location = new System.Drawing.Point(0, 23);
|
||||
this.watchListDockPanel_Container.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.watchListDockPanel_Container.Name = "watchListDockPanel_Container";
|
||||
this.watchListDockPanel_Container.Size = new System.Drawing.Size(398, 236);
|
||||
this.watchListDockPanel_Container.TabIndex = 0;
|
||||
//
|
||||
// watchListGrid
|
||||
//
|
||||
this.watchListGrid.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.watchListGrid.Location = new System.Drawing.Point(0, 0);
|
||||
this.watchListGrid.MainView = this.watchListGridView;
|
||||
this.watchListGrid.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.watchListGrid.MenuManager = this.barManagerStockChart;
|
||||
this.watchListGrid.Name = "watchListGrid";
|
||||
this.watchListGrid.Size = new System.Drawing.Size(398, 236);
|
||||
this.watchListGrid.TabIndex = 0;
|
||||
this.watchListGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.watchListGridView,
|
||||
this.gridView1});
|
||||
//
|
||||
// watchListGridView
|
||||
//
|
||||
this.watchListGridView.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.watchListGridView.GridControl = this.watchListGrid;
|
||||
this.watchListGridView.Name = "watchListGridView";
|
||||
this.watchListGridView.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False;
|
||||
this.watchListGridView.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.False;
|
||||
this.watchListGridView.OptionsBehavior.AllowPixelScrolling = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.watchListGridView.OptionsBehavior.Editable = false;
|
||||
this.watchListGridView.OptionsBehavior.ReadOnly = true;
|
||||
this.watchListGridView.OptionsCustomization.AllowGroup = false;
|
||||
this.watchListGridView.OptionsDetail.EnableMasterViewMode = false;
|
||||
this.watchListGridView.OptionsSelection.EnableAppearanceFocusedCell = false;
|
||||
this.watchListGridView.OptionsView.ShowGroupPanel = false;
|
||||
this.watchListGridView.OptionsView.ShowIndicator = false;
|
||||
this.watchListGridView.RowHeight = 30;
|
||||
//
|
||||
// gridView1
|
||||
//
|
||||
this.gridView1.GridControl = this.watchListGrid;
|
||||
this.gridView1.Name = "gridView1";
|
||||
//
|
||||
// panelContainerTopVolumesAndTransaction
|
||||
//
|
||||
this.panelContainerTopVolumesAndTransaction.ActiveChild = this.topVolumesDockPanel;
|
||||
this.panelContainerTopVolumesAndTransaction.Controls.Add(this.topVolumesDockPanel);
|
||||
this.panelContainerTopVolumesAndTransaction.Controls.Add(this.transactionGridDockPanel);
|
||||
this.panelContainerTopVolumesAndTransaction.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill;
|
||||
this.panelContainerTopVolumesAndTransaction.FloatVertical = true;
|
||||
this.panelContainerTopVolumesAndTransaction.ID = new System.Guid("adb62255-405c-41ba-9125-27cad310e2e6");
|
||||
this.panelContainerTopVolumesAndTransaction.Location = new System.Drawing.Point(0, 259);
|
||||
this.panelContainerTopVolumesAndTransaction.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.panelContainerTopVolumesAndTransaction.Name = "panelContainerTopVolumesAndTransaction";
|
||||
this.panelContainerTopVolumesAndTransaction.OriginalSize = new System.Drawing.Size(399, 259);
|
||||
this.panelContainerTopVolumesAndTransaction.SavedSizeFactor = 0D;
|
||||
this.panelContainerTopVolumesAndTransaction.Size = new System.Drawing.Size(399, 259);
|
||||
this.panelContainerTopVolumesAndTransaction.Tabbed = true;
|
||||
this.panelContainerTopVolumesAndTransaction.Text = "panelContainer2";
|
||||
this.panelContainerTopVolumesAndTransaction.ClosedPanel += new DevExpress.XtraBars.Docking.DockPanelEventHandler(this.panelContainerTopVolumesAndTransaction_ClosedPanel);
|
||||
//
|
||||
// topVolumesDockPanel
|
||||
//
|
||||
this.topVolumesDockPanel.Controls.Add(this.topVolumesDockPanel_Container);
|
||||
this.topVolumesDockPanel.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill;
|
||||
this.topVolumesDockPanel.FloatVertical = true;
|
||||
this.topVolumesDockPanel.ID = new System.Guid("b6ef28bb-a6b0-4632-9943-cf1c3536dada");
|
||||
this.topVolumesDockPanel.Location = new System.Drawing.Point(0, 24);
|
||||
this.topVolumesDockPanel.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.topVolumesDockPanel.Name = "topVolumesDockPanel";
|
||||
this.topVolumesDockPanel.OriginalSize = new System.Drawing.Size(398, 207);
|
||||
this.topVolumesDockPanel.SavedSizeFactor = 0D;
|
||||
this.topVolumesDockPanel.Size = new System.Drawing.Size(398, 208);
|
||||
this.topVolumesDockPanel.Text = "Top Volumes";
|
||||
this.topVolumesDockPanel.ClosedPanel += new DevExpress.XtraBars.Docking.DockPanelEventHandler(this.topVolumesDockPanel_ClosedPanel);
|
||||
//
|
||||
// topVolumesDockPanel_Container
|
||||
//
|
||||
this.topVolumesDockPanel_Container.Controls.Add(this.volumeChart);
|
||||
this.topVolumesDockPanel_Container.Location = new System.Drawing.Point(0, 0);
|
||||
this.topVolumesDockPanel_Container.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.topVolumesDockPanel_Container.Name = "topVolumesDockPanel_Container";
|
||||
this.topVolumesDockPanel_Container.Size = new System.Drawing.Size(398, 208);
|
||||
this.topVolumesDockPanel_Container.TabIndex = 0;
|
||||
//
|
||||
// volumeChart
|
||||
//
|
||||
this.volumeChart.BorderOptions.Visibility = DevExpress.Utils.DefaultBoolean.False;
|
||||
simpleDiagram2.LabelsResolveOverlappingMinIndent = 2;
|
||||
this.volumeChart.Diagram = simpleDiagram2;
|
||||
this.volumeChart.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.volumeChart.Legend.Name = "Default Legend";
|
||||
this.volumeChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
|
||||
this.volumeChart.Location = new System.Drawing.Point(0, 0);
|
||||
this.volumeChart.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.volumeChart.Name = "volumeChart";
|
||||
this.volumeChart.PaletteRepository.Add("DxDemoStockPalette", new DevExpress.XtraCharts.Palette("DxDemoStockPalette", DevExpress.XtraCharts.PaletteScaleMode.Repeat, new DevExpress.XtraCharts.PaletteEntry[] {
|
||||
new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(138)))), ((int)(((byte)(9))))), System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(138)))), ((int)(((byte)(9)))))),
|
||||
new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(217)))), ((int)(((byte)(164))))), System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(217)))), ((int)(((byte)(164)))))),
|
||||
new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(95)))), ((int)(((byte)(149))))), System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(95)))), ((int)(((byte)(149)))))),
|
||||
new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.FromArgb(((int)(((byte)(117)))), ((int)(((byte)(101)))), ((int)(((byte)(199))))), System.Drawing.Color.FromArgb(((int)(((byte)(117)))), ((int)(((byte)(101)))), ((int)(((byte)(199)))))),
|
||||
new DevExpress.XtraCharts.PaletteEntry(System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))), System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))))}));
|
||||
this.volumeChart.SelectionMode = DevExpress.XtraCharts.ElementSelectionMode.Single;
|
||||
this.volumeChart.SeriesSelectionMode = DevExpress.XtraCharts.SeriesSelectionMode.Point;
|
||||
doughnutSeriesLabel3.BackColor = System.Drawing.Color.Transparent;
|
||||
doughnutSeriesLabel3.Font = new System.Drawing.Font("Tahoma", 10F);
|
||||
doughnutSeriesLabel3.Position = DevExpress.XtraCharts.PieSeriesLabelPosition.TwoColumns;
|
||||
doughnutSeriesLabel3.ResolveOverlappingMode = DevExpress.XtraCharts.ResolveOverlappingMode.Default;
|
||||
doughnutSeriesLabel3.TextPattern = "{A}: {VP:P2}";
|
||||
series2.Label = doughnutSeriesLabel3;
|
||||
series2.Name = "Series 1";
|
||||
doughnutSeriesView3.HoleRadiusPercent = 40;
|
||||
doughnutSeriesView3.Rotation = 1;
|
||||
series2.View = doughnutSeriesView3;
|
||||
this.volumeChart.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
|
||||
series2};
|
||||
doughnutSeriesLabel4.TextPattern = "{VP:G}";
|
||||
this.volumeChart.SeriesTemplate.Label = doughnutSeriesLabel4;
|
||||
this.volumeChart.SeriesTemplate.View = doughnutSeriesView4;
|
||||
this.volumeChart.Size = new System.Drawing.Size(398, 208);
|
||||
this.volumeChart.TabIndex = 0;
|
||||
this.volumeChart.ObjectSelected += new DevExpress.XtraCharts.HotTrackEventHandler(this.volumeChart_ObjectSelected);
|
||||
this.volumeChart.ObjectHotTracked += new DevExpress.XtraCharts.HotTrackEventHandler(this.volumeChart_ObjectHotTracked);
|
||||
this.volumeChart.BoundDataChanged += new DevExpress.XtraCharts.BoundDataChangedEventHandler(this.OnVolumeChartBoundDataChanged);
|
||||
this.volumeChart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.volumeChart_MouseDown);
|
||||
//
|
||||
// transactionGridDockPanel
|
||||
//
|
||||
this.transactionGridDockPanel.Controls.Add(this.transactionGridDockPanel_Container);
|
||||
this.transactionGridDockPanel.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill;
|
||||
this.transactionGridDockPanel.ID = new System.Guid("730a70bb-a6cb-40ed-b87c-c3b2251e0a24");
|
||||
this.transactionGridDockPanel.Location = new System.Drawing.Point(0, 24);
|
||||
this.transactionGridDockPanel.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.transactionGridDockPanel.Name = "transactionGridDockPanel";
|
||||
this.transactionGridDockPanel.OriginalSize = new System.Drawing.Size(398, 207);
|
||||
this.transactionGridDockPanel.SavedSizeFactor = 0D;
|
||||
this.transactionGridDockPanel.Size = new System.Drawing.Size(398, 208);
|
||||
this.transactionGridDockPanel.Text = "Transactions";
|
||||
this.transactionGridDockPanel.ClosedPanel += new DevExpress.XtraBars.Docking.DockPanelEventHandler(this.transactionGridDockPanel_ClosedPanel);
|
||||
//
|
||||
// transactionGridDockPanel_Container
|
||||
//
|
||||
this.transactionGridDockPanel_Container.Controls.Add(this.transactionGrid);
|
||||
this.transactionGridDockPanel_Container.Location = new System.Drawing.Point(0, 0);
|
||||
this.transactionGridDockPanel_Container.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.transactionGridDockPanel_Container.Name = "transactionGridDockPanel_Container";
|
||||
this.transactionGridDockPanel_Container.Size = new System.Drawing.Size(398, 208);
|
||||
this.transactionGridDockPanel_Container.TabIndex = 0;
|
||||
//
|
||||
// transactionGrid
|
||||
//
|
||||
this.transactionGrid.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.transactionGrid.Location = new System.Drawing.Point(0, 0);
|
||||
this.transactionGrid.MainView = this.transactionGridView;
|
||||
this.transactionGrid.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.transactionGrid.MenuManager = this.barManagerStockChart;
|
||||
this.transactionGrid.Name = "transactionGrid";
|
||||
this.transactionGrid.Size = new System.Drawing.Size(398, 208);
|
||||
this.transactionGrid.TabIndex = 0;
|
||||
this.transactionGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.transactionGridView});
|
||||
//
|
||||
// transactionGridView
|
||||
//
|
||||
this.transactionGridView.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.transactionGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
|
||||
this.gridColumn1,
|
||||
this.gridColumn2,
|
||||
this.gridColumn3});
|
||||
this.transactionGridView.GridControl = this.transactionGrid;
|
||||
this.transactionGridView.Name = "transactionGridView";
|
||||
this.transactionGridView.OptionsBehavior.AutoPopulateColumns = false;
|
||||
this.transactionGridView.OptionsBehavior.Editable = false;
|
||||
this.transactionGridView.OptionsBehavior.ReadOnly = true;
|
||||
this.transactionGridView.OptionsCustomization.AllowGroup = false;
|
||||
this.transactionGridView.OptionsView.ShowGroupPanel = false;
|
||||
this.transactionGridView.OptionsView.ShowIndicator = false;
|
||||
this.transactionGridView.SortInfo.AddRange(new DevExpress.XtraGrid.Columns.GridColumnSortInfo[] {
|
||||
new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gridColumn2, DevExpress.Data.ColumnSortOrder.Ascending)});
|
||||
//
|
||||
// barButtonItem1
|
||||
//
|
||||
this.barButtonItem1.Caption = "test";
|
||||
this.barButtonItem1.Id = 0;
|
||||
this.barButtonItem1.Name = "barButtonItem1";
|
||||
//
|
||||
// barEditItem1
|
||||
//
|
||||
this.barEditItem1.Caption = "barEdittem1";
|
||||
this.barEditItem1.Edit = this.repositoryItemTextEdit1;
|
||||
this.barEditItem1.Id = 11;
|
||||
this.barEditItem1.Name = "barEditItem1";
|
||||
//
|
||||
// repositoryItemTextEdit1
|
||||
//
|
||||
this.repositoryItemTextEdit1.AutoHeight = false;
|
||||
this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
|
||||
//
|
||||
// repositoryItemTextEdit2
|
||||
//
|
||||
this.repositoryItemTextEdit2.AutoHeight = false;
|
||||
this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
|
||||
//
|
||||
// repositoryItemTextEdit3
|
||||
//
|
||||
this.repositoryItemTextEdit3.AutoHeight = false;
|
||||
this.repositoryItemTextEdit3.Name = "repositoryItemTextEdit3";
|
||||
//
|
||||
// stockChartUC
|
||||
//
|
||||
this.stockChartUC.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stockChartUC.Location = new System.Drawing.Point(399, 1);
|
||||
this.stockChartUC.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.stockChartUC.Name = "stockChartUC";
|
||||
this.stockChartUC.Size = new System.Drawing.Size(590, 518);
|
||||
this.stockChartUC.TabIndex = 6;
|
||||
//
|
||||
// documentManager1
|
||||
//
|
||||
this.documentManager1.ClientControl = this.stockChartUC;
|
||||
this.documentManager1.MenuManager = this.barManagerStockChart;
|
||||
this.documentManager1.View = this.noDocumentsView1;
|
||||
this.documentManager1.ViewCollection.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseView[] {
|
||||
this.noDocumentsView1});
|
||||
//
|
||||
// StockWorkspacesUC
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.stockChartUC);
|
||||
this.Controls.Add(this.panelContainer1);
|
||||
this.Controls.Add(this.barDockControlLeft);
|
||||
this.Controls.Add(this.barDockControlRight);
|
||||
this.Controls.Add(this.barDockControlBottom);
|
||||
this.Controls.Add(this.barDockControlTop);
|
||||
this.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.MinimumSize = new System.Drawing.Size(500, 350);
|
||||
this.Name = "StockWorkspacesUC";
|
||||
this.Size = new System.Drawing.Size(989, 539);
|
||||
this.Load += new System.EventHandler(this.StockWorkspacesUC_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.barManagerStockChart)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dockManager1)).EndInit();
|
||||
this.panelContainer1.ResumeLayout(false);
|
||||
this.watchListDockPanel.ResumeLayout(false);
|
||||
this.watchListDockPanel_Container.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.watchListGrid)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.watchListGridView)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
|
||||
this.panelContainerTopVolumesAndTransaction.ResumeLayout(false);
|
||||
this.topVolumesDockPanel.ResumeLayout(false);
|
||||
this.topVolumesDockPanel_Container.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(simpleDiagram2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesLabel3)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesView3)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesLabel4)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(doughnutSeriesView4)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.volumeChart)).EndInit();
|
||||
this.transactionGridDockPanel.ResumeLayout(false);
|
||||
this.transactionGridDockPanel_Container.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.transactionGrid)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.transactionGridView)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit3)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.documentManager1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.noDocumentsView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private XtraBars.BarManager barManagerStockChart;
|
||||
private XtraBars.Bar barWorckspace;
|
||||
private XtraBars.BarDockControl barDockControlTop;
|
||||
private XtraBars.BarDockControl barDockControlBottom;
|
||||
private XtraBars.BarDockControl barDockControlLeft;
|
||||
private XtraBars.BarDockControl barDockControlRight;
|
||||
private XtraBars.BarButtonItem barButtonItem1;
|
||||
private XtraBars.Docking.DockManager dockManager1;
|
||||
private XtraBars.BarSubItem helpBarItemButton;
|
||||
private XtraBars.Docking.DockPanel watchListDockPanel;
|
||||
private XtraBars.Docking.ControlContainer watchListDockPanel_Container;
|
||||
private XtraGrid.GridControl watchListGrid;
|
||||
private XtraGrid.Views.Grid.GridView watchListGridView;
|
||||
private XtraBars.Docking.DockPanel topVolumesDockPanel;
|
||||
private XtraBars.Docking.ControlContainer topVolumesDockPanel_Container;
|
||||
private XtraBars.Docking.DockPanel panelContainerTopVolumesAndTransaction;
|
||||
private XtraCharts.ChartControl volumeChart;
|
||||
private XtraBars.Docking.DockPanel transactionGridDockPanel;
|
||||
private XtraBars.Docking.ControlContainer transactionGridDockPanel_Container;
|
||||
private XtraGrid.GridControl transactionGrid;
|
||||
private XtraGrid.Views.Grid.GridView transactionGridView;
|
||||
private XtraGrid.Views.Grid.GridView gridView1;
|
||||
private XtraGrid.Columns.GridColumn gridColumn1;
|
||||
private XtraGrid.Columns.GridColumn gridColumn2;
|
||||
private XtraGrid.Columns.GridColumn gridColumn3;
|
||||
private StockChartUC stockChartUC;
|
||||
private XtraBars.BarSubItem ViewSubitem;
|
||||
private XtraBars.BarSubItem barSubItem1;
|
||||
private XtraBars.BarCheckItem watchListbarCheckItem;
|
||||
private XtraBars.BarCheckItem transactionGridbarCheckItem;
|
||||
private XtraBars.BarCheckItem topVolumesbarCheckItem;
|
||||
private XtraBars.BarEditItem barEditItem1;
|
||||
private XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit1;
|
||||
private XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit2;
|
||||
private XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit3;
|
||||
private XtraBars.Docking2010.DocumentManager documentManager1;
|
||||
private XtraBars.Docking2010.Views.NoDocuments.NoDocumentsView noDocumentsView1;
|
||||
internal XtraBars.Docking.DockPanel panelContainer1;
|
||||
private XtraBars.BarStaticItem bsiConnectedStatus;
|
||||
private XtraBars.BarButtonItem bbiSwatches;
|
||||
}
|
||||
}
|
||||
300
StockMarketTraderApp/StockWorkspacesUC.cs
Normal file
@@ -0,0 +1,300 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.Customization;
|
||||
using DevExpress.Data;
|
||||
using DevExpress.Skins;
|
||||
using DevExpress.Sparkline;
|
||||
using DevExpress.StockMarketTrader.Model.BusinessObjects;
|
||||
using DevExpress.StockMarketTrader.ViewModel;
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.Utils.About;
|
||||
using DevExpress.XtraBars;
|
||||
using DevExpress.XtraBars.Docking;
|
||||
using DevExpress.XtraCharts;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraEditors.Repository;
|
||||
using DevExpress.XtraGrid;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraGrid.Views.Base;
|
||||
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
||||
|
||||
namespace DevExpress.StockMarketTrader {
|
||||
public partial class StockWorkspacesUC : XtraUserControl {
|
||||
int selectedPiePointIndex = 0;
|
||||
string selectedCompanyName;
|
||||
Color red = Color.Red;
|
||||
Color green = Color.Green;
|
||||
|
||||
public StockWorkspacesUC() {
|
||||
InitializeComponent();
|
||||
UpdateCustomColors();
|
||||
}
|
||||
void UpdateCustomColors() {
|
||||
red = CommonColors.GetCriticalColor(DevExpress.LookAndFeel.UserLookAndFeel.Default);
|
||||
green = CommonColors.GetInformationColor(DevExpress.LookAndFeel.UserLookAndFeel.Default);
|
||||
}
|
||||
void StockWorkspacesUC_Load(object sender, EventArgs e) {
|
||||
if(StockMarketView.defaultViewModel == null)
|
||||
return;
|
||||
StockMarketView.defaultViewModel.CurrentPriceIndexChanged += defaultViewModel_CurrentPriceIndexChanged;
|
||||
StockMarketView.defaultViewModel.PropertyChanged += defaultViewModel_PropertyChanged;
|
||||
//watchList
|
||||
watchListGridView.OptionsBehavior.AutoPopulateColumns = false;
|
||||
watchListGridView.OptionsBehavior.CacheValuesOnRowUpdating = CacheRowValuesMode.Disabled;
|
||||
watchListGrid.MainView.DataController.AllowIEnumerableDetails = false;
|
||||
watchListGridView.FocusRectStyle = XtraGrid.Views.Grid.DrawFocusRectStyle.None;
|
||||
watchListGrid.DataSource = StockMarketView.defaultViewModel.WatchListBindingData;
|
||||
GridColumn col = watchListGridView.Columns.Add();
|
||||
col.FieldName = "CompanyName";
|
||||
col.Caption = "Symbol";
|
||||
col.Visible = true;
|
||||
col = watchListGridView.Columns.Add();
|
||||
col.FieldName = "Price";
|
||||
col.Caption = "Last Price";
|
||||
|
||||
//col.ColumnEdit = new ArrowButtonRepositoryItem();
|
||||
col.DisplayFormat.FormatType = FormatType.Numeric;
|
||||
col.DisplayFormat.FormatString = "c";
|
||||
col.Visible = true;
|
||||
col = watchListGridView.Columns.Add();
|
||||
col.FieldName = "Volume";
|
||||
col.DisplayFormat.FormatType = FormatType.Numeric;
|
||||
col.DisplayFormat.FormatString = "n0";
|
||||
col.Visible = true;
|
||||
col = watchListGridView.Columns.Add();
|
||||
col.FieldName = "Volume Dynamics";
|
||||
RepositoryItemSparklineEdit rise = new RepositoryItemSparklineEdit();
|
||||
col.ColumnEdit = rise;
|
||||
col.UnboundType = Data.UnboundColumnType.Object;
|
||||
AreaSparklineView view = new AreaSparklineView();
|
||||
view.HighlightMaxPoint = true;
|
||||
view.HighlightMinPoint = true;
|
||||
rise.View = view;
|
||||
col.Visible = true;
|
||||
|
||||
|
||||
col = watchListGridView.Columns.Add();
|
||||
col.FieldName = "Rise";
|
||||
col.Name = "Rise";
|
||||
col.Visible = false;
|
||||
|
||||
//col = watchListGridView.Columns.Add();
|
||||
//col.FieldName = "TotalRise";
|
||||
//col.Name = "TotalRise";
|
||||
//col.Visible = false;
|
||||
|
||||
|
||||
//FormatConditionRuleIconSet val = new FormatConditionIconSetPositiveNegativeTriangles() { RangeDescription = "0, >0" };
|
||||
|
||||
//watchListGridView.FormatRules.Add(new GridFormatRule() { Rule = val, Column = watchListGridView.Columns["Rise"], ColumnApplyTo=watchListGridView.Columns[1]});
|
||||
var rule = watchListGridView.FormatRules.AddIconSetRule(watchListGridView.Columns["Rise"], new FormatConditionIconSetPositiveNegativeTriangles() { RangeDescription = "<0, 0, >0" });
|
||||
rule.ColumnApplyTo = watchListGridView.Columns[1];
|
||||
rule.Enabled = true;
|
||||
|
||||
|
||||
watchListGridView.BestFitColumns();
|
||||
watchListGridView.FocusedRowChanged += new XtraGrid.Views.Base.FocusedRowChangedEventHandler(watchListGridView_FocusedRowChanged);
|
||||
//watchListGridView.CustomDrawCell += watchListGridView_CustomDrawCell;
|
||||
watchListGridView.CustomUnboundColumnData += watchListGridView_CustomUnboundColumnData;
|
||||
|
||||
//chart
|
||||
stockChartUC.stockChart.Series["Price"].DataSource = StockMarketView.defaultViewModel.StockChartBindingData;
|
||||
stockChartUC.stockChart.Series["Price"].ArgumentDataMember = "Date";
|
||||
stockChartUC.stockChart.Series["Price"].ValueDataMembers.AddRange(new string[] { "Low", "High", "Open", "Close" });
|
||||
|
||||
stockChartUC.stockChart.Series["Volume"].DataSource = StockMarketView.defaultViewModel.StockChartBindingData;
|
||||
stockChartUC.stockChart.Series["Volume"].ArgumentDataMember = "Date";
|
||||
stockChartUC.stockChart.Series["Volume"].ValueDataMembers.AddRange(new string[] { "Volume" });
|
||||
//volumeChart
|
||||
volumeChart.Series[0].DataSource = StockMarketView.defaultViewModel.VolumeChartBindingData;
|
||||
volumeChart.Series[0].ArgumentDataMember = "CompanyName";
|
||||
volumeChart.Series[0].ToolTipPointPattern = "Argument: {A}
Value: {V}";
|
||||
volumeChart.Series[0].ValueDataMembers.AddRange(new string[] { "Volume" });
|
||||
|
||||
//transationsGrid
|
||||
transactionGridView.OptionsBehavior.AutoPopulateColumns = false;
|
||||
transactionGrid.DataSource = StockMarketView.defaultViewModel.TransactionGridBindingData;
|
||||
var fceAsk = new FormatConditionRuleExpression() { Expression = "Ask > 0", PredefinedName = "Red Fill" };
|
||||
transactionGridView.FormatRules.AddRule(new GridFormatRule() { ApplyToRow = true, Rule = fceAsk });
|
||||
|
||||
var fceBid = new FormatConditionRuleExpression() { Expression = "Bid > 0", PredefinedName = "Green Fill" };
|
||||
transactionGridView.FormatRules.AddRule(new GridFormatRule() { ApplyToRow = true, Rule = fceBid });
|
||||
|
||||
StockMarketView.defaultViewModel.WatchListChanged += defaultViewModel_WatchListChanged;
|
||||
|
||||
helpBarItemButton.ImageOptions.SvgImage = SvgResources.GetSvgImage("Help");
|
||||
bbiSwatches.ImageOptions.SvgImage = SvgResources.GetSvgImage("Swatches");
|
||||
bsiConnectedStatus.ImageOptions.SvgImage = SvgResources.GetSvgImage("Connected");
|
||||
}
|
||||
void defaultViewModel_WatchListChanged(object sender, EventArgs e) {
|
||||
watchListGridView.RefreshData();
|
||||
}
|
||||
void UpdateNetworkState() {
|
||||
bsiConnectedStatus.Caption = StockMarketView.defaultViewModel.NetworkState;
|
||||
}
|
||||
void defaultViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) {
|
||||
if(e.PropertyName == "NetworkState" && FindForm() != null) {
|
||||
this.FindForm().BeginInvoke(new MethodInvoker(UpdateNetworkState), new object[] { });
|
||||
}
|
||||
}
|
||||
void OnVolumeChartBoundDataChanged(object sender, EventArgs e) {
|
||||
if(volumeChart.Series[0].Points.Count > 0 && selectedPiePointIndex != -1 && volumeChart.Series[0].Points.Count > selectedPiePointIndex) {
|
||||
DoughnutSeriesView view = volumeChart.Series[0].View as DoughnutSeriesView;
|
||||
for(int i = 0; i < volumeChart.Series[0].Points.Count; i++) {
|
||||
if(selectedCompanyName == volumeChart.Series[0].Points[i].Argument.ToString()) {
|
||||
ExplodePoint(volumeChart.Series[0].Points[i], view);
|
||||
selectedPiePointIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//void watchListGridView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
|
||||
// if(StockMarketView.defaultViewModel == null)
|
||||
// return;
|
||||
// GridCellInfo info = e.Cell as GridCellInfo;
|
||||
// if(info == null)
|
||||
// return;
|
||||
// CompanyTradingDataViewModel rowData = watchListGridView.GetRow(e.RowHandle) as CompanyTradingDataViewModel;
|
||||
// ArrowButtonRepositoryItem arrowb = info.Editor as ArrowButtonRepositoryItem;
|
||||
// if(info.Column.FieldName == "Price" && arrowb != null) {
|
||||
// arrowb.ContextImageOptions.SvgImage = SvgResources.GetSvgImage(rowData.Rise == 0 ? "Up" : "Down");
|
||||
// info.ViewInfo.DetailLevel = XtraEditors.Controls.DetailLevel.Full;
|
||||
// info.ViewInfo.CalcViewInfo();
|
||||
// }
|
||||
//}
|
||||
void defaultViewModel_CurrentPriceIndexChanged(object sender, EventArgs e) {
|
||||
if(StockMarketView.defaultViewModel == null) return;
|
||||
transactionGridView.FocusedRowHandle = StockMarketView.defaultViewModel.CurrentPriceIndex;
|
||||
}
|
||||
void watchListGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e) {
|
||||
StockMarketView.defaultViewModel.SelectedCompany = watchListGridView.GetFocusedRow() as CompanyTradingDataViewModel;
|
||||
selectedCompanyName = StockMarketView.defaultViewModel.SelectedCompany.CompanyName;
|
||||
SeriesPoint sPoint = FindSeriesPointByName(StockMarketView.defaultViewModel.SelectedCompany.CompanyName);
|
||||
DoughnutSeriesView view = volumeChart.Series[0].View as DoughnutSeriesView;
|
||||
if(sPoint != null && view != null)
|
||||
ExplodePoint(sPoint, view);
|
||||
else
|
||||
view.ExplodedPoints.Clear();
|
||||
}
|
||||
//void transactionGridView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
|
||||
// if(StockMarketView.defaultViewModel == null)
|
||||
// return;
|
||||
// double cellValue = -1;
|
||||
// GridCellInfo info = e.Cell as GridCellInfo;
|
||||
// if(info == null)
|
||||
// return;
|
||||
// double.TryParse(e.CellValue.ToString(), out cellValue);
|
||||
// if(cellValue != -1) {
|
||||
// if(cellValue == 0) {
|
||||
// info.Appearance.ForeColor = e.Appearance.BackColor;
|
||||
// return;
|
||||
// }
|
||||
// TransactionData rowData = transactionGridView.GetRow(e.RowHandle) as TransactionData;
|
||||
// if(rowData.TransactionType == "Ask")
|
||||
// info.Appearance.ForeColor = green;
|
||||
// else info.Appearance.ForeColor = red;
|
||||
// }
|
||||
//}
|
||||
void volumeChart_MouseDown(object sender, MouseEventArgs e) {
|
||||
SeriesPoint seriesPoint = volumeChart.CalcHitInfo(e.Location).SeriesPoint;
|
||||
DoughnutSeriesView view = volumeChart.Series[0].View as DoughnutSeriesView;
|
||||
if(seriesPoint == null || view == null)
|
||||
return;
|
||||
ExplodePoint(seriesPoint, view);
|
||||
int rowH = GetRowHandleByCompanyName(selectedCompanyName);
|
||||
if(rowH >= 0) watchListGridView.FocusedRowHandle = rowH;
|
||||
}
|
||||
void ExplodePoint(SeriesPoint seriesPoint, DoughnutSeriesView view) {
|
||||
view.ExplodedPoints.Clear();
|
||||
view.ExplodedPoints.Add(seriesPoint);
|
||||
selectedCompanyName = seriesPoint.Argument.ToString();
|
||||
}
|
||||
void volumeChart_ObjectHotTracked(object sender, HotTrackEventArgs e) {
|
||||
if(e.Object is DevExpress.XtraCharts.Series)
|
||||
return;
|
||||
e.Cancel = true;
|
||||
}
|
||||
void volumeChart_ObjectSelected(object sender, HotTrackEventArgs e) {
|
||||
if(e.Object is DevExpress.XtraCharts.Series)
|
||||
return;
|
||||
e.Cancel = true;
|
||||
}
|
||||
void PanelsCheckedChanged(object sender, XtraBars.ItemClickEventArgs e) {
|
||||
BarCheckItem item = e.Item as BarCheckItem;
|
||||
if(item == null) return;
|
||||
SetDockPanelVisibility(item);
|
||||
}
|
||||
void SetDockPanelVisibility(BarCheckItem item) {
|
||||
switch(item.Caption) {
|
||||
case "Watch List":
|
||||
if(!item.Checked)
|
||||
watchListDockPanel.Visibility = XtraBars.Docking.DockVisibility.Hidden;
|
||||
else
|
||||
watchListDockPanel.Visibility = XtraBars.Docking.DockVisibility.Visible;
|
||||
break;
|
||||
case "Transaction":
|
||||
if(!item.Checked)
|
||||
transactionGridDockPanel.Visibility = XtraBars.Docking.DockVisibility.Hidden;
|
||||
else
|
||||
transactionGridDockPanel.Visibility = XtraBars.Docking.DockVisibility.Visible;
|
||||
break;
|
||||
case "Top Volumes":
|
||||
if(!item.Checked)
|
||||
topVolumesDockPanel.Visibility = XtraBars.Docking.DockVisibility.Hidden;
|
||||
else
|
||||
topVolumesDockPanel.Visibility = XtraBars.Docking.DockVisibility.Visible;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void watchListDockPanel_ClosedPanel(object sender, DockPanelEventArgs e) {
|
||||
watchListbarCheckItem.Checked = false;
|
||||
}
|
||||
void topVolumesDockPanel_ClosedPanel(object sender, DockPanelEventArgs e) {
|
||||
topVolumesbarCheckItem.Checked = false;
|
||||
}
|
||||
void transactionGridDockPanel_ClosedPanel(object sender, DockPanelEventArgs e) {
|
||||
transactionGridbarCheckItem.Checked = false;
|
||||
}
|
||||
void panelContainerTopVolumesAndTransaction_ClosedPanel(object sender, DockPanelEventArgs e) {
|
||||
transactionGridbarCheckItem.Checked = false;
|
||||
topVolumesbarCheckItem.Checked = false;
|
||||
}
|
||||
void watchListGridView_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e) {
|
||||
if(e.IsGetData) {
|
||||
CompanyTradingDataViewModel model = e.Row as CompanyTradingDataViewModel;
|
||||
if(model != null && model.VolumeDynamics != null) {
|
||||
List<double> values = new List<double>();
|
||||
foreach(TradingDataViewModel dynamicItem in model.VolumeDynamics)
|
||||
values.Add(dynamicItem.Volume);
|
||||
e.Value = values;
|
||||
}
|
||||
}
|
||||
}
|
||||
SeriesPoint FindSeriesPointByName(string name) {
|
||||
for(int i = 0; i < volumeChart.Series[0].Points.Count; i++) {
|
||||
if(name == volumeChart.Series[0].Points[i].Argument.ToString())
|
||||
return volumeChart.Series[0].Points[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
protected int GetRowHandleByCompanyName(string name) {
|
||||
for(int i = 0; i < watchListGridView.RowCount; i++) {
|
||||
if(watchListGridView.GetRow(i) != null && ((CompanyTradingDataViewModel)watchListGridView.GetRow(i)).CompanyName == name) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
void bbiSwatches_ItemClick(object sender, ItemClickEventArgs e) {
|
||||
using(SvgSkinPaletteSelector svgSkinPaletteSelector = new SvgSkinPaletteSelector(this.FindForm())) {
|
||||
svgSkinPaletteSelector.ShowDialog();
|
||||
}
|
||||
UpdateCustomColors();
|
||||
}
|
||||
void helpBarItemButton_ItemClick(object sender, ItemClickEventArgs e) {
|
||||
AboutHelper.Show(ProductKind.DXperienceWin, new ProductStringInfoWin("Stock Market Trader Demo"));
|
||||
}
|
||||
}
|
||||
}
|
||||
132
StockMarketTraderApp/StockWorkspacesUC.resx
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="barManagerStockChart.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="dockManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>194, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>103</value>
|
||||
</metadata>
|
||||
<metadata name="documentManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>327, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
158
StockMarketTraderApp/Tiles/TileChart.Designer.cs
generated
Normal file
@@ -0,0 +1,158 @@
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
partial class TileChart {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
DevExpress.Sparkline.AreaSparklineView areaSparklineView1 = new DevExpress.Sparkline.AreaSparklineView();
|
||||
this.sparklineEdit1 = new DevExpress.XtraEditors.SparklineEdit();
|
||||
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
|
||||
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
|
||||
this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
|
||||
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
|
||||
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.sparklineEdit1.Properties)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
|
||||
this.layoutControl1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// sparklineEdit1
|
||||
//
|
||||
this.sparklineEdit1.Location = new System.Drawing.Point(0, 0);
|
||||
this.sparklineEdit1.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.sparklineEdit1.Name = "sparklineEdit1";
|
||||
this.sparklineEdit1.Properties.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(139)))), ((int)(((byte)(10)))));
|
||||
this.sparklineEdit1.Properties.Appearance.Options.UseBackColor = true;
|
||||
this.sparklineEdit1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
areaSparklineView1.AreaOpacity = ((byte)(60));
|
||||
areaSparklineView1.Color = System.Drawing.Color.White;
|
||||
this.sparklineEdit1.Properties.View = areaSparklineView1;
|
||||
this.sparklineEdit1.Size = new System.Drawing.Size(248, 77);
|
||||
this.sparklineEdit1.StyleController = this.layoutControl1;
|
||||
this.sparklineEdit1.TabIndex = 0;
|
||||
//
|
||||
// layoutControl1
|
||||
//
|
||||
this.layoutControl1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(139)))), ((int)(((byte)(10)))));
|
||||
this.layoutControl1.Controls.Add(this.sparklineEdit1);
|
||||
this.layoutControl1.Controls.Add(this.labelControl1);
|
||||
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.layoutControl1.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.layoutControl1.Name = "layoutControl1";
|
||||
this.layoutControl1.Root = this.layoutControlGroup1;
|
||||
this.layoutControl1.Size = new System.Drawing.Size(248, 120);
|
||||
this.layoutControl1.TabIndex = 3;
|
||||
this.layoutControl1.Text = "layoutControl1";
|
||||
//
|
||||
// labelControl1
|
||||
//
|
||||
this.labelControl1.AllowHtmlString = true;
|
||||
this.labelControl1.Appearance.Font = new System.Drawing.Font("Segoe UI", 10F);
|
||||
this.labelControl1.Appearance.ForeColor = System.Drawing.Color.White;
|
||||
this.labelControl1.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
|
||||
this.labelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
|
||||
this.labelControl1.Location = new System.Drawing.Point(2, 81);
|
||||
this.labelControl1.Name = "labelControl1";
|
||||
this.labelControl1.Padding = new System.Windows.Forms.Padding(0, 0, 8, 3);
|
||||
this.labelControl1.Size = new System.Drawing.Size(244, 37);
|
||||
this.labelControl1.StyleController = this.layoutControl1;
|
||||
this.labelControl1.TabIndex = 4;
|
||||
this.labelControl1.Text = "labelControl1<br>1,7";
|
||||
//
|
||||
// layoutControlGroup1
|
||||
//
|
||||
this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
|
||||
this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.layoutControlGroup1.GroupBordersVisible = false;
|
||||
this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
|
||||
this.layoutControlItem1,
|
||||
this.layoutControlItem2});
|
||||
this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
|
||||
this.layoutControlGroup1.Name = "layoutControlGroup1";
|
||||
this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
|
||||
this.layoutControlGroup1.Size = new System.Drawing.Size(248, 120);
|
||||
this.layoutControlGroup1.Text = "layoutControlGroup1";
|
||||
this.layoutControlGroup1.TextVisible = false;
|
||||
//
|
||||
// layoutControlItem1
|
||||
//
|
||||
this.layoutControlItem1.Control = this.labelControl1;
|
||||
this.layoutControlItem1.ControlAlignment = System.Drawing.ContentAlignment.BottomRight;
|
||||
this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
|
||||
this.layoutControlItem1.FillControlToClientArea = false;
|
||||
this.layoutControlItem1.Location = new System.Drawing.Point(0, 77);
|
||||
this.layoutControlItem1.MinSize = new System.Drawing.Size(67, 43);
|
||||
this.layoutControlItem1.Name = "layoutControlItem1";
|
||||
this.layoutControlItem1.Size = new System.Drawing.Size(248, 43);
|
||||
this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
|
||||
this.layoutControlItem1.Text = "layoutControlItem1";
|
||||
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
|
||||
this.layoutControlItem1.TextToControlDistance = 0;
|
||||
this.layoutControlItem1.TextVisible = false;
|
||||
this.layoutControlItem1.TrimClientAreaToControl = false;
|
||||
//
|
||||
// layoutControlItem2
|
||||
//
|
||||
this.layoutControlItem2.Control = this.sparklineEdit1;
|
||||
this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
|
||||
this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
|
||||
this.layoutControlItem2.MinSize = new System.Drawing.Size(1, 1);
|
||||
this.layoutControlItem2.Name = "layoutControlItem2";
|
||||
this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
|
||||
this.layoutControlItem2.Size = new System.Drawing.Size(248, 77);
|
||||
this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
|
||||
this.layoutControlItem2.Text = "layoutControlItem2";
|
||||
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
|
||||
this.layoutControlItem2.TextToControlDistance = 0;
|
||||
this.layoutControlItem2.TextVisible = false;
|
||||
//
|
||||
// TileChart
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.layoutControl1);
|
||||
this.Name = "TileChart";
|
||||
this.Size = new System.Drawing.Size(248, 120);
|
||||
((System.ComponentModel.ISupportInitialize)(this.sparklineEdit1.Properties)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
|
||||
this.layoutControl1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private XtraEditors.SparklineEdit sparklineEdit1;
|
||||
private XtraLayout.LayoutControl layoutControl1;
|
||||
private XtraEditors.LabelControl labelControl1;
|
||||
private XtraLayout.LayoutControlGroup layoutControlGroup1;
|
||||
private XtraLayout.LayoutControlItem layoutControlItem1;
|
||||
private XtraLayout.LayoutControlItem layoutControlItem2;
|
||||
}
|
||||
}
|
||||
28
StockMarketTraderApp/Tiles/TileChart.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
public partial class TileChart : UserControl {
|
||||
public TileChart(Size size) {
|
||||
InitializeComponent();
|
||||
this.Size = size;
|
||||
sparklineEdit1.Properties.DataSource = StockMarketView.defaultViewModel.SparklineTileViewModel.Source;
|
||||
sparklineEdit1.Properties.PointValueMember = "Price";
|
||||
sparklineEdit1.EditValue = sparklineEdit1.Properties.DataSource;
|
||||
string arrow = StockMarketView.defaultViewModel.SparklineTileViewModel.Arrow;
|
||||
string company = StockMarketView.defaultViewModel.SparklineTileViewModel.CompanyIndex;
|
||||
string percent = StockMarketView.defaultViewModel.SparklineTileViewModel.Persent;
|
||||
string result = String.Format("<size=-2>{0}</size><br>{1} {2}", company, arrow, percent);
|
||||
labelControl1.Text = result;
|
||||
if(size.Width == size.Height) {
|
||||
layoutControlItem1.ContentVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StockMarketTraderApp/Tiles/TileChart.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
40
StockMarketTraderApp/Tiles/TileChartMedium.Designer.cs
generated
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
partial class TileChartMedium {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// TileChartMedium
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Name = "TileChartMedium";
|
||||
this.Size = new System.Drawing.Size(120, 120);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
16
StockMarketTraderApp/Tiles/TileChartMedium.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
public partial class TileChartMedium : UserControl {
|
||||
public TileChartMedium() {
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StockMarketTraderApp/Tiles/TileChartMedium.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
188
StockMarketTraderApp/Tiles/TileTop3Companies.Designer.cs
generated
Normal file
@@ -0,0 +1,188 @@
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
partial class TileTop3Companies {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
|
||||
this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
|
||||
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
|
||||
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
|
||||
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
|
||||
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
|
||||
this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
|
||||
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
|
||||
this.layoutControl1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// layoutControl1
|
||||
//
|
||||
this.layoutControl1.Controls.Add(this.labelControl1);
|
||||
this.layoutControl1.Controls.Add(this.labelControl2);
|
||||
this.layoutControl1.Controls.Add(this.labelControl3);
|
||||
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.layoutControl1.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.layoutControl1.Name = "layoutControl1";
|
||||
this.layoutControl1.Root = this.layoutControlGroup1;
|
||||
this.layoutControl1.Size = new System.Drawing.Size(248, 120);
|
||||
this.layoutControl1.TabIndex = 0;
|
||||
this.layoutControl1.Text = "layoutControl1";
|
||||
//
|
||||
// layoutControlGroup1
|
||||
//
|
||||
this.layoutControlGroup1.CaptionImagePadding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
|
||||
this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
|
||||
this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.layoutControlGroup1.GroupBordersVisible = false;
|
||||
this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
|
||||
this.layoutControlItem3,
|
||||
this.layoutControlItem1,
|
||||
this.layoutControlItem2});
|
||||
this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
|
||||
this.layoutControlGroup1.Name = "layoutControlGroup1";
|
||||
this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
|
||||
this.layoutControlGroup1.Size = new System.Drawing.Size(248, 120);
|
||||
this.layoutControlGroup1.Text = "layoutControlGroup1";
|
||||
this.layoutControlGroup1.TextVisible = false;
|
||||
//
|
||||
// labelControl1
|
||||
//
|
||||
this.labelControl1.AllowHtmlString = true;
|
||||
this.labelControl1.Appearance.Font = new System.Drawing.Font("Segoe UI", 12F);
|
||||
this.labelControl1.Appearance.ForeColor = System.Drawing.Color.White;
|
||||
this.labelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
|
||||
this.labelControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.labelControl1.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.labelControl1.Name = "labelControl1";
|
||||
this.labelControl1.Padding = new System.Windows.Forms.Padding(16, 20, 0, 0);
|
||||
this.labelControl1.Size = new System.Drawing.Size(82, 71);
|
||||
this.labelControl1.StyleController = this.layoutControl1;
|
||||
this.labelControl1.TabIndex = 4;
|
||||
this.labelControl1.Text = "MSFT<br><size=-3>dfa<br>fwe";
|
||||
//
|
||||
// layoutControlItem1
|
||||
//
|
||||
this.layoutControlItem1.Control = this.labelControl1;
|
||||
this.layoutControlItem1.CustomizationFormText = "MSFT<br><size=-3>dfa<br>fwe";
|
||||
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
|
||||
this.layoutControlItem1.Name = "layoutControlItem1";
|
||||
this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
|
||||
this.layoutControlItem1.Size = new System.Drawing.Size(82, 120);
|
||||
this.layoutControlItem1.Text = "MSFT<br><size=-3>dfa<br>fwe";
|
||||
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
|
||||
this.layoutControlItem1.TextToControlDistance = 0;
|
||||
this.layoutControlItem1.TextVisible = false;
|
||||
//
|
||||
// labelControl2
|
||||
//
|
||||
this.labelControl2.AllowHtmlString = true;
|
||||
this.labelControl2.Appearance.Font = new System.Drawing.Font("Segoe UI", 12F);
|
||||
this.labelControl2.Appearance.ForeColor = System.Drawing.Color.White;
|
||||
this.labelControl2.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
|
||||
this.labelControl2.Location = new System.Drawing.Point(82, 0);
|
||||
this.labelControl2.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.labelControl2.Name = "labelControl2";
|
||||
this.labelControl2.Padding = new System.Windows.Forms.Padding(20, 20, 0, 0);
|
||||
this.labelControl2.Size = new System.Drawing.Size(83, 71);
|
||||
this.labelControl2.StyleController = this.layoutControl1;
|
||||
this.labelControl2.TabIndex = 5;
|
||||
this.labelControl2.Text = "MSFT<br><size=-3>dfa<br>fwe";
|
||||
//
|
||||
// layoutControlItem2
|
||||
//
|
||||
this.layoutControlItem2.Control = this.labelControl2;
|
||||
this.layoutControlItem2.CustomizationFormText = "MSFT<br><size=-3>dfa<br>fwe";
|
||||
this.layoutControlItem2.Location = new System.Drawing.Point(82, 0);
|
||||
this.layoutControlItem2.Name = "layoutControlItem2";
|
||||
this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
|
||||
this.layoutControlItem2.Size = new System.Drawing.Size(83, 120);
|
||||
this.layoutControlItem2.Text = "MSFT<br><size=-3>dfa<br>fwe";
|
||||
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
|
||||
this.layoutControlItem2.TextToControlDistance = 0;
|
||||
this.layoutControlItem2.TextVisible = false;
|
||||
//
|
||||
// labelControl3
|
||||
//
|
||||
this.labelControl3.AllowHtmlString = true;
|
||||
this.labelControl3.Appearance.Font = new System.Drawing.Font("Segoe UI", 12F);
|
||||
this.labelControl3.Appearance.ForeColor = System.Drawing.Color.White;
|
||||
this.labelControl3.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
|
||||
this.labelControl3.Location = new System.Drawing.Point(165, 0);
|
||||
this.labelControl3.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.labelControl3.Name = "labelControl3";
|
||||
this.labelControl3.Padding = new System.Windows.Forms.Padding(26, 20, 0, 0);
|
||||
this.labelControl3.Size = new System.Drawing.Size(83, 71);
|
||||
this.labelControl3.StyleController = this.layoutControl1;
|
||||
this.labelControl3.TabIndex = 1;
|
||||
this.labelControl3.Text = "MSFT<br><size=-3>dfa<br>fwe";
|
||||
//
|
||||
// layoutControlItem3
|
||||
//
|
||||
this.layoutControlItem3.Control = this.labelControl3;
|
||||
this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
|
||||
this.layoutControlItem3.Location = new System.Drawing.Point(165, 0);
|
||||
this.layoutControlItem3.Name = "layoutControlItem3";
|
||||
this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
|
||||
this.layoutControlItem3.Size = new System.Drawing.Size(83, 120);
|
||||
this.layoutControlItem3.Text = "layoutControlItem3";
|
||||
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
|
||||
this.layoutControlItem3.TextToControlDistance = 0;
|
||||
this.layoutControlItem3.TextVisible = false;
|
||||
//
|
||||
// TileTop3Companies
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(139)))), ((int)(((byte)(10)))));
|
||||
this.Controls.Add(this.layoutControl1);
|
||||
this.Name = "TileTop3Companies";
|
||||
this.Size = new System.Drawing.Size(248, 120);
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
|
||||
this.layoutControl1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private XtraLayout.LayoutControl layoutControl1;
|
||||
private XtraEditors.LabelControl labelControl1;
|
||||
private XtraEditors.LabelControl labelControl2;
|
||||
private XtraEditors.LabelControl labelControl3;
|
||||
private XtraLayout.LayoutControlGroup layoutControlGroup1;
|
||||
private XtraLayout.LayoutControlItem layoutControlItem3;
|
||||
private XtraLayout.LayoutControlItem layoutControlItem1;
|
||||
private XtraLayout.LayoutControlItem layoutControlItem2;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
37
StockMarketTraderApp/Tiles/TileTop3Companies.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.StockMarketTrader.ViewModel;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraLayout;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
public partial class TileTop3Companies : UserControl {
|
||||
public TileTop3Companies(Size size) {
|
||||
InitializeComponent();
|
||||
this.Size = size;
|
||||
List<LiveTileViewModel> companies = new List<LiveTileViewModel>() { StockMarketView.defaultViewModel.TopThreeCompanies[0],
|
||||
StockMarketView.defaultViewModel.TopThreeCompanies[1],
|
||||
StockMarketView.defaultViewModel.TopThreeCompanies[2] };
|
||||
List<LabelControl> labels = new List<LabelControl>() { labelControl1, labelControl2, labelControl3 };
|
||||
for(int i = 0; i < 3; i++) {
|
||||
string company = companies[i].CompanyIndex;
|
||||
string arrow = companies[i].Arrow;
|
||||
string percent = companies[i].Persent;
|
||||
string priceincreace = companies[i].PriceIncrease;
|
||||
string result = String.Format("{0}<br><size=-3>{1} {2}<br>{3} {4}", company, arrow, percent, arrow, priceincreace);
|
||||
labels[i].Text = result;
|
||||
}
|
||||
if(size.Height == size.Width) {
|
||||
layoutControlItem2.ContentVisible = false;
|
||||
layoutControlItem3.ContentVisible = false;
|
||||
layoutControlItem1.Width += 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StockMarketTraderApp/Tiles/TileTop3Companies.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
40
StockMarketTraderApp/Tiles/TileTop3CompaniesMedium.Designer.cs
generated
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
partial class TileTop3CompaniesMedium {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// TileTop3CompaniesMedium
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Name = "TileTop3CompaniesMedium";
|
||||
this.Size = new System.Drawing.Size(120, 120);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
16
StockMarketTraderApp/Tiles/TileTop3CompaniesMedium.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
public partial class TileTop3CompaniesMedium : UserControl {
|
||||
public TileTop3CompaniesMedium() {
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StockMarketTraderApp/Tiles/TileTop3CompaniesMedium.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
74
StockMarketTraderApp/Tiles/ucPinButton.Designer.cs
generated
Normal file
@@ -0,0 +1,74 @@
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
partial class ucPinButton {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(196, 0);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(38, 40);
|
||||
this.pictureBox1.TabIndex = 0;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// labelControl1
|
||||
//
|
||||
this.labelControl1.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.labelControl1.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
|
||||
this.labelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
|
||||
this.labelControl1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.labelControl1.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.labelControl1.Location = new System.Drawing.Point(37, 0);
|
||||
this.labelControl1.Name = "labelControl1";
|
||||
this.labelControl1.Padding = new System.Windows.Forms.Padding(0, 12, 10, 0);
|
||||
this.labelControl1.Size = new System.Drawing.Size(159, 38);
|
||||
this.labelControl1.TabIndex = 1;
|
||||
this.labelControl1.Text = "Press this button to add a live tile to your start screen";
|
||||
//
|
||||
// ucPinButton
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Controls.Add(this.labelControl1);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Name = "ucPinButton";
|
||||
this.Size = new System.Drawing.Size(234, 40);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private XtraEditors.LabelControl labelControl1;
|
||||
}
|
||||
}
|
||||
43
StockMarketTraderApp/Tiles/ucPinButton.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.Tiles {
|
||||
public partial class ucPinButton : UserControl {
|
||||
Font underline;
|
||||
Font noUnderline;
|
||||
public ucPinButton() {
|
||||
InitializeComponent();
|
||||
labelControl1.Appearance.ForeColor = Color.White;
|
||||
pictureBox1.Image = Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream(@"DevExpress.StockMarketTrader.Images.Live-Tile.png"));
|
||||
labelControl1.MouseEnter += new EventHandler(labelControl1_MouseEnter);
|
||||
labelControl1.MouseLeave += new EventHandler(labelControl1_MouseLeave);
|
||||
pictureBox1.MouseEnter += new EventHandler(labelControl1_MouseEnter);
|
||||
pictureBox1.MouseLeave += new EventHandler(labelControl1_MouseLeave);
|
||||
labelControl1.Click += new EventHandler(labelControl1_Click);
|
||||
pictureBox1.Click += new EventHandler(labelControl1_Click);
|
||||
underline = new Font(labelControl1.Font, FontStyle.Underline);
|
||||
noUnderline = new Font(labelControl1.Font, FontStyle.Regular);
|
||||
}
|
||||
public event EventHandler OnButtonClick;
|
||||
void labelControl1_Click(object sender, EventArgs e) {
|
||||
if(OnButtonClick != null) OnButtonClick(this, e);
|
||||
}
|
||||
|
||||
void labelControl1_MouseLeave(object sender, EventArgs e) {
|
||||
labelControl1.Appearance.ForeColor = Color.White;
|
||||
labelControl1.Appearance.Font = noUnderline;
|
||||
}
|
||||
|
||||
void labelControl1_MouseEnter(object sender, EventArgs e) {
|
||||
labelControl1.Appearance.ForeColor = Color.DarkOrange;
|
||||
labelControl1.Appearance.Font = underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StockMarketTraderApp/Tiles/ucPinButton.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
115
StockMarketTraderApp/ViewModel/BusinessObjectsViewModel.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using DevExpress.StockMarketTrader.Model.BusinessObjects;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.ViewModel {
|
||||
public class TradingDataViewModel : ViewModelBase {
|
||||
readonly TradingData tradingData;
|
||||
|
||||
public DateTime Date {
|
||||
get { return TradingData.Date; }
|
||||
set {
|
||||
TradingData.Date = value;
|
||||
OnPropertyChanged("Date");
|
||||
}
|
||||
}
|
||||
public double Price {
|
||||
get { return TradingData.Price; }
|
||||
set {
|
||||
TradingData.Price = value;
|
||||
OnPropertyChanged("Price");
|
||||
}
|
||||
}
|
||||
public double Open {
|
||||
get { return TradingData.Open; }
|
||||
set {
|
||||
TradingData.Open = value;
|
||||
OnPropertyChanged("Open");
|
||||
}
|
||||
}
|
||||
public double Close {
|
||||
get { return TradingData.Close; }
|
||||
set {
|
||||
TradingData.Close = value;
|
||||
OnPropertyChanged("Close");
|
||||
}
|
||||
}
|
||||
public double High {
|
||||
get { return TradingData.High; }
|
||||
set {
|
||||
TradingData.High = value;
|
||||
OnPropertyChanged("High");
|
||||
}
|
||||
}
|
||||
public double Low {
|
||||
get { return TradingData.Low; }
|
||||
set {
|
||||
TradingData.Low = value;
|
||||
OnPropertyChanged("Low");
|
||||
}
|
||||
}
|
||||
public double Volume {
|
||||
get { return TradingData.Volume; }
|
||||
set {
|
||||
TradingData.Volume = value;
|
||||
OnPropertyChanged("Volume");
|
||||
}
|
||||
}
|
||||
public TradingData TradingData { get { return tradingData; } }
|
||||
|
||||
public TradingDataViewModel() {
|
||||
tradingData = new TradingData();
|
||||
}
|
||||
public TradingDataViewModel(TradingData data) : this() {
|
||||
Assign(data);
|
||||
}
|
||||
public TradingDataViewModel(DateTime dateTime) : this() {
|
||||
this.Date = dateTime;
|
||||
}
|
||||
public void Assign(TradingData data) {
|
||||
tradingData.Assign(data);
|
||||
OnPropertyChanged("Price");
|
||||
OnPropertyChanged("Volume");
|
||||
}
|
||||
}
|
||||
|
||||
public class CompanyTradingDataViewModel : TradingDataViewModel {
|
||||
int rise;
|
||||
LockableCollection<TradingDataViewModel> volumeDynamics;
|
||||
|
||||
double totalRise;
|
||||
public double TotalRise {
|
||||
get {
|
||||
return totalRise;
|
||||
}
|
||||
set {
|
||||
totalRise = value;
|
||||
OnPropertyChanged("TotalRise");
|
||||
}
|
||||
}
|
||||
public string CompanyName { get; private set; }
|
||||
public int Rise {
|
||||
get { return rise; }
|
||||
set {
|
||||
rise = value;
|
||||
OnPropertyChanged("Rise");
|
||||
}
|
||||
}
|
||||
public LockableCollection<TradingDataViewModel> VolumeDynamics {
|
||||
get { return volumeDynamics; }
|
||||
set {
|
||||
volumeDynamics = value;
|
||||
OnPropertyChanged("VolumeDynamics");
|
||||
}
|
||||
}
|
||||
|
||||
public CompanyTradingDataViewModel(TradingData data, string companyName, int rise, double totalRise) : base(data) {
|
||||
CompanyName = companyName;
|
||||
TotalRise = totalRise;
|
||||
Rise = rise;
|
||||
}
|
||||
public void Assign(CompanyTradingData ctd) {
|
||||
CompanyName = ctd.CompanyName;
|
||||
base.Assign(ctd);
|
||||
}
|
||||
}
|
||||
}
|
||||
677
StockMarketTraderApp/ViewModel/RealTimeDataViewModel.cs
Normal file
@@ -0,0 +1,677 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.StockMarketTrader.Model;
|
||||
using DevExpress.StockMarketTrader.Model.BusinessObjects;
|
||||
using DevExpress.StockMarketTrader.StockDataServiceReference;
|
||||
using Application = System.Windows.Forms.Application;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.ViewModel {
|
||||
public class RealTimeDataViewModel : ViewModelBase {
|
||||
public static bool IsReady = false;
|
||||
protected static void InvokeSync(Delegate method) {
|
||||
if (method != null && Application.OpenForms.Count > 0) {
|
||||
for(int i = 0; i < Application.OpenForms.Count; i++) {
|
||||
Form form = Application.OpenForms[i];
|
||||
if(form is StockMarketView)
|
||||
form.Invoke(method, new object[] { });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object sem = new object();
|
||||
string selectedCompanyName = "MSFT";
|
||||
int volumeCount = 15;
|
||||
int countOfWeek = 1;
|
||||
int candlesCount = 72, currentDate = 0, tickCount = 0, offlineTimeInterval = 500, totalTicks = 5;
|
||||
bool isAllBindingDataUpdate = false, canEndUpdate = true, canUpdate = true;
|
||||
double highestPrice = 0, lowestPrice = 0;
|
||||
public RealTimeDataModel model;
|
||||
Dictionary<string, Queue<Delegate>> defferedUpdate = new Dictionary<string, Queue<Delegate>>();
|
||||
List<DateTime> dates;
|
||||
List<string> companies;
|
||||
LockableCollection<TransactionData> transactionGridBindingData;
|
||||
LockableCollection<CompanyTradingDataViewModel> watchLisBindingData;
|
||||
BindingList<CompaniesVolumeData> volumeChartBindingData;
|
||||
BindingList<TradingDataViewModel> stockChartBindingData;
|
||||
CompanyTradingDataViewModel selectedCompany;
|
||||
ObservableCollection<CompanyTradingDataViewModel> oldWatchListData;
|
||||
LiveTileViewModel sparklineTileViewModel = new LiveTileViewModel();
|
||||
List<LiveTileViewModel> topThreeCompanies = new List<LiveTileViewModel>() { new LiveTileViewModel(), new LiveTileViewModel(), new LiveTileViewModel() };
|
||||
|
||||
EventHandler currentPriceIndexChanged;
|
||||
EventHandler watchListChanged;
|
||||
|
||||
public event EventHandler CurrentPriceIndexChanged { add { currentPriceIndexChanged += value; } remove { currentPriceIndexChanged -= value; } }
|
||||
public event EventHandler WatchListChanged { add { watchListChanged += value; } remove { watchListChanged -= value; } }
|
||||
|
||||
|
||||
Timer TimerCore { get; set; }
|
||||
public int CurrentPriceIndex { get; set; }
|
||||
public int Ticks {
|
||||
get { return totalTicks; }
|
||||
set { totalTicks = value; }
|
||||
}
|
||||
public int TickCount {
|
||||
get { return tickCount; }
|
||||
set { tickCount = value; } }
|
||||
public int CandlesCount {
|
||||
get { return candlesCount; }
|
||||
set { candlesCount = value; }
|
||||
}
|
||||
public bool IsSuspendUpdating { get; set; }
|
||||
public bool IsLoading { get; set; }
|
||||
public string NetworkState { get { return model.NetworkState; } }
|
||||
public CompanyTradingDataViewModel SelectedCompany {
|
||||
get { return selectedCompany; }
|
||||
set {
|
||||
if (value != null) {
|
||||
if(selectedCompanyName != value.CompanyName || selectedCompany != value) {
|
||||
List<CompanyTradingDataViewModel> result = watchLisBindingData.Where(e => e.CompanyName == value.CompanyName).Select(e => e).ToList();
|
||||
if (result.Count > 0) {
|
||||
selectedCompanyName = value.CompanyName;
|
||||
selectedCompany = result[0];
|
||||
SetSelectedCompany();
|
||||
}
|
||||
}
|
||||
}
|
||||
OnPropertyChanged("SelectedCompany");
|
||||
}
|
||||
}
|
||||
public LiveTileViewModel SparklineTileViewModel {
|
||||
get { return sparklineTileViewModel; }
|
||||
set { sparklineTileViewModel = value; OnPropertyChanged("SparklineTileViewModel"); }
|
||||
}
|
||||
public List<LiveTileViewModel> TopThreeCompanies {
|
||||
get { return topThreeCompanies; }
|
||||
set { topThreeCompanies = value; OnPropertyChanged("TopThreeCompanies"); }
|
||||
}
|
||||
public LockableCollection<CompanyTradingDataViewModel> WatchListBindingData { get { return watchLisBindingData; } }
|
||||
public BindingList<TradingDataViewModel> StockChartBindingData { get { return stockChartBindingData; } }
|
||||
public LockableCollection<TransactionData> TransactionGridBindingData { get { return transactionGridBindingData; } }
|
||||
public BindingList<CompaniesVolumeData> VolumeChartBindingData { get { return volumeChartBindingData; } }
|
||||
|
||||
public RealTimeDataViewModel(Timer timer) {
|
||||
TimerCore = timer;
|
||||
TimerCore.Interval = offlineTimeInterval;
|
||||
TimerCore.Tick += new EventHandler(UpdateOnTimer);
|
||||
|
||||
model = new RealTimeDataModel();
|
||||
model.UpdateFailed += new EventHandler<RealTimeDataEventArgs>(OnUpdateFailed);
|
||||
model.Initialized += new EventHandler<EventArgs>(OnInitialized);
|
||||
stockChartBindingData = new BindingList<TradingDataViewModel>();
|
||||
watchLisBindingData = new LockableCollection<CompanyTradingDataViewModel>();
|
||||
transactionGridBindingData = new LockableCollection<TransactionData>();
|
||||
volumeChartBindingData = new BindingList<CompaniesVolumeData>();
|
||||
|
||||
IsLoading = true;
|
||||
}
|
||||
void OnInitialized(object sender, EventArgs e) {
|
||||
GetDatesAsync();
|
||||
}
|
||||
void OnUpdateFailed(object sender, RealTimeDataEventArgs e) {
|
||||
}
|
||||
void OnCandlesCountChangedCallBack() {
|
||||
CorrectCurrentDate();
|
||||
tickCount = 0;
|
||||
candlesCount = CandlesCount + 1;
|
||||
StopTimer();
|
||||
UpdateAllBindingData();
|
||||
}
|
||||
void CorrectCurrentDate() {
|
||||
int delta = currentDate;
|
||||
delta = currentDate - (CandlesCount + 1) * Ticks;
|
||||
if (delta > -1)
|
||||
currentDate = delta;
|
||||
else {
|
||||
delta = currentDate - candlesCount * totalTicks;
|
||||
currentDate = delta < 0 ? 0 : delta;
|
||||
}
|
||||
}
|
||||
//void ChangeTimerInterval(int time) {
|
||||
// TimerCore.Interval = time;
|
||||
//}
|
||||
void StartTimer() {
|
||||
InvokeSync(new Action(() => { TimerCore.Start(); }));
|
||||
}
|
||||
void StopTimer() {
|
||||
InvokeSync(new Action(() => { TimerCore.Stop(); }));
|
||||
}
|
||||
void GetDatesAsync() {
|
||||
SetDates(model.Service.GetDates());
|
||||
//Action<DateTime[]> action = new Action<DateTime[]>(SetDates);
|
||||
//AddDefferedDelegate("GetDates", action);
|
||||
//model.BeginGetDates();
|
||||
}
|
||||
void SetDates(DateTime[] dates) {
|
||||
try {
|
||||
if (dates.Length == 0)
|
||||
throw new Exception();
|
||||
this.dates = new List<DateTime>(dates);
|
||||
GetCompaniesAsync();
|
||||
canEndUpdate = true;
|
||||
}
|
||||
catch {
|
||||
canUpdate = false;
|
||||
}
|
||||
}
|
||||
void InitializeChartBindingData() {
|
||||
isAllBindingDataUpdate = true;
|
||||
stockChartBindingData.Clear();
|
||||
}
|
||||
void GetCompaniesAsync() {
|
||||
SetCompanies(model.Service.GetCompaniesName());
|
||||
}
|
||||
void SetCompanies(string[] arrayCompanies) {
|
||||
if(model.IsOnline) {
|
||||
this.companies = new List<string>();
|
||||
for(int i = 0; i < arrayCompanies.Length; i++)
|
||||
this.companies.Add(arrayCompanies[i]);
|
||||
}
|
||||
else
|
||||
this.companies = new List<string>(arrayCompanies);
|
||||
InitializeChartBindingData();
|
||||
GetBindingDataAsync();
|
||||
}
|
||||
void GetVolumeDynamicsDataAsyncCompleted2(StockData[] data) { }
|
||||
void GetBindingDataAsync() {
|
||||
GetWatchListBindingDataAsync();
|
||||
GetCompaniesVolumeAsync();
|
||||
currentDate = 0;
|
||||
|
||||
GetVolumeDynamicsDataAsync();
|
||||
GetStockChartBindingDataAsync();
|
||||
}
|
||||
void GetVolumeDynamicsDataAsync(int current = 0) {
|
||||
if (companies == null) return;
|
||||
int date = current + totalTicks * ((candlesCount - volumeCount) + 1);
|
||||
GetVolumeDynamicsDataAsyncCompleted(model.Service.GetStockDataFromPeriodByCompanyList(date, volumeCount, totalTicks, companies.ToArray()));
|
||||
}
|
||||
void GetVolumeDynamicsDataAsyncCompleted(CompanyStockData[] cd) {
|
||||
foreach (CompanyStockData companyStockData in cd) {
|
||||
CompanyTradingDataViewModel vm = watchLisBindingData.Where(c => c.CompanyName == companyStockData.CompanyName).Select(c => c).FirstOrDefault();
|
||||
vm.VolumeDynamics = CreateVolumeDynamicsBindingData(companyStockData.Data);
|
||||
}
|
||||
TryEndUpdateBindingData();
|
||||
}
|
||||
void GetWatchListBindingDataAsync() {
|
||||
currentDate += candlesCount * totalTicks;
|
||||
UpdateWatchListBindingDataAsyncCompleted(model.Service.GetStockDataByDate(dates[currentDate - 1]));
|
||||
}
|
||||
void GetStockChartBindingDataAsync() {
|
||||
GetStockChartBindingDataAsyncCompleted(model.Service.GetCompanyMultipleDataFromPeriod(currentDate, candlesCount, totalTicks, selectedCompanyName));
|
||||
}
|
||||
void GetStockChartBindingDataAsyncCompleted(CompanyData[] data) {
|
||||
List<CompanyData> newStockChartData = new List<CompanyData>();
|
||||
try {
|
||||
newStockChartData = new List<CompanyData>(data);
|
||||
}
|
||||
catch { }
|
||||
AddChartPoints(newStockChartData);
|
||||
}
|
||||
void AddChartPoints(List<CompanyData> newStockChartData) {
|
||||
CreateChartBindingData(newStockChartData);
|
||||
UpdateSparklineViewModelSource();
|
||||
isAllBindingDataUpdate = false;
|
||||
TryEndUpdateBindingData();
|
||||
}
|
||||
void UpdateSparklineViewModelSource() {
|
||||
SparklineTileViewModel.Source = stockChartBindingData;
|
||||
}
|
||||
void UpdateWatchListBindingDataAsync() {
|
||||
if (dates == null) return;
|
||||
if(currentDate >= 0 && currentDate < dates.Count)
|
||||
UpdateWatchListBindingDataAsyncCompleted(model.Service.GetStockDataByDate(dates[currentDate]));
|
||||
else
|
||||
UpdateWatchListBindingDataAsyncCompleted(model.Service.GetStockDataByDate(dates.FirstOrDefault()));
|
||||
}
|
||||
void UpdateCompaniesVolumeAsync() {
|
||||
if (tickCount == totalTicks || tickCount == 0)
|
||||
GetCompaniesVolumeAsync();
|
||||
}
|
||||
void UpdateWatchListBindingDataAsyncCompleted(StockData[] gridData) {
|
||||
UpdateWatchList(gridData);
|
||||
UpdateSparklineViewModelCompany();
|
||||
UpdateTopThreeCompany();
|
||||
TryEndUpdateBindingData();
|
||||
}
|
||||
void UpdateTopThreeCompany() {
|
||||
var topThree = GetTopThreeVolume();
|
||||
if (topThree.Count < 3) return;
|
||||
var result = new List<LiveTileViewModel>();
|
||||
foreach (CompaniesVolumeData volumeData in topThree) {
|
||||
LiveTileViewModel vm = new LiveTileViewModel();
|
||||
vm.CompanyIndex = volumeData.CompanyName;
|
||||
double delta = 0;
|
||||
double increace = CalcIncrease(volumeData.CompanyName, ref delta);
|
||||
vm.Arrow = increace > 0 ? "▲" : "▼";
|
||||
vm.Persent = Math.Abs(increace) * 100 + "%";
|
||||
vm.PriceIncrease = Math.Abs(Math.Round(delta, 3)).ToString();
|
||||
result.Add(vm);
|
||||
}
|
||||
TopThreeCompanies = result;
|
||||
}
|
||||
void GetCompaniesVolumeAsync() {
|
||||
int endIndex = currentDate - totalTicks;
|
||||
if (dates != null && currentDate < dates.Count && endIndex > 0) {
|
||||
DateTime start = dates[currentDate];
|
||||
DateTime end = dates[endIndex];
|
||||
GetCompaniesVolumeCompleted(model.Service.GetCompaniesVolumeFromPeriod(start, end));
|
||||
}
|
||||
}
|
||||
void GetCompaniesVolumeCompleted(CompaniesVolumeData[] data) {
|
||||
UpdateVolumeChartBindingData(data);
|
||||
}
|
||||
void UpdateVolumeChartBindingData(CompaniesVolumeData[] data) {
|
||||
volumeChartBindingData.Clear();
|
||||
SetVolumeOfSelectedCompany();
|
||||
int index = 1;
|
||||
for (int i = 0; i < data.Length - 1; i++) {
|
||||
if (data[i].CompanyName == selectedCompanyName)
|
||||
continue;
|
||||
if (volumeChartBindingData.Count < data.Length + 1)
|
||||
volumeChartBindingData.Add(data[i]);
|
||||
index++;
|
||||
}
|
||||
ValidateCompaniesVolume();
|
||||
TryEndUpdateBindingData();
|
||||
}
|
||||
void UpdateSparklineViewModelCompany() {
|
||||
SparklineTileViewModel.CompanyIndex = SelectedCompany?.CompanyName;
|
||||
double delta = 0;
|
||||
double increace = CalcIncrease(SelectedCompany?.CompanyName, ref delta);
|
||||
SparklineTileViewModel.Arrow = increace > 0 ? "▲" : "▼";
|
||||
SparklineTileViewModel.Persent = Math.Abs(increace) * 100 + "%";
|
||||
}
|
||||
void ValidateCompaniesVolume() {
|
||||
List<string> volumeCompanies = volumeChartBindingData.Select(c => c.CompanyName).ToList();
|
||||
List<string> exceptCompanies = companies.Except(volumeCompanies).ToList();
|
||||
for (int i = 0; i < volumeChartBindingData.Count; i++) {
|
||||
CompaniesVolumeData volumeData = volumeChartBindingData[i];
|
||||
if (!companies.Contains(volumeData.CompanyName)) {
|
||||
var res = watchLisBindingData.Where(c => exceptCompanies.Contains(c.CompanyName)).ToList();
|
||||
if (res.Count > 0) {
|
||||
double maxVolume = res.Max(c => c.Volume);
|
||||
CompanyTradingDataViewModel vm = watchLisBindingData.Where(c => c.Volume == maxVolume).Select(c => c).FirstOrDefault();
|
||||
exceptCompanies.Remove(vm.CompanyName);
|
||||
volumeChartBindingData[i] = new CompaniesVolumeData() {
|
||||
CompanyName = vm.CompanyName,
|
||||
Volume = (int)maxVolume
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetVolumeOfSelectedCompany() {
|
||||
if (volumeChartBindingData.Count == 0 && SelectedCompany != null) {
|
||||
CompaniesVolumeData cvd = new CompaniesVolumeData();
|
||||
cvd.CompanyName = SelectedCompany.CompanyName;
|
||||
cvd.Volume = (int)SelectedCompany.Volume;
|
||||
volumeChartBindingData.Add(cvd);
|
||||
}
|
||||
else if (SelectedCompany != null) {
|
||||
volumeChartBindingData[0].CompanyName = SelectedCompany.CompanyName;
|
||||
volumeChartBindingData[0].Volume = (int)SelectedCompany.Volume;
|
||||
}
|
||||
}
|
||||
void TryEndUpdateBindingData() {
|
||||
if (canEndUpdate)
|
||||
EndUpdateBindingData();
|
||||
}
|
||||
void EndUpdateBindingData() {
|
||||
if (!TimerCore.Enabled && !isAllBindingDataUpdate)
|
||||
StartTimer();
|
||||
}
|
||||
void UpdateOnTimer(object sender, EventArgs e) {
|
||||
if (!IsSuspendUpdating)
|
||||
UpdateData();
|
||||
}
|
||||
void UpdateAllBindingData(bool needUpdateVolumeDynamics = true) {
|
||||
if (canUpdate) {
|
||||
InitProperties();
|
||||
model.ChangeUserState();
|
||||
defferedUpdate.Clear();
|
||||
tickCount = 0;
|
||||
if (needUpdateVolumeDynamics)
|
||||
GetVolumeDynamicsDataAsync(currentDate);
|
||||
|
||||
UpdateCompaniesVolumeAsync();
|
||||
UpdateWatchListBindingDataAsync();
|
||||
|
||||
InitializeChartBindingData();
|
||||
GetStockChartBindingDataAsync();
|
||||
}
|
||||
}
|
||||
void UpdateData() {
|
||||
lock (sem) {
|
||||
int dateLocal = currentDate;
|
||||
if (dates == null || dateLocal < 0 || dateLocal > dates.Count -1) return;
|
||||
StopTimer();
|
||||
DateTime date = dates[dateLocal];
|
||||
switch (totalTicks) {
|
||||
case 5:
|
||||
RemoveOldCompanyStockChart(date, 1);
|
||||
break;
|
||||
case 10:
|
||||
RemoveOldCompanyStockChart(date, 2);
|
||||
break;
|
||||
case 20:
|
||||
RemoveOldCompanyStockChart(date, 4);
|
||||
break;
|
||||
}
|
||||
UpdateBindingData();
|
||||
}
|
||||
}
|
||||
void RemoveOldCompanyStockChart(DateTime date, int count) {
|
||||
if (date.DayOfWeek == DayOfWeek.Monday && countOfWeek == count) {
|
||||
tickCount = 0;
|
||||
if (stockChartBindingData != null && stockChartBindingData.Count > 1) stockChartBindingData.Remove(stockChartBindingData[0]);
|
||||
foreach (CompanyTradingDataViewModel vm in watchLisBindingData) {
|
||||
if (vm.VolumeDynamics != null && ((IList)vm.VolumeDynamics).Count > 0)
|
||||
((IList)vm.VolumeDynamics).RemoveAt(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
void UpdateBindingData() {
|
||||
UpdateStockChartBindingDataAsync();
|
||||
UpdateWatchListBindingDataAsync();
|
||||
UpdateCompaniesVolumeAsync();
|
||||
UpdateVolumeDynamicsAsync();
|
||||
UpdateTransactionBindingData();
|
||||
}
|
||||
void UpdateVolumeDynamicsAsync() {
|
||||
if (companies != null)
|
||||
UpdateVolumeDynamicsAsyncCompleted(model.Service.GetStockDataFromDateByCompanyList(dates[currentDate], companies.ToArray()));
|
||||
}
|
||||
void UpdateVolumeDynamicsAsyncCompleted(CompanyStockData[] cd) {
|
||||
foreach (CompanyStockData companynStockData in cd) {
|
||||
try {
|
||||
if (companynStockData.Data.Length == 0) continue;
|
||||
DateTime current = dates[currentDate];
|
||||
CompanyTradingData ctd = GetCompanyTradingData(companynStockData.Data[0], current);
|
||||
CompanyTradingDataViewModel vm = watchLisBindingData.Where(c => c.CompanyName == companynStockData.CompanyName).Select(c => c).FirstOrDefault();
|
||||
if (vm == null) continue;
|
||||
IList<TradingDataViewModel> volDyn = vm.VolumeDynamics as IList<TradingDataViewModel>;
|
||||
|
||||
if (vm.VolumeDynamics == null || ((IList)vm.VolumeDynamics).Count == 0) return;
|
||||
if (tickCount == 2) {
|
||||
ctd.Volume = Math.Round((ctd.Volume / 1000000), 2);
|
||||
volDyn.Add(new TradingDataViewModel(ctd));
|
||||
}
|
||||
if (tickCount != 2) {
|
||||
TradingDataViewModel tdvm = new TradingDataViewModel(volDyn[volDyn.Count - 1].TradingData);
|
||||
tdvm.Volume = Math.Round((ctd.Volume / 1000000), 2);
|
||||
tdvm.Close = ctd.Close;
|
||||
tdvm.Low = lowestPrice;
|
||||
tdvm.High = highestPrice;
|
||||
tdvm.Price = ctd.Price;
|
||||
volDyn[volDyn.Count - 1] = tdvm;
|
||||
}
|
||||
}
|
||||
catch {
|
||||
currentDate++;
|
||||
UpdateStockChartBindingDataAsync();
|
||||
}
|
||||
}
|
||||
TryEndUpdateBindingData();
|
||||
}
|
||||
void UpdateStockChartBindingDataAsync() {
|
||||
UpdateStockChartBindingDataAsyncCompleted(model.Service.GetCompanyStockData(dates[currentDate], selectedCompanyName));
|
||||
}
|
||||
void UpdateStockChartBindingDataAsyncCompleted(StockData[] data) {
|
||||
if (data.Length == 0) {
|
||||
IncrementDateAndUpdateStockChartBindingData();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
UpdateStockChart(data[0]);
|
||||
UpdateSparklineViewModelSource();
|
||||
TryEndUpdateBindingData();
|
||||
}
|
||||
catch {
|
||||
IncrementDateAndUpdateStockChartBindingData();
|
||||
}
|
||||
}
|
||||
}
|
||||
void IncrementDateAndUpdateStockChartBindingData() {
|
||||
currentDate++;
|
||||
UpdateStockChartBindingDataAsync();
|
||||
}
|
||||
void UpdateStockChart(StockData newChartData) {
|
||||
tickCount++;
|
||||
DateTime current = dates[currentDate];
|
||||
CompanyTradingData ctd = GetCompanyTradingData(newChartData, current);
|
||||
switch (totalTicks) {
|
||||
case 5:
|
||||
AddStockChart(current, ctd, 1);
|
||||
break;
|
||||
case 10:
|
||||
AddStockChart(current, ctd, 2);
|
||||
break;
|
||||
default:
|
||||
AddStockChart(current, ctd, 4);
|
||||
break;
|
||||
}
|
||||
currentDate++;
|
||||
}
|
||||
void AddStockChart(DateTime current, CompanyTradingData ctd, int count) {
|
||||
if (current.DayOfWeek == DayOfWeek.Monday && countOfWeek == count) {
|
||||
ctd.Volume = Math.Round((ctd.Volume / 1000000), 2);
|
||||
stockChartBindingData.Add(new TradingDataViewModel(ctd));
|
||||
highestPrice = ctd.High;
|
||||
lowestPrice = ctd.Low;
|
||||
countOfWeek = 1;
|
||||
return;
|
||||
}
|
||||
if (current.DayOfWeek == DayOfWeek.Monday && countOfWeek != count) {
|
||||
SetStockChartBindingData(ctd);
|
||||
countOfWeek++;
|
||||
return;
|
||||
}
|
||||
if (current.DayOfWeek != DayOfWeek.Monday) SetStockChartBindingData(ctd);
|
||||
}
|
||||
void TryResetCurrentDate() {
|
||||
if (dates != null && currentDate + totalTicks > dates.Count - 1) {
|
||||
currentDate = 0;
|
||||
tickCount = 0;
|
||||
}
|
||||
}
|
||||
void CreateChartBindingData(List<CompanyData> newStockChartData) {
|
||||
TryResetCurrentDate();
|
||||
int index = 0;
|
||||
DateTime firstDate = newStockChartData[0].Data.Date;
|
||||
DateTime startDate = new DateTime(firstDate.Year, firstDate.Month, 1);
|
||||
foreach (CompanyData candleData in newStockChartData) {
|
||||
CompanyTradingData ctd = new CompanyTradingData(candleData.Data, "");
|
||||
ctd.Close = candleData.ClosePrice;
|
||||
ctd.Volume = Math.Round(((double)ctd.Volume / 1000000), 2);
|
||||
ctd.Low = lowestPrice = candleData.LowPrice;
|
||||
ctd.High = highestPrice = candleData.HighPrice;
|
||||
TradingDataViewModel viewModel = new TradingDataViewModel(ctd) { Date = startDate };
|
||||
if (stockChartBindingData.Count < candlesCount) {
|
||||
stockChartBindingData.Add(viewModel);
|
||||
}
|
||||
else
|
||||
stockChartBindingData[index] = viewModel;
|
||||
startDate = UpdateDate(startDate, true);
|
||||
index++;
|
||||
}
|
||||
DateTime search = UpdateDate(startDate, false);
|
||||
while (true) {
|
||||
int dateIndex = dates.IndexOf(search);
|
||||
if (dateIndex != -1) {
|
||||
currentDate = dateIndex;
|
||||
break;
|
||||
}
|
||||
search = search.AddDays(-1);
|
||||
}
|
||||
}
|
||||
void UpdateWatchList(StockData[] watchListData) {
|
||||
int count = 0;
|
||||
int isRise = 0;
|
||||
oldWatchListData = new ObservableCollection<CompanyTradingDataViewModel>(watchLisBindingData as IEnumerable<CompanyTradingDataViewModel>);
|
||||
oldWatchListData = new ObservableCollection<CompanyTradingDataViewModel>();
|
||||
foreach (CompanyTradingDataViewModel item in watchLisBindingData) {
|
||||
oldWatchListData.Add(new CompanyTradingDataViewModel(item.TradingData, item.CompanyName, item.Rise, item.TotalRise));
|
||||
}
|
||||
watchLisBindingData.BeginUpdate();
|
||||
foreach (StockData dt in watchListData) {
|
||||
if (companies.Count <= (dt.CompanyID)) continue;
|
||||
CompanyTradingData ctd = new CompanyTradingData(dt, companies[dt.CompanyID]);
|
||||
if (watchLisBindingData.Count < companies.Count)
|
||||
watchLisBindingData.Add(new CompanyTradingDataViewModel(ctd, ctd.CompanyName, isRise, 1));
|
||||
else {
|
||||
SetWatchListBindingData(count, ctd);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
watchLisBindingData.EndUpdate();
|
||||
if (watchListChanged != null)
|
||||
watchListChanged(this, EventArgs.Empty);
|
||||
}
|
||||
void SetWatchListBindingData(int index, CompanyTradingData ctd) {
|
||||
watchLisBindingData[index].Rise = 0;
|
||||
if (ctd.Price > watchLisBindingData[index].Price) {
|
||||
watchLisBindingData[index].TotalRise = Math.Min(0.5 + (1 - watchLisBindingData[index].Price / ctd.Price) * 10, 1.3);
|
||||
watchLisBindingData[index].Rise = 180;
|
||||
}
|
||||
else if (ctd.Price < watchLisBindingData[index].Price) {
|
||||
watchLisBindingData[index].TotalRise = Math.Min(0.5 + (1 - ctd.Price / watchLisBindingData[index].Price) * 10, 1.3);
|
||||
watchLisBindingData[index].Rise = -180;
|
||||
}
|
||||
watchLisBindingData[index].Assign(ctd);
|
||||
}
|
||||
void SetStockChartBindingData(CompanyTradingData ctd)
|
||||
{
|
||||
TradingDataViewModel tdvm = null;
|
||||
if (stockChartBindingData.Count > 0)
|
||||
tdvm = new TradingDataViewModel(stockChartBindingData[stockChartBindingData.Count - 1].TradingData);
|
||||
else
|
||||
tdvm = new TradingDataViewModel();
|
||||
highestPrice = Math.Max(highestPrice, ctd.High);
|
||||
lowestPrice = Math.Min(lowestPrice, ctd.Low);
|
||||
tdvm.Volume = Math.Round((ctd.Volume / 1000000), 2);
|
||||
tdvm.Close = ctd.Close;
|
||||
tdvm.Low = lowestPrice;
|
||||
tdvm.High = highestPrice;
|
||||
tdvm.Price = ctd.Price;
|
||||
if (stockChartBindingData.Count > 0)
|
||||
stockChartBindingData[stockChartBindingData.Count - 1] = tdvm;
|
||||
else
|
||||
stockChartBindingData.Add(tdvm);
|
||||
}
|
||||
void UpdateTransactionBindingData() {
|
||||
TryResetCurrentDate();
|
||||
if (stockChartBindingData.Count < 1) return;
|
||||
List<TransactionData> transactions = model.GetTransactions(stockChartBindingData[stockChartBindingData.Count - 1].Price);
|
||||
SetTransactionGridBindingData(transactions);
|
||||
IsLoading = false;
|
||||
OnPropertyChanged("IsLoading");
|
||||
}
|
||||
void SetTransactionGridBindingData(List<TransactionData> transactions) {
|
||||
transactionGridBindingData.Clear();
|
||||
transactionGridBindingData.BeginUpdate();
|
||||
foreach (TransactionData tdvm in transactions) {
|
||||
transactionGridBindingData.Add(tdvm);
|
||||
}
|
||||
transactionGridBindingData.EndUpdate();
|
||||
CurrentPriceIndex = model.CurrentPriceIndex;
|
||||
RaiseCurrentPriceIndexChanged();
|
||||
}
|
||||
void RaiseCurrentPriceIndexChanged() {
|
||||
if (currentPriceIndexChanged != null)
|
||||
currentPriceIndexChanged(this, EventArgs.Empty);
|
||||
}
|
||||
void SetSelectedCompany() {
|
||||
StopTimer();
|
||||
int delta = currentDate - candlesCount * totalTicks;
|
||||
currentDate = delta < 0 ? 0 : delta;
|
||||
UpdateAllBindingData(true);
|
||||
}
|
||||
void InitProperties() {
|
||||
TryResetCurrentDate();
|
||||
isAllBindingDataUpdate = true;
|
||||
IsLoading = true;
|
||||
model.ClearTransactions();
|
||||
OnPropertyChanged("IsLoading");
|
||||
}
|
||||
double CalcIncrease(string company, ref double delta) {
|
||||
var companyData = watchLisBindingData.Where(c => c.CompanyName == company).Select(c => c).FirstOrDefault();
|
||||
var oldCompanyData = oldWatchListData.Where(c => c.CompanyName == company).Select(c => c).FirstOrDefault();
|
||||
if (companyData != null && oldCompanyData != null) {
|
||||
double newPrice = companyData.Price;
|
||||
double oldPrice = oldCompanyData.Price;
|
||||
delta = newPrice - oldPrice;
|
||||
return Math.Round(delta / newPrice, 3);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
CompanyTradingData GetCompanyTradingData(StockData newData, DateTime current) {
|
||||
CompanyTradingData ctd = new CompanyTradingData(newData, "");
|
||||
return ctd;
|
||||
}
|
||||
DateTime UpdateDate(DateTime startDate, bool add) {
|
||||
DateTime returnDate = new DateTime();
|
||||
switch (totalTicks) {
|
||||
case 1:
|
||||
if (add) startDate = startDate.AddDays(1);
|
||||
if (!add) returnDate = startDate.AddDays(-1);
|
||||
break;
|
||||
case 5:
|
||||
if (add) startDate = startDate.AddDays(7);
|
||||
if (!add) returnDate = startDate.AddDays(-7);
|
||||
break;
|
||||
case 10:
|
||||
if (add) startDate = startDate.AddDays(14);
|
||||
if (!add) returnDate = startDate.AddDays(-14);
|
||||
break;
|
||||
case 20:
|
||||
if (add) startDate = startDate.AddMonths(1);
|
||||
if (!add) returnDate = startDate.AddMonths(-1);
|
||||
break;
|
||||
}
|
||||
if (add) return startDate;
|
||||
return returnDate;
|
||||
}
|
||||
Delegate GetDefferedDelegate(string key) {
|
||||
if (defferedUpdate.ContainsKey(key) && defferedUpdate[key].Count != 0)
|
||||
return defferedUpdate[key].Dequeue();
|
||||
return null;
|
||||
|
||||
}
|
||||
List<CompaniesVolumeData> GetTopThreeVolume() {
|
||||
List<CompaniesVolumeData> result = new List<CompaniesVolumeData>();
|
||||
if (volumeChartBindingData != null && volumeChartBindingData.Count > 0) {
|
||||
for (int i = 0; i < 3; i++)
|
||||
if (volumeChartBindingData.Count >= i + 1)
|
||||
result.Add(volumeChartBindingData[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
LockableCollection<TradingDataViewModel> CreateVolumeDynamicsBindingData(StockData[] data) {
|
||||
LockableCollection<TradingDataViewModel> result = new LockableCollection<TradingDataViewModel>();
|
||||
foreach (StockData currentData in data) {
|
||||
CompanyTradingData ctd = new CompanyTradingData(currentData, "");
|
||||
ctd.Close = double.Parse(currentData.CloseP.ToString());
|
||||
ctd.Volume = Math.Round(((double)ctd.Volume / 1000000), 2);
|
||||
ctd.Low = double.Parse(currentData.LowP.ToString());
|
||||
ctd.High = double.Parse(currentData.HighP.ToString());
|
||||
result.Add(new TradingDataViewModel(ctd));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public void OnCandlesCountChanged() {
|
||||
OnCandlesCountChangedCallBack();
|
||||
}
|
||||
public void SetTicks(int numberOfTicks) {
|
||||
Ticks = numberOfTicks;
|
||||
countOfWeek = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
47
StockMarketTraderApp/ViewModel/TileViewModels.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.ViewModel {
|
||||
public class LiveTileViewModel : ViewModelBase {
|
||||
string arrow;
|
||||
string companyIndex;
|
||||
string persent;
|
||||
string priceIncrease;
|
||||
BindingList<TradingDataViewModel> source = new BindingList<TradingDataViewModel>();
|
||||
|
||||
public string Arrow {
|
||||
get { return arrow; }
|
||||
set {
|
||||
arrow = value;
|
||||
OnPropertyChanged("Arrow");
|
||||
}
|
||||
}
|
||||
public string CompanyIndex {
|
||||
get { return companyIndex; }
|
||||
set {
|
||||
companyIndex = value;
|
||||
OnPropertyChanged("CompanyIndex");
|
||||
}
|
||||
}
|
||||
public string Persent {
|
||||
get { return persent; }
|
||||
set {
|
||||
persent = value;
|
||||
OnPropertyChanged("Persent");
|
||||
}
|
||||
}
|
||||
public string PriceIncrease {
|
||||
get { return priceIncrease; }
|
||||
set {
|
||||
priceIncrease = value;
|
||||
OnPropertyChanged("PriceIncrease");
|
||||
}
|
||||
}
|
||||
public BindingList<TradingDataViewModel> Source {
|
||||
get { return source; }
|
||||
set {
|
||||
source = value;
|
||||
OnPropertyChanged("Source");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
92
StockMarketTraderApp/ViewModel/ViewModelBase.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DevExpress.StockMarketTrader.ViewModel {
|
||||
public class LockableCollection<T> : ObservableCollection<T> {
|
||||
bool isChanged;
|
||||
int updateLockCount;
|
||||
|
||||
public bool IsUpdateLocked { get { return updateLockCount > 0; } }
|
||||
|
||||
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) {
|
||||
if (IsUpdateLocked)
|
||||
isChanged = true;
|
||||
else
|
||||
base.OnCollectionChanged(e);
|
||||
}
|
||||
protected override void SetItem(int index, T item) {
|
||||
if (!this[index].Equals(item))
|
||||
base.SetItem(index, item);
|
||||
}
|
||||
public void Assign(IList<T> source) {
|
||||
if(Equals(source))
|
||||
return;
|
||||
BeginUpdate();
|
||||
try {
|
||||
Clear();
|
||||
foreach(T item in source)
|
||||
Add(item);
|
||||
} finally {
|
||||
EndUpdate();
|
||||
}
|
||||
}
|
||||
public void BeginUpdate() {
|
||||
if(!IsUpdateLocked)
|
||||
isChanged = false;
|
||||
updateLockCount++;
|
||||
}
|
||||
public void EndUpdate() {
|
||||
if(!IsUpdateLocked)
|
||||
return;
|
||||
updateLockCount--;
|
||||
if(!IsUpdateLocked && isChanged)
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||
}
|
||||
public void ForEach(Action<T> action) {
|
||||
for (int i = 0; i < Count; i++)
|
||||
action(this[i]);
|
||||
}
|
||||
public T Find(Predicate<T> match) {
|
||||
if (match == null)
|
||||
return default(T);
|
||||
int count = Count;
|
||||
for (int i = 0; i < count; i++) {
|
||||
T item = this[i];
|
||||
if (match(item))
|
||||
return item;
|
||||
}
|
||||
return default(T);
|
||||
}
|
||||
public override bool Equals(object obj) {
|
||||
if(obj is IList<T>) {
|
||||
var list = (IList<T>)obj;
|
||||
if(Count != list.Count)
|
||||
return false;
|
||||
else {
|
||||
for(int i = 0; i < Count; i++)
|
||||
if(!this[i].Equals(list[i]))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
} else
|
||||
return base.Equals(obj);
|
||||
}
|
||||
public override int GetHashCode() {
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class ViewModelBase : INotifyPropertyChanged {
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void OnPropertyChanged(string propertyName) {
|
||||
PropertyChangedEventHandler handler = PropertyChanged;
|
||||
if (handler != null) {
|
||||
handler(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||