mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-31 04:27:47 +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 0;
|
||||||
}
|
}
|
||||||
return 1;
|
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
|
getCommandType
|
||||||
getIntValue
|
getIntValue
|
||||||
getDoubleValue
|
getDoubleValue
|
||||||
getStringValue
|
getStringValue
|
||||||
|
getBooleanValue
|
||||||
@@ -652,6 +652,26 @@ namespace MtApi
|
|||||||
|
|
||||||
#endregion
|
#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
|
#region Common Function
|
||||||
|
|
||||||
public void Alert(string msg)
|
public void Alert(string msg)
|
||||||
|
|||||||
@@ -195,6 +195,11 @@ namespace MtApi
|
|||||||
MtRequest = 155,
|
MtRequest = 155,
|
||||||
|
|
||||||
//Backtesting
|
//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