Issue #90: Added time functions: TimeCurrent, TimeTradeServer, TimeLocal, TimeGMT

This commit is contained in:
vdemydiuk
2018-02-19 18:48:31 +02:00
parent 83776f8b7a
commit 5c6751de9b
6 changed files with 155 additions and 6 deletions
BIN
View File
Binary file not shown.
+47 -3
View File
@@ -489,9 +489,9 @@ int executeCommand()
case 65: //PositionOpen
Execute_PositionOpen(false);
break;
case 1065: //PositionOpenWithResult
Execute_PositionOpen(true);
break;
// case 1065: //PositionOpenWithResult
// Execute_PositionOpen(true);
// break;
case 66: //BacktestingReady
Execute_BacktestingReady();
break;
@@ -665,6 +665,18 @@ int executeCommand()
case 126: //iVolumes
Execute_iVolumes();
break;
case 127: //TimeCurrent
Execute_TimeCurrent();
break;
case 128: //TimeTradeServer
Execute_TimeTradeServer();
break;
case 129: //TimeLocal
Execute_TimeLocal();
break;
case 130: //TimeGMT
Execute_TimeGMT();
break;
default:
Print("Unknown command type = ", commandType);
sendVoidResponse(ExpertHandle, _response_error);
@@ -5427,6 +5439,38 @@ void Execute_iVolumes()
PrintResponseError("iVolumes", _response_error);
}
}
void Execute_TimeCurrent()
{
if (!sendLongResponse(ExpertHandle, TimeCurrent(), _response_error))
{
PrintResponseError("TimeCurrent", _response_error);
}
}
void Execute_TimeTradeServer()
{
if (!sendLongResponse(ExpertHandle, TimeTradeServer(), _response_error))
{
PrintResponseError("TimeTradeServer", _response_error);
}
}
void Execute_TimeLocal()
{
if (!sendLongResponse(ExpertHandle, TimeLocal(), _response_error))
{
PrintResponseError("TimeLocal", _response_error);
}
}
void Execute_TimeGMT()
{
if (!sendLongResponse(ExpertHandle, TimeGMT(), _response_error))
{
PrintResponseError("TimeGMT", _response_error);
}
}
void PrintParamError(string paramName)
{