mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-18 05:08:11 +00:00
Commands to handle with Terminal:
- TerminalInfoDoublePropertyId - TerminalInfoIntegerPropertyId - TerminalInfoStringPropertyId
This commit is contained in:
@@ -2108,7 +2108,7 @@ namespace MtApi5
|
|||||||
|
|
||||||
#region Commands of Terminal
|
#region Commands of Terminal
|
||||||
///<summary>
|
///<summary>
|
||||||
///Returns the value of a corresponding property of the mql4 program environment.
|
///Returns the value of a corresponding property of the mql5 program environment.
|
||||||
///</summary>
|
///</summary>
|
||||||
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_STRING enumeration.</param>
|
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_STRING enumeration.</param>
|
||||||
///<returns>
|
///<returns>
|
||||||
@@ -2121,7 +2121,7 @@ namespace MtApi5
|
|||||||
}
|
}
|
||||||
|
|
||||||
///<summary>
|
///<summary>
|
||||||
///Returns the value of a corresponding property of the mql4 program environment.
|
///Returns the value of a corresponding property of the mql5 program environment.
|
||||||
///</summary>
|
///</summary>
|
||||||
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_INTEGER enumeration.</param>
|
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_INTEGER enumeration.</param>
|
||||||
///<returns>
|
///<returns>
|
||||||
@@ -2134,7 +2134,7 @@ namespace MtApi5
|
|||||||
}
|
}
|
||||||
|
|
||||||
///<summary>
|
///<summary>
|
||||||
///Returns the value of a corresponding property of the mql4 program environment.
|
///Returns the value of a corresponding property of the mql5 program environment.
|
||||||
///</summary>
|
///</summary>
|
||||||
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_DOUBLE enumeration.</param>
|
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_DOUBLE enumeration.</param>
|
||||||
///<returns>
|
///<returns>
|
||||||
|
|||||||
@@ -78,6 +78,28 @@
|
|||||||
</ObjectDataProvider.MethodParameters>
|
</ObjectDataProvider.MethodParameters>
|
||||||
</ObjectDataProvider>
|
</ObjectDataProvider>
|
||||||
|
|
||||||
|
<ObjectDataProvider x:Key="ENUM_TERMINAL_INFO_INTEGER_Key" MethodName="GetValues"
|
||||||
|
ObjectType="{x:Type sys:Enum}">
|
||||||
|
<ObjectDataProvider.MethodParameters>
|
||||||
|
<x:Type TypeName="mtapi5:ENUM_TERMINAL_INFO_INTEGER"/>
|
||||||
|
</ObjectDataProvider.MethodParameters>
|
||||||
|
</ObjectDataProvider>
|
||||||
|
|
||||||
|
<ObjectDataProvider x:Key="ENUM_TERMINAL_INFO_STRING_Key" MethodName="GetValues"
|
||||||
|
ObjectType="{x:Type sys:Enum}">
|
||||||
|
<ObjectDataProvider.MethodParameters>
|
||||||
|
<x:Type TypeName="mtapi5:ENUM_TERMINAL_INFO_STRING"/>
|
||||||
|
</ObjectDataProvider.MethodParameters>
|
||||||
|
</ObjectDataProvider>
|
||||||
|
|
||||||
|
<ObjectDataProvider x:Key="ENUM_TERMINAL_INFO_DOUBLE_Key" MethodName="GetValues"
|
||||||
|
ObjectType="{x:Type sys:Enum}">
|
||||||
|
<ObjectDataProvider.MethodParameters>
|
||||||
|
<x:Type TypeName="mtapi5:ENUM_TERMINAL_INFO_DOUBLE"/>
|
||||||
|
</ObjectDataProvider.MethodParameters>
|
||||||
|
</ObjectDataProvider>
|
||||||
|
|
||||||
|
|
||||||
<ObjectDataProvider x:Key="ENUM_TIMEFRAMES_Key" MethodName="GetValues"
|
<ObjectDataProvider x:Key="ENUM_TIMEFRAMES_Key" MethodName="GetValues"
|
||||||
ObjectType="{x:Type sys:Enum}">
|
ObjectType="{x:Type sys:Enum}">
|
||||||
<ObjectDataProvider.MethodParameters>
|
<ObjectDataProvider.MethodParameters>
|
||||||
@@ -297,6 +319,47 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="Terminal Information">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Grid.Row="0" Margin="10">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.4*"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<ComboBox Grid.Column="0" Grid.Row="0"
|
||||||
|
SelectedItem="{Binding TerminalInfoDoublePropertyId}"
|
||||||
|
ItemsSource="{Binding Source={StaticResource ENUM_TERMINAL_INFO_DOUBLE_Key}}"/>
|
||||||
|
<Button Grid.Column="1" Grid.Row="0" Margin="10,0,0,0"
|
||||||
|
Command="{Binding TerminalInfoDoubleCommand}"
|
||||||
|
Content="TerminalInfoDouble" HorizontalAlignment="Left" />
|
||||||
|
|
||||||
|
<ComboBox Grid.Column="0" Grid.Row="1"
|
||||||
|
SelectedItem="{Binding TerminalInfoIntegerPropertyId}"
|
||||||
|
ItemsSource="{Binding Source={StaticResource ENUM_TERMINAL_INFO_INTEGER_Key}}"/>
|
||||||
|
<Button Grid.Column="1" Grid.Row="1" Margin="10,0,0,0"
|
||||||
|
Command="{Binding TerminalInfoIntegerCommand}"
|
||||||
|
Content="TerminalInfoInteger" HorizontalAlignment="Left" />
|
||||||
|
|
||||||
|
<ComboBox Grid.Column="0" Grid.Row="2"
|
||||||
|
SelectedItem="{Binding TerminalInfoStringPropertyId}"
|
||||||
|
ItemsSource="{Binding Source={StaticResource ENUM_TERMINAL_INFO_STRING_Key}}"/>
|
||||||
|
<Button Grid.Column="1" Grid.Row="2" Margin="10,0,0,0"
|
||||||
|
Command="{Binding TerminalInfoStringCommand}"
|
||||||
|
Content="TerminalInfoString" HorizontalAlignment="Left" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
<TabItem Header="Timeseries and Indicators Access">
|
<TabItem Header="Timeseries and Indicators Access">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ namespace MtApi5TestClient
|
|||||||
public DelegateCommand AccountInfoIntegerCommand { get; private set; }
|
public DelegateCommand AccountInfoIntegerCommand { get; private set; }
|
||||||
public DelegateCommand AccountInfoStringCommand { get; private set; }
|
public DelegateCommand AccountInfoStringCommand { get; private set; }
|
||||||
|
|
||||||
|
public DelegateCommand TerminalInfoDoubleCommand { get; private set; }
|
||||||
|
public DelegateCommand TerminalInfoIntegerCommand { get; private set; }
|
||||||
|
public DelegateCommand TerminalInfoStringCommand { get; private set; }
|
||||||
|
|
||||||
public DelegateCommand CopyRatesCommand { get; private set; }
|
public DelegateCommand CopyRatesCommand { get; private set; }
|
||||||
public DelegateCommand CopyTimesCommand { get; private set; }
|
public DelegateCommand CopyTimesCommand { get; private set; }
|
||||||
public DelegateCommand CopyOpenCommand { get; private set; }
|
public DelegateCommand CopyOpenCommand { get; private set; }
|
||||||
@@ -219,6 +223,11 @@ namespace MtApi5TestClient
|
|||||||
public ENUM_ACCOUNT_INFO_INTEGER AccountInfoIntegerPropertyId { get; set; }
|
public ENUM_ACCOUNT_INFO_INTEGER AccountInfoIntegerPropertyId { get; set; }
|
||||||
public ENUM_ACCOUNT_INFO_STRING AccountInfoStringPropertyId { get; set; }
|
public ENUM_ACCOUNT_INFO_STRING AccountInfoStringPropertyId { get; set; }
|
||||||
|
|
||||||
|
public ENUM_TERMINAL_INFO_DOUBLE TerminalInfoDoublePropertyId { get; set; }
|
||||||
|
public ENUM_TERMINAL_INFO_INTEGER TerminalInfoIntegerPropertyId { get; set; }
|
||||||
|
public ENUM_TERMINAL_INFO_STRING TerminalInfoStringPropertyId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public TimeSeriesValueViewModel TimeSeriesValues { get; set; }
|
public TimeSeriesValueViewModel TimeSeriesValues { get; set; }
|
||||||
|
|
||||||
public ObservableCollection<string> TimeSeriesResults { get; } = new ObservableCollection<string>();
|
public ObservableCollection<string> TimeSeriesResults { get; } = new ObservableCollection<string>();
|
||||||
@@ -297,6 +306,10 @@ namespace MtApi5TestClient
|
|||||||
AccountInfoIntegerCommand = new DelegateCommand(ExecuteAccountInfoInteger);
|
AccountInfoIntegerCommand = new DelegateCommand(ExecuteAccountInfoInteger);
|
||||||
AccountInfoStringCommand = new DelegateCommand(ExecuteAccountInfoString);
|
AccountInfoStringCommand = new DelegateCommand(ExecuteAccountInfoString);
|
||||||
|
|
||||||
|
TerminalInfoDoubleCommand = new DelegateCommand(ExecuteTerminalInfoDouble);
|
||||||
|
TerminalInfoIntegerCommand = new DelegateCommand(ExecuteTerminalInfoInteger);
|
||||||
|
TerminalInfoStringCommand = new DelegateCommand(ExecuteTerminalInfoString);
|
||||||
|
|
||||||
CopyRatesCommand = new DelegateCommand(ExecuteCopyRates);
|
CopyRatesCommand = new DelegateCommand(ExecuteCopyRates);
|
||||||
CopyTimesCommand = new DelegateCommand(ExecuteCopyTime);
|
CopyTimesCommand = new DelegateCommand(ExecuteCopyTime);
|
||||||
CopyOpenCommand = new DelegateCommand(ExecuteCopyOpen);
|
CopyOpenCommand = new DelegateCommand(ExecuteCopyOpen);
|
||||||
@@ -483,7 +496,7 @@ namespace MtApi5TestClient
|
|||||||
{
|
{
|
||||||
var result = await Execute(() => _mtApiClient.AccountInfoInteger(AccountInfoIntegerPropertyId));
|
var result = await Execute(() => _mtApiClient.AccountInfoInteger(AccountInfoIntegerPropertyId));
|
||||||
|
|
||||||
var message = $"AccountInfoInteger: property_id = {AccountInfoDoublePropertyId}; result = {result}";
|
var message = $"AccountInfoInteger: property_id = {AccountInfoIntegerPropertyId}; result = {result}";
|
||||||
AddLog(message);
|
AddLog(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,10 +504,35 @@ namespace MtApi5TestClient
|
|||||||
{
|
{
|
||||||
var result = await Execute(() => _mtApiClient.AccountInfoString(AccountInfoStringPropertyId));
|
var result = await Execute(() => _mtApiClient.AccountInfoString(AccountInfoStringPropertyId));
|
||||||
|
|
||||||
var message = $"AccountInfoString: property_id = {AccountInfoDoublePropertyId}; result = {result}";
|
var message = $"AccountInfoString: property_id = {AccountInfoStringPropertyId}; result = {result}";
|
||||||
AddLog(message);
|
AddLog(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void ExecuteTerminalInfoDouble(object o)
|
||||||
|
{
|
||||||
|
var result = await Execute(() => _mtApiClient.TerminalInfoDouble(TerminalInfoDoublePropertyId));
|
||||||
|
|
||||||
|
var message = $"TerminalInfoDouble: property_id = {TerminalInfoDoublePropertyId}; result = {result}";
|
||||||
|
AddLog(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ExecuteTerminalInfoInteger(object o)
|
||||||
|
{
|
||||||
|
var result = await Execute(() => _mtApiClient.TerminalInfoInteger(TerminalInfoIntegerPropertyId));
|
||||||
|
|
||||||
|
var message = $"TerminalInfoInteger: property_id = {TerminalInfoIntegerPropertyId}; result = {result}";
|
||||||
|
AddLog(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ExecuteTerminalInfoString(object o)
|
||||||
|
{
|
||||||
|
var result = await Execute(() => _mtApiClient.TerminalInfoString(TerminalInfoStringPropertyId));
|
||||||
|
|
||||||
|
var message = $"TerminalInfoString: property_id = {TerminalInfoStringPropertyId}; result = {result}";
|
||||||
|
AddLog(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private async void ExecuteCopyTime(object o)
|
private async void ExecuteCopyTime(object o)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(TimeSeriesValues?.SymbolValue)) return;
|
if (string.IsNullOrEmpty(TimeSeriesValues?.SymbolValue)) return;
|
||||||
|
|||||||
+46
-5
@@ -706,33 +706,37 @@ int executeCommand()
|
|||||||
Execute_IndicatorRelease();
|
Execute_IndicatorRelease();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 241: //ChartOpen
|
case 241: //ChartOpen
|
||||||
Execute_ChartOpen();
|
Execute_ChartOpen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 242: //ChartFirst
|
case 242: //ChartFirst
|
||||||
Execute_ChartFirst();
|
Execute_ChartFirst();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 243: //ChartFirst
|
case 243: //ChartFirst
|
||||||
Execute_ChartNext();
|
Execute_ChartNext();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 245: //ChartFirst
|
case 245: //ChartFirst
|
||||||
Execute_ChartSymbol();
|
Execute_ChartSymbol();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 236: //ChartApplyTemplate
|
case 236: //ChartApplyTemplate
|
||||||
Execute_ChartApplyTemplate();
|
Execute_ChartApplyTemplate();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 252: //ChartGetString
|
case 252: //ChartGetString
|
||||||
Execute_ChartGetString();
|
Execute_ChartGetString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 153: //TerminalInfoString
|
case 153: //TerminalInfoString
|
||||||
Execute_TerminalInfoString();
|
Execute_TerminalInfoString();
|
||||||
break;
|
break;
|
||||||
|
case 204: //TerminalInfoInteger
|
||||||
|
Execute_TerminalInfoInteger();
|
||||||
|
break;
|
||||||
|
case 205: //TerminalInfoDouble
|
||||||
|
Execute_TerminalInfoDouble();
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case 132: //GetLastError
|
case 132: //GetLastError
|
||||||
@@ -6202,6 +6206,43 @@ void Execute_TerminalInfoString()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Execute_TerminalInfoInteger()
|
||||||
|
{
|
||||||
|
int propertyId;
|
||||||
|
|
||||||
|
if (!getIntValue(ExpertHandle, 0, propertyId, _error))
|
||||||
|
{
|
||||||
|
PrintParamError("TerminalInfoInteger", "propertyId", _error);
|
||||||
|
sendErrorResponse(ExpertHandle, -1, _error, _response_error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sendIntResponse(ExpertHandle, TerminalInfoInteger((ENUM_TERMINAL_INFO_INTEGER)propertyId), _response_error))
|
||||||
|
{
|
||||||
|
PrintResponseError("TerminalInfoInteger", _response_error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Execute_TerminalInfoDouble()
|
||||||
|
{
|
||||||
|
int propertyId;
|
||||||
|
|
||||||
|
if (!getIntValue(ExpertHandle, 0, propertyId, _error))
|
||||||
|
{
|
||||||
|
PrintParamError("TerminalInfoDouble", "propertyId", _error);
|
||||||
|
sendErrorResponse(ExpertHandle, -1, _error, _response_error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sendDoubleResponse(ExpertHandle, TerminalInfoDouble((ENUM_TERMINAL_INFO_DOUBLE)propertyId), _response_error))
|
||||||
|
{
|
||||||
|
PrintResponseError("TerminalInfoDouble", _response_error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string ExecuteRequest_IndicatorCreate(JSONObject *jo)
|
string ExecuteRequest_IndicatorCreate(JSONObject *jo)
|
||||||
{
|
{
|
||||||
//Symbol
|
//Symbol
|
||||||
|
|||||||
Reference in New Issue
Block a user