add XCHSAR Indicator, Complete it's Helper and Implement usage of this in EA ...

This commit is contained in:
2024-11-20 01:50:13 +03:30
parent a345aa52c1
commit 868eecc916
4 changed files with 1996 additions and 20 deletions
+2
View File
@@ -24,6 +24,7 @@
#include "../../Classes/x-saherelm.base.class.mq5"
#include "../../Helpers/x-saherelm.x3ma.helper.mq5"
#include "../../Helpers/x-saherelm.x3vwap.helper.mq5"
#include "../../Helpers/x-saherelm.xchsar.helper.mq5"
#include "../../Helpers/x-saherelm.xpv.helper.mq5"
#include "../../Libraries/x-saherelm.common.lib.mq5"
#include "../../Libraries/x-saherelm.x-poi.lib.mq5"
@@ -387,6 +388,7 @@ struct X121SMCStrategyConditions
XPVConditions xpvConditions;
X3MAConditions x3maConditions;
X3VWAPConditions x3vwapConditions;
XCHSARConditions xchsarConditions;
//
void X121SMCStrategyConditions()
@@ -25,6 +25,7 @@
//
#include "../../Helpers/x-saherelm.x3ma.helper.mq5"
#include "../../Helpers/x-saherelm.x3vwap.helper.mq5"
#include "../../Helpers/x-saherelm.xchsar.helper.mq5"
#include "../../Helpers/x-saherelm.xpv.helper.mq5"
#include "../Classes/x-121.smc.base.strategy.class.mq5"
@@ -70,10 +71,8 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
//
delete xpvHelper;
delete x3maHelper;
delete xchsarHelper;
delete x3vwapHelper;
//
IndicatorRelease(mPSarHandler);
}
/**
@@ -412,9 +411,9 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
XCX3VWAPHelper *x3vwapHelper;
//
// Parabolic Sar ...
int mPSarHandler;
double mPSars[];
// XCHSAR ...
XCHSARInputs xchsarInputs;
XCXCHSARHelper *xchsarHelper;
//
XPVPivot mOrderFlow[];
@@ -490,15 +489,12 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
}
//
// Retrieve Parabolic Sars ...
int sarsCopied = CopyBuffer(
mPSarHandler,
0,
0,
conditionsLoopback,
mPSars //
// XCHSAR ...
result = xchsarHelper.GetConditions(
conditions.xchsarConditions,
cIndex,
conditionsLoopback //
);
result = sarsCopied >= conditionsLoopback;
if (!result)
{
return result;
@@ -1829,14 +1825,34 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
);
//
// Initialize PSar ...
double sarStep = 0.02;
double sarMax = 0.2;
mPSarHandler = iSAR(
// XCHCHSAR ...
//
xchsarInputs.Default();
//
xchsarInputs.scMethod = scMethod;
xchsarInputs.scPeriod = scPeriod;
xchsarInputs.mcMethod = mcMethod;
xchsarInputs.mcPeriod = mcPeriod;
xchsarInputs.lcMethod = lcMethod;
xchsarInputs.lcPeriod = lcPeriod;
xchsarInputs.hcMethod = hcMethod;
xchsarInputs.hcPeriod = hcPeriod;
//
xchsarInputs.showCurrent = true;
xchsarInputs.showShort = true;
xchsarInputs.showMedium = false;
xchsarInputs.showLong = false;
xchsarInputs.showHind = false;
//
xchsarHelper = new XCXCHSARHelper();
xchsarHelper.Init(
symbol,
period,
sarStep,
sarMax //
xchsarInputs //
);
}