mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-28 02:57:56 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db4bb44fb3 | |||
| 68d5fa98af | |||
| dc28823ca9 |
@@ -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;
|
||||
}
|
||||
@@ -14,4 +14,5 @@ EXPORTS initExpert
|
||||
getCommandType
|
||||
getIntValue
|
||||
getDoubleValue
|
||||
getStringValue
|
||||
getStringValue
|
||||
getBooleanValue
|
||||
@@ -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)
|
||||
|
||||
@@ -195,6 +195,11 @@ namespace MtApi
|
||||
MtRequest = 155,
|
||||
|
||||
//Backtesting
|
||||
BacktestingReady = 156
|
||||
BacktestingReady = 156,
|
||||
|
||||
//Symbols
|
||||
SymbolsTotal = 200,
|
||||
SymbolName = 201,
|
||||
SymbolSelect = 202
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user