remove backups ...

This commit is contained in:
2025-05-08 14:17:32 +03:30
parent c013e593ad
commit d50bee9f96
15 changed files with 0 additions and 31361 deletions
-124
View File
@@ -1,124 +0,0 @@
//
// Parsing Pivots ...
//
// Detect Selected Pivot ...
XBoxZone lastOSCPivot;
double providedSL = 0;
bool hasNewOSC = false;
bool hasPivots = HasChild(pivots);
if (hasPivots)
{
//
// Detect Selected Pivots ...
count = ArraySize(pivots);
for (int i = 0; i < count; i++)
{
//
XBoxZone iPivot = pivots[i];
//
// Detect Selected Last OSC Pivots ...
bool isOSC =
Contains(
"XCA_RSI",
iPivot.type //
) ||
Contains(
"XCA_CCI",
iPivot.type //
);
bool canSetOSC =
!isOSC
? false
: !lastOSCPivot.IsValid()
? true
: lastOSCPivot.from < iPivot.from;
if (canSetOSC)
{
//
lastOSCPivot = iPivot;
//
// Detect New OSC Pivot Happens ...
hasNewOSC = lastOSCPivot.IsValid() &&
cBar.time == lastOSCPivot.to;
}
//
// Check Pivot Box Type ...
bool isPVPivot =
Contains(
"XCA_PEAKSWHRES",
iPivot.type //
) ||
Contains(
"XCA_VALESWLSUP",
iPivot.type //
);
if (isPVPivot)
{
//
// Select Box for OSC ...
if (hasNewOSC)
{
//
bool canSelectBox =
pivotBox.IsValid()
? false
: lastOSCPivot.dir == iPivot.dir &&
(IsBullish(iPivot.dir)
? lastOSCPivot.upper > iPivot.upper &&
lastOSCPivot.lower < iPivot.upper &&
lastOSCPivot.lower <= iPivot.lower
: lastOSCPivot.lower < iPivot.lower &&
lastOSCPivot.upper > iPivot.lower &&
lastOSCPivot.upper >= iPivot.upper);
if (canSelectBox)
{
pivotBox = iPivot;
}
}
}
//
iPivot.Clean();
//
}
}
//
// Signaller Summarization ...
//
// Cond1 Act Using PEAK VALE Box Activation or Rejection ...
//
bool isCond1Bullish =
//
hasNewOSC &&
(cVale < pVale ||
pVale < p2Vale) &&
pivotBox.IsValid() &&
pivotBox.IsBullish() &&
lastOSCPivot.IsBullish() &&
conditions.isValeIsPivot
//
;
//
bool isCond1Bearish =
//
hasNewOSC &&
(cPeak > pPeak ||
pPeak > p2Peak) &&
pivotBox.IsValid() &&
pivotBox.IsBearish() &&
lastOSCPivot.IsBearish() &&
conditions.isPeakIsPivot
//
;
////////////////////////////////////////////////////////////////////
-853
View File
@@ -1,853 +0,0 @@
///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Indicator
// -------------------------------------------------
// Name: XCXCAEASignaller ...
// Description: Class for XCAEA Signaller ...
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
//
// Global Properties ...
#property library
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://saherelm.ir"
#property version "1.00"
#property description "SaherElm Class for XCAEA Signaller"
#property strict
//
// Imports ...
#include "../../Classes/x-saherelm.base.class.mq5"
#include "../../Classes/x-saherelm.x-cobject.class.mq5"
#include "../Classes/xcaea.x-poi.detector.class.mq5"
#include "../Classes/xcaea.x-poi.drawer.class.mq5"
#include "../Helpers/xcaea.helper.mq5"
#include "../Libraries/xcaea.signaller.lib.mq5"
//
// Definitions ...
class XCXCAEASignaller : XCBase
{
//
// Public ...
public:
//
// Props ...
bool useGuards;
XCAEAInputs inputs;
XBarTracker barTraker;
XCXCAEAHelper *helper;
XCXCAEAPOIDrawer *drawer;
bool continuesRFTillTarget;
XBoxZone unAvailableBoxes[];
XCXCAEAPOIDetector *detector;
XCAEAStrategyConditions mConditions;
XCAEAStrategyConditions mConditionsCollection[];
//
// Constructor ...
XCXCAEASignaller(
string _symbol,
ENUM_TIMEFRAMES _period //
)
{
//
symbol = _symbol;
period = _period;
//
Init();
}
//
// Deconstructor ...
~XCXCAEASignaller()
{
DeInit();
}
//
// Properties ...
string GetSymbol()
{
return symbol;
}
ENUM_TIMEFRAMES GetPeriod()
{
return period;
}
//
// Signaller Tools ...
/**
* Detect Setup Conditions based on Signalling ...
*
* @param maxAllowedSLDistanceInPoint: int, Max Allowed SL Distance in Points (if Bigger thn Zero Provided) ...
*
* @return ( bool )
*/
bool DetectSignalSetup(
double tpReward = 3,
double maxAllowedSLDistanceInPoint = 100 //
)
{
//
bool result = false;
//
// Check Bar Processing ...
if (!barTraker.CanProcessBar())
{
return result;
}
//
bool isBullish = false;
bool isBearish = false;
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int ppIndex = pIndex + 1;
//
int loopback = 10;
//
int idx = -1;
int count = 0;
bool has = false;
//
double ask = GetAsk(symbol);
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
//
XOHCL zBar;
XOHCL cBar;
XOHCL pBar;
XOHCL pPBar;
result = zBar.Init(
symbol,
period,
zIndex //
);
result =
result &&
zBar.GetPreviousBar(cBar);
result =
result &&
cBar.GetPreviousBar(pBar);
result =
result &&
pBar.GetPreviousBar(pPBar);
if (!result)
{
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
pPBar.Clean();
//
return result;
}
//
// Setup Conditions ...
XBoxZone boxes[];
XBoxZone pivotBox;
XBoxZone signalBox;
double additionalSL = 0;
XBoxZone bullishBoxes[];
XBoxZone bearishBoxes[];
bool hasSignalBox = false;
XCAEAConditions conditions;
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
//
// Detecting Pivots ...
detector.Update(
zIndex //
);
//
// Validate Pivots ...
detector.Validate(
unAvailableBoxes,
zIndex //
);
//
// Draw Founded Pivots ...
drawer.Draw(cTime);
//
// Retrieve Valid Boxes ...
// //
// // Bullish ...
// int bullishBoxesCount =
// detector
// .FillBullishBoxes(bullishBoxes);
// //
// // Bearish ...
// int bearishBoxesCount =
// detector
// .FillBearishBoxes(bearishBoxes);
// //
// Copy(
// bullishBoxes,
// boxes,
// false //
// );
// Copy(
// bearishBoxes,
// boxes,
// false //
// );
int boxesCount = ArraySize(boxes);
bool hasBoxes = IsValidSize(boxesCount);
//
// Filter UnAvailable Boxes ...
if (hasBoxes)
{
//
// Remove UnAvailable Boxes ...
has = HasChild(unAvailableBoxes);
if (has)
{
//
count = ArraySize(unAvailableBoxes);
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = unAvailableBoxes[i];
//
has = FindBoxIndex(
idx,
iBox,
boxes //
);
if (has)
{
//
ArrayRemove(
boxes,
idx,
1 //
);
}
}
}
//
hasBoxes = HasChild(boxes);
boxesCount = ArraySize(boxes);
}
//
//
//
//
// if (hasBoxes)
// {
// }
//
// Detect Sinal Box ...
hasSignalBox = DetectXCAEAConditions(
boxes,
conditions,
pivotBox,
signalBox,
additionalSL,
signalBoxDir,
helper,
zIndex,
loopback //
);
//
// Make Pivot Box UnAvailable ...
if (pivotBox.IsValid())
{
//
AddRef(
pivotBox,
unAvailableBoxes //
);
}
//
isBullish = hasSignalBox &&
IsBullish(signalBoxDir);
//
isBearish = hasSignalBox &&
IsBearish(signalBoxDir);
//
result = isBullish ||
isBearish;
if (result)
{
//
// Do What we Want ...
barTraker.Waits();
//
// Draw Signal Box ...
XCBoxObject *iObj;
bool isCreated = helper.poiDrawer.DrawBox(
signalBox,
iObj //
);
if (isCreated)
{
//
mObjects.Add(iObj);
ZeroMemory(iObj);
//
Print("Signal Box ...");
}
//
// Prepare Conditions ...
mConditions.symbol = symbol;
mConditions.period = period;
//
double spread = GetSpread(symbol);
//
double entry =
isBullish
? signalBox.upper
: signalBox.lower;
//
double sl =
isBullish
? signalBox.lower
: signalBox.upper;
if (additionalSL > 0)
{
//
sl =
isBullish
? sl - additionalSL
: sl + additionalSL;
}
//
double risk =
isBullish
? entry - sl
: sl - entry;
risk += spread;
if (risk >= maxAllowedSLDistanceInPoint * points)
{
//
// Fix Risk in Big Distances ...
double hh5 = zBar.FindHighest(5, MODE_HIGH);
double ll5 = zBar.FindLowest(5, MODE_LOW);
//
double hhll5Delta = hh5 - ll5;
double riskDelta = hhll5Delta / 2;
risk = riskDelta;
}
//
double rewardTP = risk * tpReward;
//
double tp =
isBullish
? entry + rewardTP
: entry - rewardTP;
//
// Filling ...
mConditions.sl = sl;
mConditions.tp = tp;
mConditions.pivot =
isBullish
? sl
: entry;
mConditions.point =
isBullish
? entry
: sl;
mConditions.dir = signalBoxDir;
mConditions.provider = "XCAEA";
mConditions.signalBox = signalBox;
mConditions.setupTime = zBar.time;
mConditions.conditions = conditions;
//
// Select RF Rewards ...
if (continuesRFTillTarget)
{
//
double rfReward = 1;
while (rfReward < tpReward)
{
//
double rewardRF = risk * rfReward;
double rfTP =
isBullish
? entry + rewardRF
: entry - rewardRF;
//
Add(
rfTP,
mConditions.targets //
);
//
rfReward++;
}
}
else
{
//
double rfReward = 1;
//
double rewardRF = risk * rfReward;
double rfTP =
isBullish
? entry + rewardRF
: entry - rewardRF;
//
Add(
rfTP,
mConditions.targets //
);
}
}
//
// Cleanup Resource ...
//
Clean(boxes);
Clean(bullishBoxes);
Clean(bearishBoxes);
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
pPBar.Clean();
//
pivotBox.Clean();
signalBox.Clean();
conditions.Clean();
//
return result;
}
/**
* Detect Trigger Conditions for Specified Signal ...
*
* @param conditions: XCAEAStrategyConditions instance Reference, Specified Signal Conditions ...
* @param maxAllowedSetupAge: specified Setup Age for Expiration (if bigger than Zero) ...
*
* @return ( bool )
*/
bool DetectSignalTrigger(
XCAEAStrategyConditions &conditions,
int maxAllowedSetupAge = 60 //
)
{
//
bool result = false;
//
result = conditions.IsSetuped();
if (!result)
{
return result;
}
//
datetime setupTime = conditions.setupTime;
ENUM_X_DIRECTION setupDir = conditions.dir;
//
bool isBullish = IsBullish(setupDir);
bool isBearish = IsBearish(setupDir);
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int ppIndex = pIndex + 1;
//
int loopback = 10;
//
double ask = GetAsk(symbol);
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
//
// Check Signal Validation ...
// IMPORTANT: since all Validations done in SetUp Process ...
// here we only Execute Signal ...
//
result = isBullish ||
isBearish;
//
if (result)
{
//
conditions.triggerTime = cTime;
conditions.type = isBullish
? X_POSITION_TYPE_LONG
: X_POSITION_TYPE_SHORT;
//
}
//
// Cleanup ...
//
return result;
}
/**
* Detect Guards bsed on Signalling Class ...
*
* @param guards: XCAEAGuard instance Collection, Holds Provided Guards ...
* @param positions: XPosition instance Collection, Provides Signalling Based Positions for Apply Guards on them ...
* @param provider: X121SMCStrategySignalProviderData instance Reference, Specified Data for Cycles ...
*
* @return ( bool )
*/
bool DetectGuards(
XCAEAGuard &guards[],
const XPosition &positions[] //
)
{
//
bool result = false;
//
return result;
}
/**
* Add Conditions to Conditions Collection if not Exists ...
*
* @param maxAllowed: int, Specified Max Allowed Holding Conditions ...
*
* @return ( int )
*/
int AddConditionsIfNotExists(
int maxAllowed = 10 //
)
{
//
int result = 0;
//
bool isSetuped = IsValid(mConditions.setupTime) &&
HasDirection(mConditions.dir);
if (!isSetuped)
{
return result;
}
//
int count = ArraySize(mConditionsCollection);
if (IsValidSize(count))
{
//
// Copy Original Items ...
XCAEAStrategyConditions tmpItems[];
Copy(
mConditionsCollection,
tmpItems //
);
//
// Prese Item Data ...
bool isBullish = IsBullish(mConditions.dir);
//
for (int i = 0; i < count; i++)
{
//
XCAEAStrategyConditions iItem = tmpItems[i];
//
bool canRemove = mConditions.dir == iItem.dir &&
mConditions.pivot == iItem.pivot;
if (canRemove)
{
//
ArrayRemove(
mConditionsCollection,
i,
1 //
);
}
}
//
Clean(tmpItems);
}
//
AddRef(
mConditions,
mConditionsCollection //
);
//
// Remove Olds ...
CleanupArray(
mConditionsCollection,
maxAllowed //
);
//
result = ArraySize(mConditionsCollection);
//
return result;
}
//
// Protected ...
protected:
//
//
// Private ...
private:
//
// Props ...
string symbol;
ENUM_TIMEFRAMES period;
CArrayObj mObjects;
CArrayObj mBarObjects;
/**
* Initialize ...
*/
void Init()
{
//
useGuards = false;
continuesRFTillTarget = true;
//
barTraker.Init(
symbol,
period //
);
//
inputs.Default();
//
// Configure Indicators ...
//
// XCC ...
inputs.ccInputs.showCandles = true;
//
// XCT ...
inputs.ctInputs.showCandleTime = true;
//
// XCA ...
//
inputs.caInputs.supResSmoothingLength = 7;
inputs.caInputs.supResSmoothingMode = X_MA_MODE_NONE;
//
inputs.caInputs.showKI = true;
inputs.caInputs.showTKI = false;
inputs.caInputs.showSar = false;
inputs.caInputs.showVidya = true;
inputs.caInputs.showTrend = false;
inputs.caInputs.showSwings = false;
inputs.caInputs.showLongCycle = false;
inputs.caInputs.showHindCycle = false;
inputs.caInputs.showFiboLevel1 = false;
inputs.caInputs.showFiboLevel2 = false;
inputs.caInputs.showFiboLevel3 = false;
inputs.caInputs.showShortCycle = false;
inputs.caInputs.showMediumCycle = false;
inputs.caInputs.showPeaksAndVales = true;
inputs.caInputs.showPeakAndValeGolden = false;
inputs.caInputs.showSupportAndResistance = false;
//
// XOSCS ...
// inputs.oscsInputs.rsiLength = 5;
// inputs.oscsInputs.cciLength = 5;
// inputs.oscsInputs.mfiLength = 5;
// inputs.oscsInputs.rviLength = 5;
//
// Oscillators Views ...
inputs.showCCI = false;
inputs.showRSI = false;
inputs.showMFI = false;
inputs.showRVI = false;
inputs.showADX = false;
inputs.showMACD = false;
//
// XCAEA Helper ...
helper = new XCXCAEAHelper();
helper.Init(
symbol,
period,
inputs //
);
//
// Initialize and Configure Detector ...
detector = new XCXCAEAPOIDetector(helper);
//
// Configure Detector ...
detector.detectRSIPeakPivots = true;
detector.detectRSIValePivots = true;
detector.detectCCIPeakPivots = true;
detector.detectCCIValePivots = true;
detector.detectFVGBullishPivots = true;
detector.detectFVGBearishPivots = true;
detector.detectValeSupSWLPivots = true;
detector.detectPeakResSWHPivots = true;
detector.detectPVFVGBullishPivots = true;
detector.detectPVFVGBearishPivots = true;
//
// Initialize and Configure Drawer ...
drawer = new XCXCAEAPOIDrawer(detector);
//
drawer.ignoreUpdateOSCTos = true;
//
// Configure Drawer ...
drawer.drawRSIPeakPivots = true;
drawer.drawRSIValePivots = true;
drawer.drawCCIPeakPivots = true;
drawer.drawCCIValePivots = true;
drawer.drawFVGBullishPivots = false;
drawer.drawFVGBearishPivots = false;
drawer.drawValeSupSWLPivots = true;
drawer.drawPeakResSWHPivots = true;
drawer.drawPVFVGBullishPivots = true;
drawer.drawPVFVGBearishPivots = true;
//
// Configure Widths ...
drawer.rsiPeakPivotsWidth = 4;
drawer.rsiValePivotsWidth = 4;
drawer.cciPeakPivotsWidth = 4;
drawer.cciValePivotsWidth = 4;
drawer.fvgBullishPivotsWidth = 2;
drawer.fvgBearishPivotsWidth = 2;
drawer.valeSupSWLPivotsWidth = 1;
drawer.peakResSWHPivotsWidth = 1;
drawer.pvFVGBullishPivotsWidth = 1;
drawer.pvFVGBearishPivotsWidth = 1;
//
// Configure Colors ...
drawer.rsiPeakPivotsColor = clrMagenta;
drawer.rsiValePivotsColor = clrAqua;
drawer.cciPeakPivotsColor = clrMagenta;
drawer.cciValePivotsColor = clrAqua;
drawer.fvgBullishPivotsColor = clrLime;
drawer.fvgBearishPivotsColor = clrRed;
drawer.valeSupSWLPivotsColor = clrAqua;
drawer.peakResSWHPivotsColor = clrMagenta;
drawer.pvFVGBullishPivotsColor = clrLime;
drawer.pvFVGBearishPivotsColor = clrRed;
//
// Configures Styles ...
drawer.rsiPeakPivotsStyle = STYLE_DASH;
drawer.rsiValePivotsStyle = STYLE_DASH;
drawer.cciPeakPivotsStyle = STYLE_DASH;
drawer.cciValePivotsStyle = STYLE_DASH;
drawer.fvgBullishPivotsStyle = STYLE_DASHDOTDOT;
drawer.fvgBearishPivotsStyle = STYLE_DASHDOTDOT;
drawer.valeSupSWLPivotsStyle = STYLE_SOLID;
drawer.peakResSWHPivotsStyle = STYLE_SOLID;
drawer.pvFVGBullishPivotsStyle = STYLE_DASHDOTDOT;
drawer.pvFVGBearishPivotsStyle = STYLE_DASHDOTDOT;
//
}
/**
* DeInitialize ...
*/
void DeInit()
{
//
inputs.Clean();
//
ZeroMemory(drawer);
ZeroMemory(helper);
ZeroMemory(detector);
//
mConditions.Clean();
Clean(mConditionsCollection);
//
mObjects.Clear();
mBarObjects.Clear();
//
barTraker.Clean();
}
//
};
//
File diff suppressed because it is too large Load Diff
-1087
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,573 +0,0 @@
///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Indicator
// -------------------------------------------------
// Name: X121 XSWLH
// Description: XSWLH ...
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
//
// Global Properties ...
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://saherelm.ir"
#property version "1.00"
#property description "SaherElm X121 XSWLH Indicator"
#property strict
//
// Definitions ...
//
#define ShortName "X121 XSWLH"
//
// Includes Common Library ...
#include "../Libraries/x-saherelm.common.lib.mq5"
//
// Inputs ...
//
input int swingLength; // Swing Length
//
input int startCalculationForLastBars = 1000; // Calculate Last n Bars
//
input bool showSwingLow; // Show Swing Low
input bool showSwingHigh; // Show Swing High
//
input int swingLowArrowCode = 225; // Swing Low Arrow Code
input int swingHighArrowCode = 226; // Swing High Arrow Code
//
#define emptyValue 0.0
//
// Buffers ...
//
#property indicator_chart_window
//
#property indicator_buffers 2
#property indicator_plots 2
//
// SWING LOW ...
//
#define swingLowBufferIndex 0
double swingLowBuffer[];
//
#property indicator_label1 "SWL"
#property indicator_type1 DRAW_ARROW
#property indicator_color1 clrGreen
#property indicator_width1 1
//
// SWING HIGH ...
//
#define swingHighBufferIndex 1
double swingHighBuffer[];
//
#property indicator_label2 "SWH"
#property indicator_type2 DRAW_ARROW
#property indicator_color2 clrRed
#property indicator_width2 1
//
// Data Buffers ...
//
#define lastBufferIndex 1
//
// Variables, Properties and etc ...
//
// this counts Available Bars ...
int limit;
//
int firstBarIndex;
//
int maxLength;
//
// Event Handlers ...
/**
* Initialize Indicator ...
*
* @return ( int )
*/
int OnInit()
{
//
// Validate Inputs ...
if (!ValidateInputs())
{
return INIT_PARAMETERS_INCORRECT;
}
//
// Initialize Indicator Handlers ...
//
// because in some cases we may have more than one input for
// calculation and we must prevent any calculation
// untill we pass the biggest input length, here we get max Input length
// and then wait until pass it ...
maxLength = ExtractMaxLengthOfInputs();
//
// Define Index Buffers ...
DefineBuffers();
//
// Set Indicator ShortName ...
SetIndicatorName();
//
// Init Succeed ...
return INIT_SUCCEEDED;
}
/**
* De Initialize Indicator ...
*
* @param reason: Integer, De Initialization Reason ...
*/
void OnDeinit(const int reason)
{
//
// REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function
// REASON_REMOVE 1 Program removed from a chart
// REASON_RECOMPILE 2 Program recompiled
// REASON_CHARTCHANGE 3 A symbol or a chart period is changed
// REASON_CHARTCLOSE 4 Chart closed
// REASON_PARAMETERS 5 Inputs changed by a user
// REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings
// REASON_TEMPLATE 7 Another chart template applied
// REASON_INITFAILED 8 The OnInit() handler returned a non-zero value
// REASON_CLOSE 9 Terminal closed
}
/**
* Calculate Bars ...
*
* @param rates_total: Integer, Total Bars on Chart ...
* @param prev_calculated: Integer, Total Calculated Bars on Charts ...
* @param time: DateTime Array, History of Open Time ...
* @param open: Double Array, History of Open Prices ...
* @param high: Double Array, History of High Prices ...
* @param low: Double Array, History of Low Prices ...
* @param close: Double Array, History of Close Prices ...
* @param tick_volume: Long, History of Tick Volumes on Bar ...
* @param volume: Long, History of Trade Volumes ...
* @param spread: Double, History of Spread Price ...
*
* @return ( int )
*/
int OnCalculate(
const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[] //
)
{
//
// Prepare Buffers ...
ArraySetAsSeries(time, true);
ArraySetAsSeries(open, true);
ArraySetAsSeries(high, true);
ArraySetAsSeries(low, true);
ArraySetAsSeries(close, true);
ArraySetAsSeries(tick_volume, true);
ArraySetAsSeries(volume, true);
ArraySetAsSeries(spread, true);
//
limit = (prev_calculated > rates_total || prev_calculated <= 0)
? rates_total
: (rates_total - prev_calculated) + 1;
//
// Main Loop ...
for (int i = limit - 1; i >= 0 && !IsStopped(); i--)
{
//
CalculateBuffers(
i,
prev_calculated,
rates_total,
//
open,
high,
close,
low,
tick_volume //
);
}
//
return rates_total;
}
//
// Functions ...
/**
* Validate Input Args for Initialization ...
*
* @return ( bool )
*/
bool ValidateInputs()
{
//
bool result = false;
//
result =
//
swingLength > 0
//
;
//
return result;
}
/**
* Extract Max Length of Inputs ...
*
* @return ( int )
*/
int ExtractMaxLengthOfInputs()
{
//
int result = 0;
//
result = MathMax(result, swingLength);
//
return result;
}
/**
* Define Required Buffers ...
*/
void DefineBuffers()
{
//
// Plot Buffers ...
//
// SWING Low ...
//
ENUM_DRAW_TYPE swingLowDrawType = showSwingLow ? DRAW_ARROW : DRAW_NONE;
//
ArraySetAsSeries(swingLowBuffer, true);
SetIndexBuffer(swingLowBufferIndex, swingLowBuffer, INDICATOR_DATA);
//
PlotIndexSetInteger(swingLowBufferIndex, PLOT_SHOW_DATA, showSwingLow);
PlotIndexSetInteger(swingLowBufferIndex, PLOT_DRAW_TYPE, swingLowDrawType);
//
PlotIndexSetDouble(swingLowBufferIndex, PLOT_EMPTY_VALUE, emptyValue);
PlotIndexSetInteger(swingLowBufferIndex, PLOT_ARROW, swingLowArrowCode);
//
// SWING High ...
//
ENUM_DRAW_TYPE swingHighDrawType = showSwingHigh ? DRAW_ARROW : DRAW_NONE;
//
ArraySetAsSeries(swingHighBuffer, true);
SetIndexBuffer(swingHighBufferIndex, swingHighBuffer, INDICATOR_DATA);
//
PlotIndexSetInteger(swingHighBufferIndex, PLOT_SHOW_DATA, showSwingHigh);
PlotIndexSetInteger(swingHighBufferIndex, PLOT_DRAW_TYPE, swingHighDrawType);
//
PlotIndexSetDouble(swingHighBufferIndex, PLOT_EMPTY_VALUE, emptyValue);
PlotIndexSetInteger(swingHighBufferIndex, PLOT_ARROW, swingHighArrowCode);
}
/**
* Set Indicator Short Name and also we can define Buffers Labels ...
*/
void SetIndicatorName()
{
//
IndicatorSetInteger(INDICATOR_DIGITS, _Digits);
IndicatorSetString(INDICATOR_SHORTNAME, ShortName);
}
/**
* Fill All Bufers to Zero Vlue for Specified Bar Index ...
*
* @param barIndex: Integer ...
*/
void FillBuffersZero(int barIndex)
{
//
swingLowBuffer[barIndex] = emptyValue;
swingHighBuffer[barIndex] = emptyValue;
}
/**
* Calculate Custom Buffers ...
*
* @param bar_index: Integer, Represent Current Bar ...
* @param prevCalculated: Integer, Represent Previous Calculated Bars ...
* @param ratesTotal: Integer, Represents All Available Bars ...
* @param open: Double Array, History of Open Prices ...
* @param high: Double Array, History of High Prices ...
* @param close: Double Array, History of Close Prices ...
* @param low: Double Array, History of Low Prices ...
* @param tickVolume: Long, History of Tick Volumes on Bar ...
*/
void CalculateBuffers(
int bar_index, // Selected Bar Index
const int prevCalculated,
const int ratesTotal,
const double &open[],
const double &high[],
const double &close[],
const double &low[],
const long &tickVolume[] //
)
{
//
int barsLimit = startCalculationForLastBars > 0
? startCalculationForLastBars
: 0;
if (barsLimit == 0)
{
//
barsLimit = ratesTotal;
firstBarIndex = barsLimit - 1;
}
else
{
//
firstBarIndex = startCalculationForLastBars;
}
//
// bool canCalculate = true;
bool canCalculate =
bar_index <= barsLimit;
if (canCalculate)
{
//
// Calculate Support nad Resistance ...
CalculateValues(
bar_index,
prevCalculated,
ratesTotal,
open,
high,
close,
low,
tickVolume //
);
}
else
{
FillBuffersZero(bar_index);
}
}
/**
* Calculate Values ...
*
* @param bar_index: int, Specified Bar Index ...
* @param prevCalculated: int, Provides Previous Calculated Bars ...
* @param ratesTotal: int, Provides All Availabled Bars ...
* @param open: double Collection, Provides Open Prices Time Series ...
* @param high: double Collection, Provides High Prices Time Series ...
* @param close: double Collection, Provides Close Prices Time Series ...
* @param low: double Collection, Provides Low Prices Time Series ...
* @param tickVolume: long Collection, Provides Ticks Volume Prices Time Series ...
*/
void CalculateValues(
int bar_index, // Selected Bar Index
const int prevCalculated,
const int ratesTotal,
const double &open[],
const double &high[],
const double &close[],
const double &low[],
const long &tickVolume[] //
)
{
//
// Check Prev Bar ...
//
int lastBarIndex = bar_index + 1;
bool isFirstBar =
startCalculationForLastBars > 0
? bar_index == startCalculationForLastBars
: bar_index == firstBarIndex;
//
// Reading Last Values ...
//
double iSWLPrev =
isFirstBar
? emptyValue
: swingLowBuffer[lastBarIndex];
//
double iSWHPrev =
isFirstBar
? emptyValue
: swingHighBuffer[lastBarIndex];
//
// Checking Swings ...
bool isSwingLow = IsSwingLow(high, low, bar_index, swingLength);
bool isSwingHigh = IsSwingHigh(high, low, bar_index, swingLength);
bool hasSwing = isSwingLow ||
isSwingHigh;
if (!hasSwing)
{
//
// FillBuffersZero(bar_index);
//
swingLowBuffer[bar_index] = iSWLPrev;
swingHighBuffer[bar_index] = iSWHPrev;
return;
}
//
double iSWL = low[bar_index];
double iSWH = high[bar_index];
//
// Act Based on Swing High or Swing Low Detection ...
if (isSwingLow && !isSwingHigh)
{
//
// Detect Swing High based On swing Low ...
iSWH = iSWHPrev;
}
else if (isSwingHigh && !isSwingLow)
{
//
// Detect Swing Low Based On Swing High ...
iSWL = iSWLPrev;
}
//
if (iSWL > iSWLPrev && iSWH == iSWHPrev)
{
iSWL = iSWLPrev;
}
//
if (iSWH < iSWHPrev && iSWL == iSWLPrev)
{
iSWH = iSWHPrev;
}
//
swingLowBuffer[bar_index] = iSWL;
swingHighBuffer[bar_index] = iSWH;
}
//
// Helpers ...
//
bool IsSwingLow(
const double &high[],
const double &low[],
int index,
int length //
)
{
//
bool result = false;
//
result = index + 1 + length <= firstBarIndex;
if (!result)
{
return result;
}
//
for (int i = index + 1; i <= index + length; i++)
{
//
result = low[index] < low[i];
if (!result)
{
break;
}
}
//
return result;
}
//
bool IsSwingHigh(
const double &high[],
const double &low[],
int index,
int length //
)
{
//
bool result = false;
//
result = index + 1 + length <= firstBarIndex;
if (!result)
{
return result;
}
//
for (int i = index + 1; i <= index + length; i++)
{
//
result = high[index] > high[i];
if (!result)
{
break;
}
}
//
return result;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-273
View File
@@ -1,273 +0,0 @@
//
// Detect SignalBox Trigger ...
// Cond1:
// - Close Under Min / Max ...
// - All Trendings in Direction ...
// - Consolidating Trendings ...
// - ...
bool CanTriggerCond1(
XCXCAEAHelper *helper,
XBoxZone &box,
ENUM_X_DIRECTION &dir,
double &sls[],
int barIndex = 0,
int loopback = 10 //
)
{
//
bool result = false;
//
// Normalize Args ...
Clean(sls);
dir = X_DIRECTION_NONE;
loopback = NormalizeInt(loopback, 5);
barIndex = NormalizeInt(barIndex, 0);
//
// Validate Decision Box ...
result = box.IsValid();
if (!result)
{
return result;
}
//
// Retrieve Market Conditions ...
XCAEAConditions conditions;
result = helper.GetConditions(
conditions,
barIndex,
loopback //
);
//
// Extract CBar ...
XOHCL cBar;
result = cBar.Init(
conditions.symbol,
conditions.period,
barIndex //
);
if (!result)
{
//
cBar.Clean();
conditions.Clean();
//
return result;
}
//
// Bar Conditions ...
//
ENUM_X_DIRECTION barDir;
//
// ENGULF ...
//
bool isCBarEngulfed = helper
.barAnalyser
.IsEngulfed(
cBar,
barDir //
);
//
bool isCBarBullishEngulfed =
isCBarEngulfed &&
IsBullish(barDir);
//
bool isCBarBearishEngulfed =
isCBarEngulfed &&
IsBearish(barDir);
//
bool isBullish = box.IsBullish();
bool isBearish = box.IsBearish();
//
int zIDX = 0;
int cIDX = zIDX + 1;
int pIDX = cIDX + 1;
int p2IDX = pIDX + 1;
int p3IDX = p2IDX + 1;
int p4IDX = p3IDX + 1;
//
// Reading Values ...
//
// SAR ...
double cSAR = conditions.sarBuffer[cIDX];
//
// SWH ...
double cSWH = conditions.swingHighBuffer[cIDX];
//
// SWL ...
double cSWL = conditions.swingLowBuffer[cIDX];
//
// PEAK ...
double cPeak = conditions.peakBuffer[cIDX];
//
// VALE ...
double cVale = conditions.valeBuffer[cIDX];
//
// MAH ...
double cMAH = conditions.mahBuffer[cIDX];
//
// MAC ...
double cMAC = conditions.macBuffer[cIDX];
//
// MAL ...
double cMAL = conditions.malBuffer[cIDX];
//
// KI ...
double cKI = conditions.kiBuffer[cIDX];
double cKIState = conditions.kiStateBuffer[cIDX];
//
// TKI ...
double cTKI = conditions.tkiBuffer[cIDX];
double cTKIState = conditions.tkiStateBuffer[cIDX];
//
// FAST ...
double cFast = conditions.fastBuffer[cIDX];
double cFastState = conditions.fastStateBuffer[cIDX];
//
// VIDYA ...
double cVidya = conditions.vidyaBuffer[cIDX];
double cVidyaState = conditions.vidyaStateBuffer[cIDX];
//
// TREND ...
double cTrend = conditions.trendBuffer[cIDX];
double cTrendState = conditions.trendStateBuffer[cIDX];
//
// Generating Conditions ...
//
bool isSWLOverBox = cSWL > box.lower;
bool isSWHUnderBox = cSWH < box.upper;
//
bool isValeOverBox = cVale > box.lower;
bool isPeakUnderBox = cPeak < box.upper;
//
bool hasBullishPress =
// isBullish &&
(isSWLOverBox ||
isValeOverBox);
//
bool hasBearishPress =
// isBearish &&
(isSWHUnderBox ||
isPeakUnderBox);
//
double trends[] = {
cMAH,
cMAC,
cMAL,
cKI,
cTKI,
cFast,
cVidya,
cTrend //
};
double trendMax = GetMax(trends);
double trendMin = GetMin(trends);
Copy(
trends,
sls //
);
//
bool isCloseOverMax = cBar.close > trendMax;
bool isCloseUnderMin = cBar.close < trendMin;
//
bool isStateBullish =
cKIState > 0 &&
cTKIState > 0 &&
cFastState > 0 &&
cTrendState > 0 &&
cVidyaState > 0;
//
bool isStateBearish =
cKIState < 0 &&
cTKIState < 0 &&
cFastState < 0 &&
cTrendState < 0 &&
cVidyaState < 0;
//
bool hasBullishTrend =
// isBullish &&
isStateBullish &&
isCloseOverMax;
//
bool hasBearishTrend =
// isBearish &&
isStateBearish &&
isCloseUnderMin;
//
// Summarizing ...
//
bool canTriggerLong =
// isBullish &&
hasBullishPress &&
hasBullishTrend;
//
bool canTriggerShort =
// isBearish &&
hasBearishPress &&
hasBearishTrend;
//
result = canTriggerLong ||
canTriggerShort;
if (result)
{
//
dir = canTriggerLong
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
Print("Triggered ...");
}
//
// Cleanup Resources ...
//
cBar.Clean();
Clean(trends);
conditions.Clean();
//
return result;
}
-878
View File
@@ -1,878 +0,0 @@
///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Indicator
// -------------------------------------------------
// Name: XCXCAEASignaller ...
// Description: Class for XCAEA Signaller ...
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
//
// Global Properties ...
#property library
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://saherelm.ir"
#property version "1.00"
#property description "SaherElm Class for XCAEA Signaller"
#property strict
//
// Imports ...
#include "../../Classes/x-saherelm.base.class.mq5"
#include "../../Classes/x-saherelm.x-cobject.class.mq5"
#include "../Classes/xcaea.x-poi.detector.class.mq5"
#include "../Classes/xcaea.x-poi.drawer.class.mq5"
#include "../Helpers/xcaea.helper.mq5"
#include "../Libraries/xcaea.signaller.lib.mq5"
//
// Definitions ...
class XCXCAEASignaller : XCBase
{
//
// Public ...
public:
//
// Props ...
bool useGuards;
XCAEAInputs inputs;
XBarTracker barTraker;
XCXCAEAHelper *helper;
XCXCAEAPOIDrawer *drawer;
bool continuesRFTillTarget;
XBoxZone unAvailableBoxes[];
XCXCAEAPOIDetector *detector;
XCAEAStrategyConditions mConditions;
XCAEAStrategyConditions mConditionsCollection[];
//
// Constructor ...
XCXCAEASignaller(
string _symbol,
ENUM_TIMEFRAMES _period //
)
{
//
symbol = _symbol;
period = _period;
//
Init();
}
//
// Deconstructor ...
~XCXCAEASignaller()
{
DeInit();
}
//
// Properties ...
string GetSymbol()
{
return symbol;
}
ENUM_TIMEFRAMES GetPeriod()
{
return period;
}
//
// Signaller Tools ...
/**
* Detect Setup Conditions based on Signalling ...
*
* @param maxAllowedSLDistanceInPoint: int, Max Allowed SL Distance in Points (if Bigger thn Zero Provided) ...
*
* @return ( bool )
*/
bool DetectSignalSetup(
double tpReward = 3,
double maxAllowedSLDistanceInPoint = 100 //
)
{
//
bool result = false;
//
// Check Bar Processing ...
if (!barTraker.CanProcessBar())
{
return result;
}
//
bool isBullish = false;
bool isBearish = false;
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int ppIndex = pIndex + 1;
//
int loopback = 10;
//
int idx = -1;
int count = 0;
bool has = false;
//
double ask = GetAsk(symbol);
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
//
XOHCL zBar;
XOHCL cBar;
XOHCL pBar;
XOHCL pPBar;
result = zBar.Init(
symbol,
period,
zIndex //
);
result =
result &&
zBar.GetPreviousBar(cBar);
result =
result &&
cBar.GetPreviousBar(pBar);
result =
result &&
pBar.GetPreviousBar(pPBar);
if (!result)
{
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
pPBar.Clean();
//
return result;
}
//
// Setup Conditions ...
XBoxZone boxes[];
XBoxZone pivotBox;
XBoxZone signalBox;
double additionalSL = 0;
XBoxZone bullishBoxes[];
XBoxZone bearishBoxes[];
bool hasSignalBox = false;
XCAEAConditions conditions;
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
//
// Detecting Pivots ...
detector.Update(
zIndex //
);
//
// Validate Pivots ...
detector.Validate(
unAvailableBoxes,
zIndex //
);
//
// Draw Founded Pivots ...
drawer.Draw(cTime);
//
// Retrieve Valid Boxes ...
//
// Bullish ...
int bullishBoxesCount =
detector
.FillBullishBoxes(bullishBoxes);
//
// Bearish ...
int bearishBoxesCount =
detector
.FillBearishBoxes(bearishBoxes);
//
Copy(
bullishBoxes,
boxes,
false //
);
Copy(
bearishBoxes,
boxes,
false //
);
int boxesCount = ArraySize(boxes);
bool hasBoxes = IsValidSize(boxesCount);
//
// Filter UnAvailable Boxes ...
if (hasBoxes)
{
//
// Remove UnAvailable Boxes ...
has = HasChild(unAvailableBoxes);
if (has)
{
//
count = ArraySize(unAvailableBoxes);
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = unAvailableBoxes[i];
//
has = FindBoxIndex(
idx,
iBox,
boxes //
);
if (has)
{
//
ArrayRemove(
boxes,
idx,
1 //
);
}
}
}
//
hasBoxes = HasChild(boxes);
boxesCount = ArraySize(boxes);
}
//
//
//
//
// if (hasBoxes)
// {
// }
//
// Detect Sinal Box ...
hasSignalBox = DetectXCAEAConditions(
boxes,
conditions,
pivotBox,
signalBox,
additionalSL,
signalBoxDir,
helper,
zIndex,
loopback //
);
//
// Make Pivot Box UnAvailable ...
if (pivotBox.IsValid())
{
//
AddRef(
pivotBox,
unAvailableBoxes //
);
}
//
isBullish = hasSignalBox &&
IsBullish(signalBoxDir);
//
isBearish = hasSignalBox &&
IsBearish(signalBoxDir);
//
result = isBullish ||
isBearish;
if (result)
{
//
// Do What we Want ...
barTraker.Waits();
//
// Draw Signal Box ...
XCBoxObject *iObj;
bool isCreated = helper.poiDrawer.DrawBox(
signalBox,
iObj //
);
if (isCreated)
{
//
mObjects.Add(iObj);
ZeroMemory(iObj);
//
Print("Signal Box ...");
}
//
// Prepare Conditions ...
mConditions.symbol = symbol;
mConditions.period = period;
//
double spread = GetSpread(symbol);
//
double entry =
isBullish
? signalBox.upper
: signalBox.lower;
//
double sl =
isBullish
? signalBox.lower
: signalBox.upper;
if (additionalSL > 0)
{
//
sl =
isBullish
? sl - additionalSL
: sl + additionalSL;
}
//
double risk =
isBullish
? entry - sl
: sl - entry;
risk += spread;
if (risk >= maxAllowedSLDistanceInPoint * points)
{
//
// Fix Risk in Big Distances ...
double hh5 = zBar.FindHighest(5, MODE_HIGH);
double ll5 = zBar.FindLowest(5, MODE_LOW);
//
double hhll5Delta = hh5 - ll5;
double riskDelta = hhll5Delta / 2;
risk = riskDelta;
}
//
double rewardTP = risk * tpReward;
//
double tp =
isBullish
? entry + rewardTP
: entry - rewardTP;
//
// Filling ...
mConditions.sl = sl;
mConditions.tp = tp;
mConditions.pivot =
isBullish
? sl
: entry;
mConditions.point =
isBullish
? entry
: sl;
mConditions.dir = signalBoxDir;
mConditions.provider = "XCAEA";
mConditions.signalBox = signalBox;
mConditions.setupTime = zBar.time;
mConditions.conditions = conditions;
//
// Select RF Rewards ...
if (continuesRFTillTarget)
{
//
double rfReward = 1;
while (rfReward < tpReward)
{
//
double rewardRF = risk * rfReward;
double rfTP =
isBullish
? entry + rewardRF
: entry - rewardRF;
//
Add(
rfTP,
mConditions.targets //
);
//
rfReward++;
}
}
else
{
//
double rfReward = 1;
//
double rewardRF = risk * rfReward;
double rfTP =
isBullish
? entry + rewardRF
: entry - rewardRF;
//
Add(
rfTP,
mConditions.targets //
);
}
}
//
// Cleanup Resource ...
//
Clean(boxes);
Clean(bullishBoxes);
Clean(bearishBoxes);
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
pPBar.Clean();
//
pivotBox.Clean();
signalBox.Clean();
conditions.Clean();
//
return result;
}
/**
* Detect Trigger Conditions for Specified Signal ...
*
* @param conditions: XCAEAStrategyConditions instance Reference, Specified Signal Conditions ...
* @param maxAllowedSetupAge: specified Setup Age for Expiration (if bigger than Zero) ...
*
* @return ( bool )
*/
bool DetectSignalTrigger(
XCAEAStrategyConditions &conditions,
int maxAllowedSetupAge = 60 //
)
{
//
bool result = false;
//
result = conditions.IsSetuped();
if (!result)
{
return result;
}
//
datetime setupTime = conditions.setupTime;
ENUM_X_DIRECTION setupDir = conditions.dir;
//
bool isBullish = IsBullish(setupDir);
bool isBearish = IsBearish(setupDir);
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int ppIndex = pIndex + 1;
//
int loopback = 10;
//
double ask = GetAsk(symbol);
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
//
// Check Signal Validation ...
// IMPORTANT: since all Validations done in SetUp Process ...
// here we only Execute Signal ...
//
result = isBullish ||
isBearish;
//
if (result)
{
//
conditions.triggerTime = cTime;
conditions.type = isBullish
? X_POSITION_TYPE_LONG
: X_POSITION_TYPE_SHORT;
//
}
//
// Cleanup ...
//
return result;
}
/**
* Detect Guards bsed on Signalling Class ...
*
* @param guards: XCAEAGuard instance Collection, Holds Provided Guards ...
* @param positions: XPosition instance Collection, Provides Signalling Based Positions for Apply Guards on them ...
* @param provider: X121SMCStrategySignalProviderData instance Reference, Specified Data for Cycles ...
*
* @return ( bool )
*/
bool DetectGuards(
XCAEAGuard &guards[],
const XPosition &positions[] //
)
{
//
bool result = false;
//
return result;
}
/**
* Add Conditions to Conditions Collection if not Exists ...
*
* @param maxAllowed: int, Specified Max Allowed Holding Conditions ...
*
* @return ( int )
*/
int AddConditionsIfNotExists(
int maxAllowed = 10 //
)
{
//
int result = 0;
//
bool isSetuped = IsValid(mConditions.setupTime) &&
HasDirection(mConditions.dir);
if (!isSetuped)
{
return result;
}
//
int count = ArraySize(mConditionsCollection);
if (IsValidSize(count))
{
//
// Copy Original Items ...
XCAEAStrategyConditions tmpItems[];
Copy(
mConditionsCollection,
tmpItems //
);
//
// Prese Item Data ...
bool isBullish = IsBullish(mConditions.dir);
//
for (int i = 0; i < count; i++)
{
//
XCAEAStrategyConditions iItem = tmpItems[i];
//
bool canRemove = mConditions.dir == iItem.dir &&
mConditions.pivot == iItem.pivot;
if (canRemove)
{
//
ArrayRemove(
mConditionsCollection,
i,
1 //
);
}
}
//
Clean(tmpItems);
}
//
AddRef(
mConditions,
mConditionsCollection //
);
//
// Remove Olds ...
CleanupArray(
mConditionsCollection,
maxAllowed //
);
//
result = ArraySize(mConditionsCollection);
//
return result;
}
//
// Protected ...
protected:
//
//
// Private ...
private:
//
// Props ...
string symbol;
ENUM_TIMEFRAMES period;
CArrayObj mObjects;
CArrayObj mBarObjects;
/**
* Initialize ...
*/
void Init()
{
//
useGuards = false;
continuesRFTillTarget = true;
//
barTraker.Init(
symbol,
period //
);
//
inputs.Default();
//
// Configure Indicators ...
//
// XCC ...
inputs.ccInputs.showCandles = true;
//
// XCT ...
inputs.ctInputs.showCandleTime = true;
//
// XCA ...
//
inputs.caInputs.supResSmoothingLength = 7;
inputs.caInputs.supResSmoothingMode = X_MA_MODE_NONE;
//
inputs.caInputs.showKI = true;
inputs.caInputs.showTKI = false;
inputs.caInputs.showSar = false;
inputs.caInputs.showVidya = true;
inputs.caInputs.showTrend = false;
inputs.caInputs.showSwings = false;
inputs.caInputs.showLongCycle = false;
inputs.caInputs.showHindCycle = false;
inputs.caInputs.showFiboLevel1 = false;
inputs.caInputs.showFiboLevel2 = false;
inputs.caInputs.showFiboLevel3 = false;
inputs.caInputs.showShortCycle = false;
inputs.caInputs.showMediumCycle = false;
inputs.caInputs.showPeaksAndVales = true;
inputs.caInputs.showPeakAndValeGolden = false;
inputs.caInputs.showSupportAndResistance = false;
//
// XOSCS ...
// inputs.oscsInputs.rsiLength = 5;
// inputs.oscsInputs.cciLength = 5;
// inputs.oscsInputs.mfiLength = 5;
// inputs.oscsInputs.rviLength = 5;
//
// Oscillators Views ...
inputs.showCCI = false;
inputs.showRSI = false;
inputs.showMFI = false;
inputs.showRVI = false;
inputs.showADX = false;
inputs.showMACD = false;
//
// XCAEA Helper ...
helper = new XCXCAEAHelper();
helper.Init(
symbol,
period,
inputs //
);
//
// Initialize and Configure Detector ...
detector = new XCXCAEAPOIDetector(helper);
//
detector.detectSWHPivot = false;
detector.detectSWLPivot = false;
detector.detectPeakPivot = false;
detector.detectValePivot = false;
detector.detectRSIPeakPivot = true;
detector.detectRSIValePivot = true;
detector.detectCCIPeakPivot = true;
detector.detectCCIValePivot = true;
detector.detectKIBullishPivot = false;
detector.detectKIBearishPivot = false;
detector.detectFVGBullishPivot = true;
detector.detectFVGBearishPivot = true;
detector.detectPeakSWHResPivot = true;
detector.detectValeSWLSupPivot = true;
detector.detectTKIBullishPivot = false;
detector.detectCycleSameLLPivot = false;
detector.detectCycleSameHHPivot = false;
detector.detectTKIBearishPivot = false;
detector.detectTrendBullishPivot = false;
detector.detectTrendBearishPivot = false;
detector.detectTKITRNDBullishPivot = false;
detector.detectTKITRNDBearishPivot = false;
detector.detectRSICrossedOverOSPivot = false;
detector.detectRSICrossedUnderOBPivot = false;
detector.detectCCICrossedOverOSPivot = false;
detector.detectCCICrossedUnderOBPivot = false;
//
// Initialize and Configure Drawer ...
drawer = new XCXCAEAPOIDrawer(detector);
//
// UnActive Pivots ...
drawer.drawSWHPivots = false;
drawer.drawSWLPivots = false;
drawer.drawPeakPivots = false;
drawer.drawValePivots = false;
drawer.drawRSIPeakPivots = true; // true;
drawer.drawRSIValePivots = true; // true;
drawer.drawCCIPeakPivots = false; // true;
drawer.drawCCIValePivots = false; // true;
drawer.drawKIBullishPivots = false;
drawer.drawKIBearishPivots = false;
drawer.drawFVGBullishPivots = false;
drawer.drawFVGBearishPivots = false;
drawer.drawPeakSWHResPivots = false; // true;
drawer.drawValeSWLSupPivots = false; // true;
drawer.drawTKIBullishPivots = false;
drawer.drawTKIBearishPivots = false;
drawer.drawPVFVGBullishPivots = false; // true;
drawer.drawPVFVGBearishPivots = false; // true;
drawer.drawCycleSameLLPivots = false;
drawer.drawCycleSameHHPivots = false;
drawer.drawTrendBullishPivots = false;
drawer.drawTrendBearishPivots = false;
drawer.drawTKITRNDBullishPivots = false;
drawer.drawTKITRNDBearishPivots = false;
drawer.drawRSICrossedOverOSPivots = false;
drawer.drawRSICrossedUnderOBPivots = false;
drawer.drawCCICrossedOverOSPivots = false;
drawer.drawCCICrossedUnderOBPivots = false;
//
drawer.drawTicks = false;
//
// Configure Width ...
drawer.peakPivotWidth = 1;
drawer.valePivotWidth = 1;
drawer.ticksBullishWidth = 2;
drawer.ticksBearishWidth = 2;
drawer.fvgBullishPivotWidth = 1;
drawer.fvgBearishPivotWidth = 1;
drawer.oscsBullishPivotWidth = 2;
drawer.oscsBearishPivotWidth = 2;
//
// Configure Colors ...
drawer.peakPivotColor = clrMagenta;
drawer.valePivotColor = clrAqua;
drawer.ticksBullishColor = clrYellow;
drawer.ticksBearishColor = clrOrange;
drawer.fvgBullishPivotColor = clrLime;
drawer.fvgBearishPivotColor = clrRed;
drawer.oscsBullishPivotColor = clrAqua;
drawer.oscsBearishPivotColor = clrMagenta;
//
// Configure Style ...
drawer.peakPivotStyle = STYLE_SOLID;
drawer.valePivotStyle = STYLE_SOLID;
drawer.ticksBullishStyle = STYLE_DOT;
drawer.ticksBearishStyle = STYLE_DOT;
drawer.fvgBullishPivotStyle = STYLE_DASH;
drawer.fvgBearishPivotStyle = STYLE_DASH;
drawer.oscsBullishPivotStyle = STYLE_SOLID;
drawer.oscsBearishPivotStyle = STYLE_SOLID;
}
/**
* DeInitialize ...
*/
void DeInit()
{
//
inputs.Clean();
//
ZeroMemory(drawer);
ZeroMemory(helper);
ZeroMemory(detector);
//
mConditions.Clean();
Clean(mConditionsCollection);
//
mObjects.Clear();
mBarObjects.Clear();
//
barTraker.Clean();
}
//
};
//
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff