add XCHSAR Indicator, Complete it's Helper and Implement usage of this in EA ...
This commit is contained in:
@@ -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 //
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user