mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-13 10:48:08 +00:00
Updated MtApi5
This commit is contained in:
@@ -19,9 +19,6 @@ namespace MtApi5
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private const char ParamSeparator = ';';
|
|
||||||
private const string LogProfileName = "MtApi5Client";
|
|
||||||
|
|
||||||
public delegate void QuoteHandler(object sender, string symbol, double bid, double ask);
|
public delegate void QuoteHandler(object sender, string symbol, double bid, double ask);
|
||||||
|
|
||||||
|
|
||||||
@@ -1776,7 +1773,6 @@ namespace MtApi5
|
|||||||
Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "SubWindow", subWindow },
|
Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "SubWindow", subWindow },
|
||||||
{ "Time", Mt5TimeConverter.ConvertToMtTime(time) }, { "Price", price } };
|
{ "Time", Mt5TimeConverter.ConvertToMtTime(time) }, { "Price", price } };
|
||||||
|
|
||||||
Dictionary<string, int> XY = [];
|
|
||||||
var response = SendCommand<FuncResult<Dictionary<string,int>>>(ExecutorHandle, Mt5CommandType.ChartTimePriceToXY, cmdParams);
|
var response = SendCommand<FuncResult<Dictionary<string,int>>>(ExecutorHandle, Mt5CommandType.ChartTimePriceToXY, cmdParams);
|
||||||
if (response != null && response.Result != null
|
if (response != null && response.Result != null
|
||||||
&& response.Result.TryGetValue("X", out x)
|
&& response.Result.TryGetValue("X", out x)
|
||||||
@@ -2247,9 +2243,9 @@ namespace MtApi5
|
|||||||
public bool ObjectCreate(long chartId, string name, ENUM_OBJECT type, int nwin, DateTime time, double price, List<Tuple<DateTime, double>>? listOfCoordinates = null)
|
public bool ObjectCreate(long chartId, string name, ENUM_OBJECT type, int nwin, DateTime time, double price, List<Tuple<DateTime, double>>? listOfCoordinates = null)
|
||||||
{
|
{
|
||||||
//Count the additional coordinates
|
//Count the additional coordinates
|
||||||
int iAdditionalCoordinates = (listOfCoordinates != null) ? listOfCoordinates.Count() : 0;
|
int iAdditionalCoordinates = (listOfCoordinates != null) ? listOfCoordinates.Count : 0;
|
||||||
if(iAdditionalCoordinates > 29)
|
if(iAdditionalCoordinates > 29)
|
||||||
throw new ArgumentOutOfRangeException("listOfCoordinates", "The maximum amount of coordinates in 30.");
|
throw new ArgumentOutOfRangeException(nameof(listOfCoordinates), "The maximum amount of coordinates in 30.");
|
||||||
|
|
||||||
Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "Name", name ?? string.Empty },
|
Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "Name", name ?? string.Empty },
|
||||||
{ "Type", (int)type }, { "Nwin", nwin } };
|
{ "Type", (int)type }, { "Nwin", nwin } };
|
||||||
|
|||||||
@@ -1,25 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="WixToolset.Sdk/5.0.0">
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
|
||||||
<ProductVersion>3.6</ProductVersion>
|
<ProductVersion>3.6</ProductVersion>
|
||||||
<ProjectGuid>{a9ed070f-ab4d-4380-9dde-5d931ac71333}</ProjectGuid>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<OutputName>MtApi5Installer_$(Platform)</OutputName>
|
<OutputName>MtApi5Installer_$(Platform)</OutputName>
|
||||||
<OutputType>Package</OutputType>
|
|
||||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
|
||||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
|
||||||
<RunWixToolsOutOfProc>true</RunWixToolsOutOfProc>
|
<RunWixToolsOutOfProc>true</RunWixToolsOutOfProc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
<OutputPath>..\build\installers\$(Configuration)\</OutputPath>
|
<OutputPath>..\build\installers\$(Configuration)\</OutputPath>
|
||||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
|
||||||
<DefineConstants>Debug</DefineConstants>
|
<DefineConstants>Debug</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
<OutputPath>..\build\installers\$(Configuration)\</OutputPath>
|
<OutputPath>..\build\installers\$(Configuration)\</OutputPath>
|
||||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||||
<DefineConstants>Debug</DefineConstants>
|
<DefineConstants>Debug</DefineConstants>
|
||||||
@@ -31,21 +21,24 @@
|
|||||||
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
|
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Product.wxs" />
|
<PackageReference Include="WixToolset.UI.wixext" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<WixExtension Include="WixUIExtension">
|
<ProjectReference Include="..\MT5Connector\MT5Connector.vcxproj">
|
||||||
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
|
<Name>MT5Connector</Name>
|
||||||
<Name>WixUIExtension</Name>
|
<Project>{cb6d4a3e-2f2e-4c67-929d-3c2a8fd1c556}</Project>
|
||||||
</WixExtension>
|
<Private>True</Private>
|
||||||
|
<DoNotHarvest>True</DoNotHarvest>
|
||||||
|
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||||
|
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\MtApi5\MtApi5.csproj">
|
||||||
|
<Name>MtApi5</Name>
|
||||||
|
<Project>{ac8b5010-da75-477e-9ca5-547c649e12d8}</Project>
|
||||||
|
<Private>True</Private>
|
||||||
|
<DoNotHarvest>True</DoNotHarvest>
|
||||||
|
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||||
|
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(WixTargetsPath)" />
|
|
||||||
<!--
|
|
||||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Wix.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
</Project>
|
||||||
+33
-51
@@ -1,28 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
|
||||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
|
||||||
<?define ProductName="MtApi5" ?>
|
<?define ProductName="MtApi5" ?>
|
||||||
|
|
||||||
<?if $(var.Platform) = x64 ?>
|
<?define ProductPathNative="..\build\products\$(var.Configuration)\$(var.Platform)\"?>
|
||||||
<?define ProductPathNative="..\build\products\$(var.Configuration)\x64\"?>
|
<?if $(var.Platform) = x64 ?>
|
||||||
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
||||||
<?define PlatformSystemFolder = "System64Folder" ?>
|
<?define PlatformSystemFolder = "System64Folder" ?>
|
||||||
<?else ?>
|
<?else?>
|
||||||
<?define ProductPathNative="..\build\products\$(var.Configuration)\"?>
|
|
||||||
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
|
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
|
||||||
<?define PlatformSystemFolder = "SystemFolder" ?>
|
<?define PlatformSystemFolder = "SystemFolder" ?>
|
||||||
<?endif ?>
|
<?endif?>
|
||||||
|
|
||||||
<?define ProductVersion=!(bind.FileVersion.MtApi5.dll) ?>
|
<?define ProductVersion=!(bind.FileVersion.MtApi5.dll) ?>
|
||||||
<?define Manufacturer="DW"?>
|
<?define Manufacturer="DW"?>
|
||||||
<?define ProductPath="..\build\products\$(var.Configuration)\net8.0\"?>
|
<?define ProductPath="..\build\products\$(var.Configuration)\net8.0\"?>
|
||||||
|
|
||||||
<Product Id="*"
|
<Package Name="$(var.ProductName) $(var.ProductVersion)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="d72d346e-e6f7-4c23-85c6-1c42b3175599" InstallerVersion="200">
|
||||||
Name="$(var.ProductName) $(var.ProductVersion)"
|
|
||||||
Language="1033"
|
|
||||||
Version="$(var.ProductVersion)"
|
|
||||||
Manufacturer="$(var.Manufacturer)"
|
|
||||||
UpgradeCode="d72d346e-e6f7-4c23-85c6-1c42b3175599">
|
|
||||||
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
|
|
||||||
|
|
||||||
<WixVariable Id="WixUILicenseRtf" Value="..\LICENSE.rtf" />
|
<WixVariable Id="WixUILicenseRtf" Value="..\LICENSE.rtf" />
|
||||||
|
|
||||||
@@ -30,90 +23,79 @@
|
|||||||
<MediaTemplate EmbedCab="yes" />
|
<MediaTemplate EmbedCab="yes" />
|
||||||
|
|
||||||
<Feature Id="MtApi5" Title="$(var.ProductName)" Level="1">
|
<Feature Id="MtApi5" Title="$(var.ProductName)" Level="1">
|
||||||
<ComponentGroupRef Id="MtApi5Components"/>
|
<ComponentGroupRef Id="MtApi5Components" />
|
||||||
</Feature>
|
</Feature>
|
||||||
|
|
||||||
<Feature Id="MT5Connector" Title="MT5 Connector" Level="1">
|
<Feature Id="MT5Connector" Title="MT5 Connector" Level="1">
|
||||||
<ComponentGroupRef Id="MT5ConnectorComponents"/>
|
<ComponentGroupRef Id="MT5ConnectorComponents" />
|
||||||
</Feature>
|
</Feature>
|
||||||
|
|
||||||
<Property Id="WIXUI_INSTALLDIR">INSTALLFOLDER</Property>
|
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||||
<UIRef Id="WixUI_Mondo" />
|
<ui:WixUI Id="WixUI_Mondo" />
|
||||||
</Product>
|
</Package>
|
||||||
|
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
<StandardDirectory Id="$(var.PlatformProgramFilesFolder)">
|
||||||
<Directory Id="$(var.PlatformProgramFilesFolder)">
|
|
||||||
<Directory Id="INSTALLFOLDER" Name="$(var.ProductName)">
|
<Directory Id="INSTALLFOLDER" Name="$(var.ProductName)">
|
||||||
|
|
||||||
<Directory Id="ExpertFolder" Name="Experts">
|
<Directory Id="ExpertFolder" Name="Experts">
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</StandardDirectory>
|
||||||
|
|
||||||
<Directory Id="$(var.PlatformSystemFolder)">
|
<StandardDirectory Id="$(var.PlatformSystemFolder)">
|
||||||
</Directory>
|
</StandardDirectory>
|
||||||
|
|
||||||
<Directory Id="ProgramMenuFolder">
|
<StandardDirectory Id="ProgramMenuFolder">
|
||||||
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)">
|
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)">
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</StandardDirectory>
|
||||||
|
|
||||||
</Directory>
|
</Fragment>
|
||||||
</Fragment>
|
|
||||||
|
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<ComponentGroup Id="MtApi5Components">
|
<ComponentGroup Id="MtApi5Components">
|
||||||
|
|
||||||
<Component Id="MtApi5Dll" Directory="INSTALLFOLDER">
|
<Component Id="MtApi5Dll" Directory="INSTALLFOLDER">
|
||||||
<File Id="MtApi5.dll" Name="MtApi5.dll" KeyPath="yes"
|
<File Id="MtApi5.dll" Name="MtApi5.dll" KeyPath="yes" Source="$(var.ProductPath)MtApi5.dll" />
|
||||||
Source="$(var.ProductPath)MtApi5.dll" />
|
|
||||||
|
|
||||||
<RegistryKey Root="HKLM"
|
<RegistryKey Root="HKLM" Key="Software\Microsoft\.NetFramework\v4.0.30319\AssemblyFoldersEx\$(var.ProductName)" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
|
||||||
Key="Software\Microsoft\.NetFramework\v4.0.30319\AssemblyFoldersEx\$(var.ProductName)"
|
<RegistryValue Type="string" Value="[INSTALLFOLDER]" />
|
||||||
Action="createAndRemoveOnUninstall">
|
|
||||||
<RegistryValue Type="string" Value="[INSTALLFOLDER]"/>
|
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
|
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<Component Id="MtClientDll" Directory="INSTALLFOLDER">
|
<Component Id="MtClientDll" Directory="INSTALLFOLDER">
|
||||||
<File Id="MtClient.dll" Name="MtClient.dll" KeyPath="yes"
|
<File Id="MtClient.dll" Name="MtClient.dll" KeyPath="yes" Source="$(var.ProductPath)MtClient.dll" />
|
||||||
src="$(var.ProductPath)MtClient.dll"/>
|
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<Component Id="NewtonsoftJsondll" Directory="INSTALLFOLDER">
|
<Component Id="NewtonsoftJsondll" Directory="INSTALLFOLDER">
|
||||||
<File Id="Newtonsoft.Json.dll" Name="Newtonsoft.Json.dll" KeyPath="yes"
|
<File Id="Newtonsoft.Json.dll" Name="Newtonsoft.Json.dll" KeyPath="yes" Source="$(var.ProductPath)Newtonsoft.Json.dll" />
|
||||||
src="$(var.ProductPath)Newtonsoft.Json.dll"/>
|
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<Component Id="MtApi5Expert" Directory="ExpertFolder">
|
<Component Id="MtApi5Expert" Directory="ExpertFolder">
|
||||||
<File Id="MtApi5.ex5" Name="MtApi5.ex5" KeyPath="yes"
|
<File Id="MtApi5.ex5" Name="MtApi5.ex5" KeyPath="yes" Source="..\mq5\MtApi5.ex5" />
|
||||||
Source="..\mq5\MtApi5.ex5" />
|
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<Component Id="AppShortcutConnMgr" Guid="*" Directory="ApplicationProgramsFolder">
|
<Component Id="AppShortcutConnMgr" Directory="ApplicationProgramsFolder">
|
||||||
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall" />
|
||||||
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
|
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
</ComponentGroup>
|
</ComponentGroup>
|
||||||
|
|
||||||
<ComponentGroup Id="MT5ConnectorComponents">
|
<ComponentGroup Id="MT5ConnectorComponents">
|
||||||
|
|
||||||
<Component Id="ConnectionProfileRegistryKey" Guid="*" Directory="INSTALLFOLDER">
|
<Component Id="ConnectionProfileRegistryKey" Directory="INSTALLFOLDER">
|
||||||
<RegistryKey Root="HKCU"
|
<RegistryKey Root="HKCU" Key="Software\MtApi\ConnectionProfiles\Local" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
|
||||||
Key="Software\MtApi\ConnectionProfiles\Local"
|
<RegistryValue Type="string" Name="Host" Value="" />
|
||||||
Action="createAndRemoveOnUninstall">
|
<RegistryValue Type="integer" Name="Port" Value="8222" KeyPath="yes" />
|
||||||
<RegistryValue Type="string" Name="Host" Value=""/>
|
|
||||||
<RegistryValue Type="integer" Name="Port" Value="8222" KeyPath="yes"/>
|
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<Component Id="MT5ConnectorDll" Directory="$(var.PlatformSystemFolder)">
|
<Component Id="MT5ConnectorDll" Directory="$(var.PlatformSystemFolder)">
|
||||||
<File Id="MT5Connector5.dll" Name="MT5Connector.dll" KeyPath="yes"
|
<File Id="MT5Connector5.dll" Name="MT5Connector.dll" KeyPath="yes" Source="$(var.ProductPathNative)MT5Connector.dll" />
|
||||||
Source="$(var.ProductPathNative)MT5Connector.dll" />
|
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
</ComponentGroup>
|
</ComponentGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user