Complete Grid System, Apply Refactor on Signalnfo and Change it To TradeHandler ...

This commit is contained in:
2024-06-15 08:06:40 +03:30
parent 87e3cb2661
commit df1cfae022
6 changed files with 1698 additions and 1125 deletions
+57 -5
View File
@@ -154,6 +154,46 @@ enum ENUM_X_POSITION_TYPE
X_POSITION_TYPE_SHORT = 3,
};
//
string ToString(ENUM_X_POSITION_TYPE value)
{
//
string result = NULL;
//
switch (value)
{
//
case X_POSITION_TYPE_ALL:
result = "All";
break;
//
case X_POSITION_TYPE_NONE:
result = "NONE";
break;
//
case X_POSITION_TYPE_SHORT:
result = "Short";
break;
//
case X_POSITION_TYPE_LONG:
result = "Long";
break;
}
//
return result;
}
//
bool IsLong(ENUM_X_POSITION_TYPE value)
{
return value == X_POSITION_TYPE_LONG;
}
//
bool ToPositinType(
ENUM_POSITION_TYPE &dest,
@@ -182,7 +222,15 @@ bool ToPositinType(
}
//
ENUM_X_POSITION_TYPE GetOppositXPositionType(ENUM_POSITION_TYPE type)
ENUM_X_POSITION_TYPE ToPositionType(ENUM_POSITION_TYPE value)
{
return IsLong(value)
? X_POSITION_TYPE_LONG
: X_POSITION_TYPE_SHORT;
}
//
ENUM_X_POSITION_TYPE GetOppositPositionType(ENUM_POSITION_TYPE type)
{
//
ENUM_X_POSITION_TYPE result = X_POSITION_TYPE_NONE;
@@ -4040,7 +4088,8 @@ ulong ExtractSupportedTicket(string value)
int ExtractSupportPositions(
XPosition &source[],
XPosition &dest[] // Result ...
) {
)
{
//
int result = 0;
@@ -4049,18 +4098,21 @@ int ExtractSupportPositions(
//
int sourceCount = ArraySize(source);
if (!IsValidSize(sourceCount)) {
if (!IsValidSize(sourceCount))
{
return result;
}
//
for (int i = 0; i < sourceCount; i++) {
for (int i = 0; i < sourceCount; i++)
{
//
XPosition iSource = source[i];
//
ulong iParentTicket = ExtractSupportedTicket(iSource.comment);
if (iParentTicket > 0) {
if (iParentTicket > 0)
{
//
AddRef(
iSource,