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": [ "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": { "assignedTo": {
"name": "Hadi Khazaee Asl" "name": "Hadi Khazaee Asl"
@@ -28,15 +19,6 @@
"id": "4", "id": "4",
"references": [], "references": [],
"title": "add support for OB in XCAEA POI Detector" "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": [ "testing": [
@@ -68,6 +50,15 @@
"references": [], "references": [],
"title": "add support for Block Detection in Bar Analyser Class" "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": { "assignedTo": {
"name": "Hadi Khazaee Asl" "name": "Hadi Khazaee Asl"
@@ -99,6 +90,15 @@
"id": "6", "id": "6",
"references": [], "references": [],
"title": "Complete Perday Trade Management based on SL(s) and TP(s)" "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": [] "done": []
+68 -29
View File
@@ -44,21 +44,23 @@ input ENUM_TIMEFRAMES eaAnalysisPeriod = PERIOD_H1; // Analysis Period
// Symbols ... // Symbols ...
// //
// ------------------------------------------------------- // -------------------------------------------------------
// ----------
// eaSymbols: // eaSymbols:
// ---------- // ----------
// - if EMPTY use Current Symbol; // - if EMPTY use Current Symbol;
// - for Multi Symbol use Comma Separated Symbols: // - for Multi Symbol use Comma Separated Symbols:
// EURUSDb,XAUUSDb // EURUSDb,XAUUSDb
// //
// ------------------
// eaSymbolSessions: // eaSymbolSessions:
// ------------------ // ------------------
// - if EMPTY use WHOLE Times; // - if EMPTY use WHOLE Times;
// - for each Symbol use Comma Separated: // - 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 group "Symbols";
input string eaSymbols = "EURUSDb,XAUUSDb"; // Symbols Description input string eaSymbols = "EURUSDb,XAUUSDb"; // Symbols Description
input string eaSymbolSessions = "()"; // Symbols Sessions input string eaSymbolSessions = "(XEURS1_02:00_14:00),(XEURS2_19:00_23:00)|(XAUSDS1_02:00_21:00)"; // Symbols Sessions
// //
// Volume ... // Volume ...
@@ -763,14 +765,17 @@ void InitSymbolSessions()
if (hasSession) if (hasSession)
{ {
// //
// Extract Per Symbol Sessions ...
sessionsCount = SplitContent( sessionsCount = SplitContent(
sessions, sessions,
eaSymbolSessions // eaSymbolSessions,
"|" //
); );
} }
// //
// Setting Up Symbols ... // Setting Up Symbols ...
bool has = false;
// //
for (int i = 0; i < symbolsCount; i++) for (int i = 0; i < symbolsCount; i++)
@@ -801,44 +806,78 @@ void InitSymbolSessions()
if (hasSession) if (hasSession)
{ {
// //
for (int i = 0; i < symbolsCount; i++) { for (int i = 0; i < symbolsCount; i++)
{
// //
iSymbol = symbols[i]; iSymbol = symbols[i];
// //
if (i < sessionsCount) { if (i < sessionsCount)
{
// //
// Parsing Session Info ... // Extract Per Symbol Sessions ...
string tmp[]; string iSymbolSessionsStr[];
string iSession = sessions[i]; int iSymbolSessionsCount = SplitContent(
iSession iSymbolSessionsStr,
// int tmpCount = SplitContent( sessions[i],
// tmp, "," //
// 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);
} }
} }
} }
// //
// Setting Sessions ... Clean(iSymbolSessionsStr);
// 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(symbols);