Compare commits

...

3 Commits

Author SHA1 Message Date
Konstantin Ivanov db4bb44fb3 Add SymbolSelect() and use existing local variables 2016-09-29 17:13:41 +03:00
Konstantin Ivanov 68d5fa98af Add SymbolName() 2016-09-29 16:30:11 +03:00
Konstantin Ivanov dc28823ca9 add SymbolsTotal() 2016-09-29 16:14:53 +03:00
6 changed files with 43 additions and 2 deletions
+15
View File
@@ -255,4 +255,19 @@ int _stdcall getStringValue(int expertHandle, int paramIndex, wchar_t* res)
return 0;
}
return 1;
}
int _stdcall getBooleanValue(int expertHandle, int paramIndex, int* res)
{
try
{
bool val = (bool)MtServerInstance::GetInstance()->GetCommandParameter(expertHandle, paramIndex);
*res = val == true ? 1 : 0;
}
catch (Exception^ e)
{
Debug::WriteLine("[ERROR] MT5Connector:getBooleanValue(): " + e->Message);
return 0;
}
return 1;
}
+2 -1
View File
@@ -14,4 +14,5 @@ EXPORTS initExpert
getCommandType
getIntValue
getDoubleValue
getStringValue
getStringValue
getBooleanValue
+20
View File
@@ -652,6 +652,26 @@ namespace MtApi
#endregion
#region Symbols
public int SymbolsTotal(bool selected)
{
var commandParameters = new ArrayList { selected };
return SendCommand<int>(MtCommandType.SymbolsTotal, commandParameters);
}
public string SymbolName(int pos, bool selected)
{
var commandParameters = new ArrayList { pos, selected };
return SendCommand<string>(MtCommandType.SymbolName, commandParameters);
}
public bool SymbolSelect(string name, bool select)
{
var commandParameters = new ArrayList { name, select };
return SendCommand<bool>(MtCommandType.SymbolSelect, commandParameters);
}
#endregion
#region Common Function
public void Alert(string msg)
+6 -1
View File
@@ -195,6 +195,11 @@ namespace MtApi
MtRequest = 155,
//Backtesting
BacktestingReady = 156
BacktestingReady = 156,
//Symbols
SymbolsTotal = 200,
SymbolName = 201,
SymbolSelect = 202
}
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.