add supports for Multi Symbol Multi Sessions Structure ...

This commit is contained in:
2025-05-09 18:33:36 +03:30
parent a251315294
commit 0fca3aec1e
2 changed files with 89 additions and 50 deletions
+18 -18
View File
@@ -11,15 +11,6 @@
}
],
"in-progress": [
{
"assignedTo": {
"name": "Hadi Khazaee Asl"
},
"creation_time": "2025-05-09T02:09:15.086Z",
"id": "8",
"references": [],
"title": "add support for Multi Time Frame and Multi Symbol"
},
{
"assignedTo": {
"name": "Hadi Khazaee Asl"
@@ -28,15 +19,6 @@
"id": "4",
"references": [],
"title": "add support for OB in XCAEA POI Detector"
},
{
"assignedTo": {
"name": "Hadi Khazaee Asl"
},
"creation_time": "2025-05-09T02:16:34.743Z",
"id": "9",
"references": [],
"title": "add support for Closing All Trades at Specified Time ..."
}
],
"testing": [
@@ -68,6 +50,15 @@
"references": [],
"title": "add support for Block Detection in Bar Analyser Class"
},
{
"assignedTo": {
"name": "Hadi Khazaee Asl"
},
"creation_time": "2025-05-09T02:16:34.743Z",
"id": "9",
"references": [],
"title": "add support for Closing All Trades at Specified Time ..."
},
{
"assignedTo": {
"name": "Hadi Khazaee Asl"
@@ -99,6 +90,15 @@
"id": "6",
"references": [],
"title": "Complete Perday Trade Management based on SL(s) and TP(s)"
},
{
"assignedTo": {
"name": "Hadi Khazaee Asl"
},
"creation_time": "2025-05-09T02:09:15.086Z",
"id": "8",
"references": [],
"title": "add support for Multi Time Frame and Multi Symbol"
}
],
"done": []
+71 -32
View File
@@ -44,21 +44,23 @@ input ENUM_TIMEFRAMES eaAnalysisPeriod = PERIOD_H1; // Analysis Period
// Symbols ...
//
// -------------------------------------------------------
// ----------
// eaSymbols:
// ----------
// - if EMPTY use Current Symbol;
// - for Multi Symbol use Comma Separated Symbols:
// EURUSDb,XAUUSDb
//
// ------------------
// eaSymbolSessions:
// ------------------
// - if EMPTY use WHOLE Times;
// - for each Symbol use Comma Separated:
// (Name,[hh:mm],[hh:mm]),
// (XEURS1_02:00_14:00),(XEURS2_19:00_23:00)|
// -------------------------------------------------------
input group "Symbols";
input string eaSymbols = "EURUSDb,XAUUSDb"; // Symbols Description
input string eaSymbolSessions = "()"; // Symbols Sessions
input string eaSymbols = "EURUSDb,XAUUSDb"; // Symbols Description
input string eaSymbolSessions = "(XEURS1_02:00_14:00),(XEURS2_19:00_23:00)|(XAUSDS1_02:00_21:00)"; // Symbols Sessions
//
// Volume ...
@@ -763,14 +765,17 @@ void InitSymbolSessions()
if (hasSession)
{
//
// Extract Per Symbol Sessions ...
sessionsCount = SplitContent(
sessions,
eaSymbolSessions //
eaSymbolSessions,
"|" //
);
}
//
// Setting Up Symbols ...
bool has = false;
//
for (int i = 0; i < symbolsCount; i++)
@@ -801,45 +806,79 @@ void InitSymbolSessions()
if (hasSession)
{
//
for (int i = 0; i < symbolsCount; i++) {
for (int i = 0; i < symbolsCount; i++)
{
//
iSymbol = symbols[i];
//
if (i < sessionsCount) {
if (i < sessionsCount)
{
//
// Parsing Session Info ...
string tmp[];
string iSession = sessions[i];
iSession
// int tmpCount = SplitContent(
// tmp,
// sessions[i] //
// );
// Extract Per Symbol Sessions ...
string iSymbolSessionsStr[];
int iSymbolSessionsCount = SplitContent(
iSymbolSessionsStr,
sessions[i],
"," //
);
//
// string iName = ;
has = IsValidSize(iSymbolSessionsCount);
if (has)
{
//
// Loop through Symbols Sessions ...
for (int j = 0; j < iSymbolSessionsCount; j++)
{
//
string iSessionDescriptorStr = ExtractString(iSymbolSessionsStr[j]);
has = IsValid(iSessionDescriptorStr);
if (has)
{
//
// Extract Session Descriptor Data ...
string parts[];
int partsCount = SplitContent(
parts,
iSessionDescriptorStr,
"_" //
);
has = IsValidSize(partsCount) && partsCount == 3;
if (has)
{
//
string iName = parts[0];
string iStart = parts[1];
string iEnd = parts[2];
has = IsValid(iName) &&
IsValid(iStart) &&
IsValid(iEnd);
if (has)
{
//
eaTradeManager
.SetTradeSession(
iSymbol,
iStart,
iEnd,
iName //
);
}
}
//
Clean(parts);
}
}
}
//
Clean(iSymbolSessionsStr);
}
}
}
//
// Setting Sessions ...
// eaTradeManager
// .SetTradeSession(
// _Symbol,
// "01:30", // Start ...
// "14:25", // End ...
// "XSaherSession" // Name ...
// );
// eaTradeManager
// .SetTradeSession(
// _Symbol,
// "19:30", // Start ...
// "11:30", // End ...
// "XSaherSession" // Name ...
// );
//
Clean(symbols);
Clean(sessions);