Implemented function ChartIndicatorDelete (MT5)

This commit is contained in:
vdemydiuk
2018-03-15 13:15:50 +02:00
parent bd45c45fa1
commit faef5f7d18
3 changed files with 29 additions and 2 deletions
+2 -2
View File
@@ -1798,13 +1798,13 @@ namespace MtApi5
}
///<summary>
///Performs shift of the specified chart by the specified number of bars relative to the specified position in the chart.
///Removes an indicator with a specified name from the specified chart window.
///</summary>
///<param name="chartId">Chart ID. 0 means the current chart.</param>
///<param name="subWindow">Number of the chart subwindow. 0 denotes the main chart subwindow.</param>
///<param name="indicatorShortname">The short name of the indicator which is set in the INDICATOR_SHORTNAME property with the IndicatorSetString() function. To get the short name of an indicator use the ChartIndicatorName() function.</param>
///<returns>
///Returns true if the command has been added to chart queue, otherwise false.
///Returns true in case of successful deletion of the indicator.
///</returns>
public bool ChartIndicatorDelete(long chartId, int subWindow, string indicatorShortname)
{
BIN
View File
Binary file not shown.
+27
View File
@@ -777,6 +777,9 @@ int executeCommand()
case 253: //ChartNavigate
Execute_ChartNavigate();
break;
case 254: //ChartIndicatorDelete
Execute_ChartIndicatorDelete();
break;
default:
Print("Unknown command type = ", commandType);
sendVoidResponse(ExpertHandle, _response_error);
@@ -5895,6 +5898,30 @@ void Execute_ChartNavigate()
SEND_BOOL_RESPONSE(result)
}
void Execute_ChartIndicatorDelete()
{
long chart_id;
int sub_window;
string indicator_shortname;
StringInit(indicator_shortname, 1000);
GET_LONG_VALUE(0, chart_id, "chart_id")
GET_INT_VALUE(1, sub_window, "sub_window")
GET_STRING_VALUE(2, indicator_shortname, "indicator_shortname")
#ifdef __DEBUG_LOG__
PrintFormat("%s: chart_id = %d, sub_window = %d, indicator_shortname = %s", __FUNCTION__, chart_id, sub_window, indicator_shortname);
#endif
bool result = ChartIndicatorDelete( chart_id, sub_window, indicator_shortname);
#ifdef __DEBUG_LOG__
PrintFormat("%s: result = %s", __FUNCTION__, BoolToString(result));
#endif
SEND_BOOL_RESPONSE(result)
}
void Execute_ChartApplyTemplate()
{
long ChartId;