Implemented functions ChartGetDouble, ChartGetInteger (MT5)

This commit is contained in:
vdemydiuk
2018-03-15 11:20:20 +02:00
parent 9bfda95cf7
commit 29be184136
3 changed files with 54 additions and 1 deletions
+1 -1
View File
@@ -1739,7 +1739,7 @@ namespace MtApi5
}
///<summary>
///Sets a value for a corresponding property of the specified chart. Chart property must be of the string type.
///Returns the value of a corresponding property of the specified chart. Chart property must be of double type.
///</summary>
///<param name="chartId">Chart ID. 0 means the current chart.</param>
///<param name="propId">Chart property ID. This value can be one of the ENUM_CHART_PROPERTY_DOUBLE values.</param>
BIN
View File
Binary file not shown.
+53
View File
@@ -765,6 +765,12 @@ int executeCommand()
case 249: //ChartSetString
Execute_ChartSetString();
break;
case 250: //ChartGetDouble
Execute_ChartGetDouble();
break;
case 251: //ChartGetInteger
Execute_ChartGetInteger();
break;
case 252: //ChartGetString
Execute_ChartGetString();
break;
@@ -805,6 +811,7 @@ int executeCommand()
#define SEND_LONG_RESPONSE(response) SEND_RESPONSE_OR_PRINT_ERROR(sendLongResponse, response, __FUNCTION__)
#define SEND_ULONG_RESPONSE(response) SEND_RESPONSE_OR_PRINT_ERROR(sendULongResponse, response, __FUNCTION__)
#define SEND_BOOL_RESPONSE(response) SEND_RESPONSE_OR_PRINT_ERROR(sendBooleanResponse, response, __FUNCTION__)
#define SEND_DOUBLE_RESPONSE(response) SEND_RESPONSE_OR_PRINT_ERROR(sendDoubleResponse, response, __FUNCTION__)
//-------------------------------------------------------------
@@ -5792,6 +5799,52 @@ void Execute_ChartSetString()
SEND_BOOL_RESPONSE(result)
}
void Execute_ChartGetDouble()
{
long chart_id;
int prop_id;
int sub_window;
GET_LONG_VALUE(0, chart_id, "chart_id")
GET_INT_VALUE(1, prop_id, "prop_id")
GET_INT_VALUE(2, sub_window, "sub_window")
#ifdef __DEBUG_LOG__
PrintFormat("%s: chart_id = %d, prop_id = %d, sub_window = %d", __FUNCTION__, chart_id, prop_id, sub_window);
#endif
double result = ChartGetDouble(chart_id, (ENUM_CHART_PROPERTY_DOUBLE)prop_id, sub_window);
#ifdef __DEBUG_LOG__
PrintFormat("%s: result = %f", __FUNCTION__, result);
#endif
SEND_DOUBLE_RESPONSE(result)
}
void Execute_ChartGetInteger()
{
long chart_id;
int prop_id;
int sub_window;
GET_LONG_VALUE(0, chart_id, "chart_id")
GET_INT_VALUE(1, prop_id, "prop_id")
GET_INT_VALUE(2, sub_window, "sub_window")
#ifdef __DEBUG_LOG__
PrintFormat("%s: chart_id = %d, prop_id = %d, sub_window = %d", __FUNCTION__, chart_id, prop_id, sub_window);
#endif
long result = ChartGetInteger(chart_id, (ENUM_CHART_PROPERTY_INTEGER)prop_id, sub_window);
#ifdef __DEBUG_LOG__
PrintFormat("%s: result = %d", __FUNCTION__, result);
#endif
SEND_LONG_RESPONSE(result)
}
void Execute_ChartApplyTemplate()
{
long ChartId;