Files
xMQL5/BKPS/14031003/Classes/x-saherelm.x-poi.drawer.class.mq5
T
2024-12-23 19:31:05 +03:30

2629 lines
50 KiB
Plaintext

///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Class Library
// --------------------------------------
// Name: XPOIDrawer
// Description: Provides Point of Interests
// Drawing Tools ...
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
//
// Global Properties ...
#property library
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://www.saherelm.ir"
#property version "1.00"
#property strict
//
// Imports ...
#include "../Classes/x-saherelm.base.class.mq5"
#include "../Classes/x-saherelm.x-cobject.class.mq5"
//
// Definitions ...
class XCPOIDrawer : public XCBase
{
//
public:
//
//
// Constructor ...
void XCPOIDrawer()
{
//
Default();
}
//
// Deconstructor ...
void ~XCPOIDrawer()
{
}
//
// Setter Getter (s) ...
/**
* Get Prefix ...
*
* @return ( string )
*/
string Prefix()
{
return mPrefix;
}
/**
* Set Prifx ...
*
* @param value: String ...
*/
void Prefix(string value)
{
mPrefix = value;
}
/**
* Get Chart ID ...
*
* @return ( long )
*/
long ChartIdentification()
{
return mChartIdentification;
}
/**
* Set Chart ID ...
*
* @param value: Long ...
*/
void ChartIdentification(long value)
{
//
if (value < 0)
{
value = 0;
}
//
mChartIdentification = value;
}
/**
* Get SubWindow Id ...
*
* @return ( int )
*/
int SubWindowIdentification()
{
return mSubWindowIdentification;
}
/**
* Set SubWindow Id ...
*
* @param value: Integer ...
*/
void SubWindowIdentification(int value)
{
//
if (value < 0)
{
value = 0;
}
//
mSubWindowIdentification = value;
}
//
// Swing Low ...
/**
* Get Swing Low Width ...
*
* @return ( int )
*/
int SwingLowWidth()
{
return mSwingLowWidth;
}
/**
* Set Swing Low Width ...
*
* @param value: Integer ...
*/
void SwingLowWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mSwingLowWidth = value;
}
/**
* Get Swing Low Arrow Code ...
*
* @return ( int )
*/
int SwingLowArrow()
{
return mSwingLowArrow;
}
/**
* Set Swing Low Arrow Code ...
*
* @param value: Integer ...
*/
void SwingLowArrow(int value)
{
//
mSwingLowArrow = value;
}
/**
* Get Swing Low Color ...
*
* @return ( color )
*/
color SwingLowColor()
{
return mSwingLowColor;
}
/**
* Set Swing Low Color ...
*
* @param value: Color ...
*/
void SwingLowColor(color value)
{
mSwingLowColor = value;
}
//
// Swing High ...
/**
* Get Swing High Width ...
*
* @return ( int )
*/
int SwingHighWidth()
{
return mSwingHighWidth;
}
/**
* Set Swing High Width ...
*
* @param value: Integer ...
*/
void SwingHighWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mSwingHighWidth = value;
}
/**
* Get Swing High Arrow Code ...
*
* @return ( int )
*/
int SwingHighArrow()
{
return mSwingHighArrow;
}
/**
* Set Swing High Arrow Code ...
*
* @param value: Integer ...
*/
void SwingHighArrow(int value)
{
//
mSwingHighArrow = value;
}
/**
* Get Swing High Color ...
*
* @return ( color )
*/
color SwingHighColor()
{
return mSwingHighColor;
}
/**
* Set Swing High Color ...
*
* @param value: Color ...
*/
void SwingHighColor(color value)
{
mSwingHighColor = value;
}
//
// Bullish Momentum Bar ...
/**
* Get Bullish Momentum Bar Width ...
*
* @return ( int )
*/
int BullishMomentumBarWidth()
{
return mBullishMomentumBarWidth;
}
/**
* Set Bullish Momentum Bar Width ...
*
* @param value: Integer ...
*/
void BullishMomentumBarWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBullishMomentumBarWidth = value;
}
/**
* Get Bullish Momentum Bar Arrow Code ...
*
* @return ( int )
*/
int BullishMomentumBarArrow()
{
return mBullishMomentumBarArrow;
}
/**
* Set Bullish Momentum Bar Arrow Code ...
*
* @param value: Integer ...
*/
void BullishMomentumBarArrow(int value)
{
//
mBullishMomentumBarArrow = value;
}
/**
* Get Bullish Momentum Bar Color ...
*
* @return ( color )
*/
color BullishMomentumBarColor()
{
return mBullishMomentumBarColor;
}
/**
* Set Bullish Momentum Bar Color ...
*
* @param value: Color ...
*/
void BullishMomentumBarColor(color value)
{
mBullishMomentumBarColor = value;
}
//
// Bearish Momentum Bar ...
/**
* Get Bearish Momentum Bar Width ...
*
* @return ( int )
*/
int BearishMomentumBarWidth()
{
return mBearishMomentumBarWidth;
}
/**
* Set Bearish Momentum Bar Width ...
*
* @param value: Integer ...
*/
void BearishMomentumBarWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBearishMomentumBarWidth = value;
}
/**
* Get Bearish Momentum Bar Arrow Code ...
*
* @return ( int )
*/
int BearishMomentumBarArrow()
{
return mBearishMomentumBarArrow;
}
/**
* Set Bearish Momentum Bar Arrow Code ...
*
* @param value: Integer ...
*/
void BearishMomentumBarArrow(int value)
{
//
mBearishMomentumBarArrow = value;
}
/**
* Get Bearish Momentum Bar Color ...
*
* @return ( color )
*/
color BearishMomentumBarColor()
{
return mBearishMomentumBarColor;
}
/**
* Set Bearish Momentum Bar Color ...
*
* @param value: Color ...
*/
void BearishMomentumBarColor(color value)
{
mBearishMomentumBarColor = value;
}
//
// Bullish Rejection Bar ...
/**
* Get Bullish Rejection Bar Width ...
*
* @return ( int )
*/
int BullishRejectionBarWidth()
{
return mBullishRejectionBarWidth;
}
/**
* Set Bullish Rejection Bar Width ...
*
* @param value: Integer ...
*/
void BullishRejectionBarWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBullishRejectionBarWidth = value;
}
/**
* Get Bullish Rejection Bar Arrow Code ...
*
* @return ( int )
*/
int BullishRejectionBarArrow()
{
return mBullishRejectionBarArrow;
}
/**
* Set Bullish Rejection Bar Arrow Code ...
*
* @param value: Integer ...
*/
void BullishRejectionBarArrow(int value)
{
//
mBullishRejectionBarArrow = value;
}
/**
* Get Bullish Rejection Bar Color ...
*
* @return ( color )
*/
color BullishRejectionBarColor()
{
return mBullishRejectionBarColor;
}
/**
* Set Bullish Rejection Bar Color ...
*
* @param value: Color ...
*/
void BullishRejectionBarColor(color value)
{
mBullishRejectionBarColor = value;
}
//
// Bearish Rejection Bar ...
/**
* Get Bearish Rejection Bar Width ...
*
* @return ( int )
*/
int BearishRejectionBarWidth()
{
return mBearishRejectionBarWidth;
}
/**
* Set Bearish Rejection Bar Width ...
*
* @param value: Integer ...
*/
void BearishRejectionBarWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBearishRejectionBarWidth = value;
}
/**
* Get Bearish Rejection Bar Arrow Code ...
*
* @return ( int )
*/
int BearishRejectionBarArrow()
{
return mBearishRejectionBarArrow;
}
/**
* Set Bearish Rejection Bar Arrow Code ...
*
* @param value: Integer ...
*/
void BearishRejectionBarArrow(int value)
{
//
mBearishRejectionBarArrow = value;
}
/**
* Get Bearish Rejection Bar Color ...
*
* @return ( color )
*/
color BearishRejectionBarColor()
{
return mBearishRejectionBarColor;
}
/**
* Set Bearish Rejection Bar Color ...
*
* @param value: Color ...
*/
void BearishRejectionBarColor(color value)
{
mBearishRejectionBarColor = value;
}
//
// Supply Zone ...
/**
* Get Fill Supply Zone ...
*
* @return ( bool )
*/
bool SupplyZoneFill()
{
return mSupplyZoneFill;
}
/**
* Set Fill Supply Zone ...
*
* @param value: Boolean ...
*/
void SupplyZoneFill(bool value)
{
mSupplyZoneFill = value;
}
/**
* Get Supply Zone Width ...
*
* @return ( int )
*/
int SupplyZoneWidth()
{
return mSupplyZoneWidth;
}
/**
* Set Supply Zone Width ...
*
* @param value: Integer ...
*/
void SupplyZoneWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mSupplyZoneWidth = value;
}
/**
* Get Supply Zone Color ...
*
* @return ( color )
*/
color SupplyZoneColor()
{
return mSupplyZoneColor;
}
/**
* Set Supply Zone Color ...
*
* @param value: Color ...
*/
void SupplyZoneColor(color value)
{
mSupplyZoneColor = value;
}
/**
* Get Supply Zone Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE SupplyZoneStyle()
{
return mSupplyZoneStyle;
}
/**
* Set Supply Zone Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void SupplyZoneStyle(ENUM_LINE_STYLE value)
{
mSupplyZoneStyle = value;
}
//
// Demand Zone ...
/**
* Get Fill Demand Zone ...
*
* @return ( bool )
*/
bool DemandZoneFill()
{
return mDemandZoneFill;
}
/**
* Set Fill Demand Zone ...
*
* @param value: Boolean ...
*/
void DemandZoneFill(bool value)
{
mDemandZoneFill = value;
}
/**
* Get Demand Zone Width ...
*
* @return ( int )
*/
int DemandZoneWidth()
{
return mDemandZoneWidth;
}
/**
* Set Demand Zone Width ...
*
* @param value: Integer ...
*/
void DemandZoneWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mDemandZoneWidth = value;
}
/**
* Get Demand Zone Color ...
*
* @return ( color )
*/
color DemandZoneColor()
{
return mDemandZoneColor;
}
/**
* Set Demand Zone Color ...
*
* @param value: Color ...
*/
void DemandZoneColor(color value)
{
mDemandZoneColor = value;
}
/**
* Get Demand Zone Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE DemandZoneStyle()
{
return mDemandZoneStyle;
}
/**
* Set Demand Zone Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void DemandZoneStyle(ENUM_LINE_STYLE value)
{
mDemandZoneStyle = value;
}
//
// Resistance Zone ...
/**
* Get Fill Resistance Zone ...
*
* @return ( bool )
*/
bool ResistanceZoneFill()
{
return mResistanceZoneFill;
}
/**
* Set Fill Resistance Zone ...
*
* @param value: Boolean ...
*/
void ResistanceZoneFill(bool value)
{
mResistanceZoneFill = value;
}
/**
* Get Resistance Zone Width ...
*
* @return ( int )
*/
int ResistanceZoneWidth()
{
return mResistanceZoneWidth;
}
/**
* Set Resistance Zone Width ...
*
* @param value: Integer ...
*/
void ResistanceZoneWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mResistanceZoneWidth = value;
}
/**
* Get Resistance Zone Color ...
*
* @return ( color )
*/
color ResistanceZoneColor()
{
return mResistanceZoneColor;
}
/**
* Set Resistance Zone Color ...
*
* @param value: Color ...
*/
void ResistanceZoneColor(color value)
{
mResistanceZoneColor = value;
}
/**
* Get Resistance Zone Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE ResistanceZoneStyle()
{
return mResistanceZoneStyle;
}
/**
* Set Resistance Zone Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void ResistanceZoneStyle(ENUM_LINE_STYLE value)
{
mResistanceZoneStyle = value;
}
//
// Support Zone ...
/**
* Get Fill Support Zone ...
*
* @return ( bool )
*/
bool SupportZoneFill()
{
return mSupportZoneFill;
}
/**
* Set Fill Support Zone ...
*
* @param value: Boolean ...
*/
void SupportZoneFill(bool value)
{
mSupportZoneFill = value;
}
/**
* Get Support Zone Width ...
*
* @return ( int )
*/
int SupportZoneWidth()
{
return mSupportZoneWidth;
}
/**
* Set Support Zone Width ...
*
* @param value: Integer ...
*/
void SupportZoneWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mSupportZoneWidth = value;
}
/**
* Get Support Zone Color ...
*
* @return ( color )
*/
color SupportZoneColor()
{
return mSupportZoneColor;
}
/**
* Set Support Zone Color ...
*
* @param value: Color ...
*/
void SupportZoneColor(color value)
{
mSupportZoneColor = value;
}
/**
* Get Support Zone Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE SupportZoneStyle()
{
return mSupportZoneStyle;
}
/**
* Set Support Zone Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void SupportZoneStyle(ENUM_LINE_STYLE value)
{
mSupportZoneStyle = value;
}
//
// Bullish Order Block ...
/**
* Get Fill Bullish Order Block ...
*
* @return ( bool )
*/
bool BullishOrderBlockFill()
{
return mBullishOrderBlockFill;
}
/**
* Set Fill Bullish Order Block ...
*
* @param value: Boolean ...
*/
void BullishOrderBlockFill(bool value)
{
mBullishOrderBlockFill = value;
}
/**
* Get Bullish Order Block Width ...
*
* @return ( int )
*/
int BullishOrderBlockWidth()
{
return mBullishOrderBlockWidth;
}
/**
* Set Bullish Order Block Width ...
*
* @param value: Integer ...
*/
void BullishOrderBlockWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBullishOrderBlockWidth = value;
}
/**
* Get Bullish Order Block Color ...
*
* @return ( color )
*/
color BullishOrderBlockColor()
{
return mBullishOrderBlockColor;
}
/**
* Set Bullish Order Block Color ...
*
* @param value: Color ...
*/
void BullishOrderBlockColor(color value)
{
mBullishOrderBlockColor = value;
}
/**
* Get Bullish Order Block Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE BullishOrderBlockStyle()
{
return mBullishOrderBlockStyle;
}
/**
* Set Bullish Order Block Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void BullishOrderBlockStyle(ENUM_LINE_STYLE value)
{
mBullishOrderBlockStyle = value;
}
//
// Bearish Order Block ...
/**
* Get Fill Bearish Order Block ...
*
* @return ( bool )
*/
bool BearishOrderBlockFill()
{
return mBearishOrderBlockFill;
}
/**
* Set Fill Bearish Order Block ...
*
* @param value: Boolean ...
*/
void BearishOrderBlockFill(bool value)
{
mBearishOrderBlockFill = value;
}
/**
* Get Bearish Order Block Width ...
*
* @return ( int )
*/
int BearishOrderBlockWidth()
{
return mBearishOrderBlockWidth;
}
/**
* Set Bearish Order Block Width ...
*
* @param value: Integer ...
*/
void BearishOrderBlockWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBearishOrderBlockWidth = value;
}
/**
* Get Bearish Order Block Color ...
*
* @return ( color )
*/
color BearishOrderBlockColor()
{
return mBearishOrderBlockColor;
}
/**
* Set Bearish Order Block Color ...
*
* @param value: Color ...
*/
void BearishOrderBlockColor(color value)
{
mBearishOrderBlockColor = value;
}
/**
* Get Bearish Order Block Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE BearishOrderBlockStyle()
{
return mBearishOrderBlockStyle;
}
/**
* Set Bearish Order Block Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void BearishOrderBlockStyle(ENUM_LINE_STYLE value)
{
mBearishOrderBlockStyle = value;
}
//
// Bullish FVG ...
/**
* Get Fill Bullish FVG ...
*
* @return ( bool )
*/
bool BullishFVGFill()
{
return mBullishFVGFill;
}
/**
* Set Fill Bullish FVG ...
*
* @param value: Boolean ...
*/
void BullishFVGFill(bool value)
{
mBullishFVGFill = value;
}
/**
* Get Bullish FVG Width ...
*
* @return ( int )
*/
int BullishFVGWidth()
{
return mBullishFVGWidth;
}
/**
* Set Bullish FVG Width ...
*
* @param value: Integer ...
*/
void BullishFVGWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBullishFVGWidth = value;
}
/**
* Get Bullish FVG Color ...
*
* @return ( color )
*/
color BullishFVGColor()
{
return mBullishFVGColor;
}
/**
* Set Bullish FVG Color ...
*
* @param value: Color ...
*/
void BullishFVGColor(color value)
{
mBullishFVGColor = value;
}
/**
* Get Bullish FVG Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE BullishFVGStyle()
{
return mBullishFVGStyle;
}
/**
* Set Bullish FVG Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void BullishFVGStyle(ENUM_LINE_STYLE value)
{
mBullishFVGStyle = value;
}
//
// Bearish FVG ...
/**
* Get Fill Bearish FVG ...
*
* @return ( bool )
*/
bool BearishFVGFill()
{
return mBearishFVGFill;
}
/**
* Set Fill Bearish FVG ...
*
* @param value: Boolean ...
*/
void BearishFVGFill(bool value)
{
mBearishFVGFill = value;
}
/**
* Get Bearish FVG Width ...
*
* @return ( int )
*/
int BearishFVGWidth()
{
return mBearishFVGWidth;
}
/**
* Set Bearish FVG Width ...
*
* @param value: Integer ...
*/
void BearishFVGWidth(int value)
{
//
if (value < 1)
{
value = 1;
}
//
mBearishFVGWidth = value;
}
/**
* Get Bearish FVG Color ...
*
* @return ( color )
*/
color BearishFVGColor()
{
return mBearishFVGColor;
}
/**
* Set Bearish FVG Color ...
*
* @param value: Color ...
*/
void BearishFVGColor(color value)
{
mBearishFVGColor = value;
}
/**
* Get Bearish FVG Style ...
*
* @return ( ENUM_LINE_STYLE )
*/
ENUM_LINE_STYLE BearishFVGStyle()
{
return mBearishFVGStyle;
}
/**
* Set Bearish FVG Style ...
*
* @param value: ENUM_LINE_STYLE member ...
*/
void BearishFVGStyle(ENUM_LINE_STYLE value)
{
mBearishFVGStyle = value;
}
//
// Virtuals ...
/**
* Apply Default Configurations ...
*/
virtual void Default()
{
//
// Apply Default Props ...
//
Prefix(NULL);
ChartIdentification(0);
SubWindowIdentification(0);
//
int arrowWidth = 1;
//
SwingLowArrow(108);
SwingLowColor(clrAqua);
SwingLowWidth(arrowWidth);
//
SwingHighArrow(108);
SwingHighWidth(arrowWidth);
SwingHighColor(clrMagenta);
//
arrowWidth++;
//
BullishMomentumBarArrow(225);
BullishMomentumBarWidth(arrowWidth);
BullishMomentumBarColor(clrAqua);
//
BearishMomentumBarArrow(226);
BearishMomentumBarWidth(arrowWidth);
BearishMomentumBarColor(clrMagenta);
//
arrowWidth++;
//
BullishRejectionBarArrow(217);
BullishRejectionBarWidth(arrowWidth);
BullishRejectionBarColor(clrAqua);
//
BearishRejectionBarArrow(218);
BearishRejectionBarWidth(arrowWidth);
BearishRejectionBarColor(clrMagenta);
//
SupportZoneFill(false);
SupportZoneWidth(1);
SupportZoneStyle(STYLE_DOT);
SupportZoneColor(clrLime);
//
ResistanceZoneFill(false);
ResistanceZoneWidth(1);
ResistanceZoneStyle(STYLE_DOT);
ResistanceZoneColor(clrRed);
//
SupplyZoneFill(false);
SupplyZoneWidth(1);
SupplyZoneStyle(STYLE_DOT);
SupplyZoneColor(clrRed);
//
DemandZoneFill(false);
DemandZoneWidth(1);
DemandZoneStyle(STYLE_DOT);
DemandZoneColor(clrGreen);
//
BullishOrderBlockFill(false);
BullishOrderBlockWidth(1);
BullishOrderBlockStyle(STYLE_DASHDOT);
BullishOrderBlockColor(clrLime);
//
BearishOrderBlockFill(false);
BearishOrderBlockWidth(1);
BearishOrderBlockStyle(STYLE_DASHDOT);
BearishOrderBlockColor(clrRed);
//
BullishFVGFill(false);
BullishFVGWidth(1);
BullishFVGStyle(STYLE_DOT);
BullishFVGColor(clrLime);
//
BearishFVGFill(false);
BearishFVGWidth(1);
BearishFVGStyle(STYLE_DOT);
BearishFVGColor(clrRed);
//
// Add Default TickZone Specs ...
bool isSpecsInited = false;
bool fillTickZone = false;
XTickZoneLevelSpecs specs10;
isSpecsInited = specs10.Init(
10,
clrWhite,
clrWhite,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs10);
}
//
XTickZoneLevelSpecs specs20;
isSpecsInited = specs20.Init(
20,
clrOrange,
clrOrange,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs20);
}
//
XTickZoneLevelSpecs specs30;
isSpecsInited = specs30.Init(
30,
clrOrange,
clrOrange,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs30);
}
//
XTickZoneLevelSpecs specs40;
isSpecsInited = specs40.Init(
40,
clrOrange,
clrOrange,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs40);
}
//
XTickZoneLevelSpecs specs50;
isSpecsInited = specs50.Init(
50,
clrYellow,
clrYellow,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs50);
}
//
XTickZoneLevelSpecs specs60;
isSpecsInited = specs60.Init(
60,
clrYellow,
clrYellow,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs60);
}
//
XTickZoneLevelSpecs specs70;
isSpecsInited = specs70.Init(
70,
clrYellow,
clrYellow,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs70);
}
//
XTickZoneLevelSpecs specs80;
isSpecsInited = specs80.Init(
80,
clrRed,
clrRed,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs80);
}
//
XTickZoneLevelSpecs specs90;
isSpecsInited = specs90.Init(
90,
clrRed,
clrRed,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs90);
}
//
XTickZoneLevelSpecs specs100;
isSpecsInited = specs100.Init(
100,
clrRed,
clrRed,
fillTickZone //
);
if (isSpecsInited)
{
AddTickZoneLevelSpecs(specs100);
}
//
}
//
// Object Creators ...
//
// Swings ...
/**
* Create Swing High Object ...
*
* @param swing: XCSwing instance ...
* @param object: XCSwingHighObject pointer ...
*
* @return ( bool )
*/
bool CreateSwingHigh(
XCSwing &swing,
XCSwingHighObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
swing.IsValid() &&
swing.IsSwingHigh();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
int arrow = SwingHighArrow();
int width = SwingHighWidth();
color crl = SwingHighColor();
//
object = new XCSwingHighObject();
result = object.Create(
chartID,
window,
arrow,
swing,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ArrowColor(crl);
object.ArrowWidth(width);
object.ArrowAnchor(ANCHOR_BOTTOM);
//
return result;
}
/**
* Create Swing Low Object ...
*
* @param swing: XCSwing instance ...
* @param object: XCSwingLowObject pointer ...
*
* @return ( bool )
*/
bool CreateSwingLow(
XCSwing &swing,
XCSwingLowObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
swing.IsValid() &&
swing.IsSwingLow();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
int arrow = SwingLowArrow();
int width = SwingLowWidth();
color crl = SwingLowColor();
//
object = new XCSwingLowObject();
result = object.Create(
chartID,
window,
arrow,
swing,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ArrowColor(crl);
object.ArrowWidth(width);
object.ArrowAnchor(ANCHOR_TOP);
//
return result;
}
//
// Momentum Bars ...
/**
* Create Bullish Momentum Bar Object ...
*
* @param momentumBar: XCMomentumBar instance ...
* @param object: XCBullishMomentumObject pointer ...
*
* @return ( bool )
*/
bool CreateBullishMomentumBar(
XCMomentumBar &momentumBar,
XCBullishMomentumBarObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
momentumBar.IsValid() &&
momentumBar.IsBullish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
int arrow = BullishMomentumBarArrow();
int width = BullishMomentumBarWidth();
color crl = BullishMomentumBarColor();
//
object = new XCBullishMomentumBarObject();
result = object.Create(
chartID,
window,
arrow,
momentumBar,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ArrowColor(crl);
object.ArrowWidth(width);
object.ArrowAnchor(ANCHOR_TOP);
//
return result;
}
/**
* Create Bearish Momentum Bar Object ...
*
* @param momentumBar: XCMomentumBar instance ...
* @param object: XCBearishMomentumObject pointer ...
*
* @return ( bool )
*/
bool CreateBearishMomentumBar(
XCMomentumBar &momentumBar,
XCBearishMomentumBarObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
momentumBar.IsValid() &&
momentumBar.IsBearish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
int arrow = BearishMomentumBarArrow();
int width = BearishMomentumBarWidth();
color crl = BearishMomentumBarColor();
//
object = new XCBearishMomentumBarObject();
result = object.Create(
chartID,
window,
arrow,
momentumBar,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ArrowColor(crl);
object.ArrowWidth(width);
object.ArrowAnchor(ANCHOR_BOTTOM);
//
return result;
}
//
// Rejection Bars ...
/**
* Create Bullish Rejection Bar Object ...
*
* @param momentumBar: XCRejectionBar instance ...
* @param object: XCBullishRejectionObject pointer ...
*
* @return ( bool )
*/
bool CreateBullishRejectionBar(
XCRejectionBar &rejectionBar,
XCBullishRejectionBarObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
rejectionBar.IsValid() &&
rejectionBar.IsBullish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
int arrow = BullishRejectionBarArrow();
int width = BullishRejectionBarWidth();
color crl = BullishRejectionBarColor();
//
object = new XCBullishRejectionBarObject();
result = object.Create(
chartID,
window,
arrow,
rejectionBar,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ArrowColor(crl);
object.ArrowWidth(width);
object.ArrowAnchor(ANCHOR_TOP);
//
return result;
}
/**
* Create Bearish Rejection Bar Object ...
*
* @param rejectionBar: XCRejectionBar instance ...
* @param object: XCBearishRejectionObject pointer ...
*
* @return ( bool )
*/
bool CreateBearishRejectionBar(
XCRejectionBar &rejectionBar,
XCBearishRejectionBarObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
rejectionBar.IsValid() &&
rejectionBar.IsBearish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
int arrow = BearishRejectionBarArrow();
int width = BearishRejectionBarWidth();
color crl = BearishRejectionBarColor();
//
object = new XCBearishRejectionBarObject();
result = object.Create(
chartID,
window,
arrow,
rejectionBar,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ArrowColor(crl);
object.ArrowWidth(width);
object.ArrowAnchor(ANCHOR_BOTTOM);
//
return result;
}
//
// Support and Resistance ...
/**
* Create Support Object ...
*
* @param zone: XCSupportZone instance ...
* @param object: XCSupportZoneObject pointer ...
*
* @return ( bool )
*/
bool CreateSupportZone(
XCSupportZone &zone,
XCSupportZoneObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
zone.IsValid();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = SupportZoneFill();
int width = SupportZoneWidth();
color crl = SupportZoneColor();
ENUM_LINE_STYLE style = SupportZoneStyle();
//
object = new XCSupportZoneObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
/**
* Create Resistance Object ...
*
* @param zone: XCResistanceZone instance ...
* @param object: XCResistanceZoneObject pointer ...
*
* @return ( bool )
*/
bool CreateResistanceZone(
XCResistanceZone &zone,
XCResistanceZoneObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
zone.IsValid();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = ResistanceZoneFill();
int width = ResistanceZoneWidth();
color crl = ResistanceZoneColor();
ENUM_LINE_STYLE style = ResistanceZoneStyle();
//
object = new XCResistanceZoneObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
//
// Supply and Demand Zones ...
/**
* Create Supply Object ...
*
* @param zone: XCSupplyZone instance ...
* @param object: XCSupplyZoneObject pointer ...
*
* @return ( bool )
*/
bool CreateSupplyZone(
XCSupplyZone &zone,
XCSupplyZoneObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
zone.IsValid();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = SupplyZoneFill();
int width = SupplyZoneWidth();
color crl = SupplyZoneColor();
ENUM_LINE_STYLE style = SupplyZoneStyle();
//
object = new XCSupplyZoneObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
/**
* Create Demand Object ...
*
* @param zone: XCDemandZone instance ...
* @param object: XCDemandZoneObject pointer ...
*
* @return ( bool )
*/
bool CreateDemandZone(
XCDemandZone &zone,
XCDemandZoneObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
zone.IsValid();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = DemandZoneFill();
int width = DemandZoneWidth();
color crl = DemandZoneColor();
ENUM_LINE_STYLE style = DemandZoneStyle();
//
object = new XCDemandZoneObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
//
// Order Blocks ...
/**
* Create Bullish Order Block Object ...
*
* @param zone: XCOrderBlock instance ...
* @param object: XCBullishOrderBlockObject pointer ...
*
* @return ( bool )
*/
bool CreateBullishOrderBlock(
XCOrderBlock &zone,
XCBullishOrderBlockObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
zone.IsValid() &&
zone.IsBullish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = BullishOrderBlockFill();
int width = BullishOrderBlockWidth();
color crl = BullishOrderBlockColor();
ENUM_LINE_STYLE style = BullishOrderBlockStyle();
//
object = new XCBullishOrderBlockObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
/**
* Create Bearish Order Block Object ...
*
* @param zone: XCOrderBlock instance ...
* @param object: XCBearishOrderBlockObject pointer ...
*
* @return ( bool )
*/
bool CreateBearishOrderBlock(
XCOrderBlock &zone,
XCBearishOrderBlockObject *&object //
)
{
//
bool result = false;
//
object = NULL;
//
result =
zone.IsValid() &&
zone.IsBearish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = BearishOrderBlockFill();
int width = BearishOrderBlockWidth();
color crl = BearishOrderBlockColor();
ENUM_LINE_STYLE style = BearishOrderBlockStyle();
//
object = new XCBearishOrderBlockObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
//
// Fair Value Gaps ...
/**
* Create Bullish Fair Value Gap Object ...
*
* @param zone: XCFVG instance ...
* @param object: XCBullishOrderBlockObject pointer ...
*
* @return ( bool )
*/
bool CreateBullishFairValueGap(
XCFVG &zone,
XCBullishFairValueGapObject *&object //
)
{
//
bool result = false;
//
result = zone.IsValid() &&
zone.IsBullish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = BullishFVGFill();
int width = BullishFVGWidth();
color crl = BullishFVGColor();
ENUM_LINE_STYLE style = BullishFVGStyle();
//
object = new XCBullishFairValueGapObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
/**
* Create Bearish Fair Value Gap Object ...
*
* @param zone: XCFVG instance ...
* @param object: XCBearishOrderBlockObject pointer ...
*
* @return ( bool )
*/
bool CreateBearishFairValueGap(
XCFVG &zone,
XCBearishFairValueGapObject *&object //
)
{
//
bool result = false;
//
result = zone.IsValid() &&
zone.IsBearish();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
bool fill = BearishFVGFill();
int width = BearishFVGWidth();
color crl = BearishFVGColor();
ENUM_LINE_STYLE style = BearishFVGStyle();
//
object = new XCBearishFairValueGapObject();
result = object.Create(
chartID,
window,
zone,
prefix //
);
//
if (!result)
{
return result;
}
//
object.ZoneFill(fill);
object.ZoneColor(crl);
object.ZoneWidth(width);
object.ZoneStyle(style);
//
return result;
}
//
// Ticks Zone ...
/**
* Add Tick Zone Draw Specifications ...
*
* @param specs: XTickZoneLevelSpecs instance ...
*/
void AddTickZoneLevelSpecs(
XTickZoneLevelSpecs &specs //
)
{
//
if (!specs.IsValid())
{
return;
}
//
bool isExists = false;
int count = ArraySize(mTicksZoneSpecs);
if (IsValidSize(count))
{
//
for (int i = 0; i < count; i++)
{
//
XTickZoneLevelSpecs iSpec = mTicksZoneSpecs[i];
//
isExists = specs.percent == iSpec.percent;
if (isExists)
{
break;
}
}
}
if (isExists)
{
return;
}
//
AddRef(
specs,
mTicksZoneSpecs //
);
}
/**
* Draw Specified Ticker Zone ...
*
* @param zone: XCTicksZone instance Specified Ticker Zone ...
* @param object: XCTicksZoneObject pointer ...
*
* @return ( bool )
*/
bool CreateTicksZone(
XCTicksZone &zone,
XCTicksZoneObject *&object //
)
{
//
bool result = false;
//
result = zone.IsValid();
if (!result)
{
return result;
}
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
// bool fill = BearishFVGFill();
// int width = BearishFVGWidth();
// color crl = BearishFVGColor();
// ENUM_LINE_STYLE style = BearishFVGStyle();
//
object = new XCTicksZoneObject();
result = object.Create(
chartID,
window,
zone,
mTicksZoneSpecs,
prefix //
);
//
if (!result)
{
return result;
}
//
return result;
}
//
protected:
//
//
private:
//
//
// Props ...
//
string mPrefix; // Prefix of Created Objects ...
long mChartIdentification; // Chart Id ...
int mSubWindowIdentification; // Sub Window ...
//
// Swing Low ...
int mSwingLowWidth; // Swing Low Width ...
int mSwingLowArrow; // Swing Low Arrow Code ...
color mSwingLowColor; // Swing Low Color ...
//
// Swing High ...
int mSwingHighWidth; // Swing High Width ...
int mSwingHighArrow; // Swing High Arrow Code ...
color mSwingHighColor; // Swing High Color ...
//
// Bullish Momentum Bar ...
int mBullishMomentumBarWidth; // Bullish Momentum Bar Width ...
int mBullishMomentumBarArrow; // Bullish Momentum Bar Arrow Code ...
color mBullishMomentumBarColor; // Bullish Momentum Bar Color ...
//
// Bearish Momentum Bar ...
int mBearishMomentumBarWidth; // Bearish Momentum Bar Width ...
int mBearishMomentumBarArrow; // Bearish Momentum Bar Arrow Code ...
color mBearishMomentumBarColor; // Bearish Momentum Bar Color ...
//
// Bullish Rejection Bar ...
int mBullishRejectionBarWidth; // Bullish Rejection Bar High Width ...
int mBullishRejectionBarArrow; // Bullish Rejection Bar High Arrow Code ...
color mBullishRejectionBarColor; // Bullish Rejection Bar High Color ...
//
// Bearish Rejection Bar ...
int mBearishRejectionBarWidth; // Bearish Rejection Bar Width ...
int mBearishRejectionBarArrow; // Bearish Rejection Bar Arrow Code ...
color mBearishRejectionBarColor; // Bearish Rejection Bar Color ...
//
// Supply Zone ...
bool mSupplyZoneFill; // Fill Supply Zone ...
int mSupplyZoneWidth; // Supply Zone Width ...
color mSupplyZoneColor; // Supply Zone Color ...
ENUM_LINE_STYLE mSupplyZoneStyle; // Supply Zone Style ...
//
// Demand Zone ...
bool mDemandZoneFill; // Fill Demand Zone ...
int mDemandZoneWidth; // Demand Zone Width ...
color mDemandZoneColor; // Demand Zone Color ...
ENUM_LINE_STYLE mDemandZoneStyle; // Demand Zone Style ...
//
// Resistance Zone ...
bool mResistanceZoneFill; // Fill Resistance Zone ...
int mResistanceZoneWidth; // Resistance Zone Width ...
color mResistanceZoneColor; // Resistance Zone Color ...
ENUM_LINE_STYLE mResistanceZoneStyle; // Resistance Zone Style ...
//
// Support Zone ...
bool mSupportZoneFill; // Fill Support Zone ...
int mSupportZoneWidth; // Support Zone Width ...
color mSupportZoneColor; // Support Zone Color ...
ENUM_LINE_STYLE mSupportZoneStyle; // Support Zone Style ...
//
// Bullish Order Block ...
bool mBullishOrderBlockFill; // Fill Bullish Order Block ...
int mBullishOrderBlockWidth; // Bullish Order Block Width ...
color mBullishOrderBlockColor; // Bullish Order Block Color ...
ENUM_LINE_STYLE mBullishOrderBlockStyle; // Bullish Order Block Style ...
//
// Bearish Order Block ...
bool mBearishOrderBlockFill; // Fill Bearish Order Block ...
int mBearishOrderBlockWidth; // Bearish Order Block Width ...
color mBearishOrderBlockColor; // Bearish Order Block Color ...
ENUM_LINE_STYLE mBearishOrderBlockStyle; // Bearish Order Block Style ...
//
// Bullish FVG ...
bool mBullishFVGFill; // Fill Bullish FVG ...
int mBullishFVGWidth; // Bullish FVG Width ...
color mBullishFVGColor; // Bullish FVG Color ...
ENUM_LINE_STYLE mBullishFVGStyle; // Bullish FVG Style ...
//
// Bearish FVG ...
bool mBearishFVGFill; // Fill Bearish FVG ...
int mBearishFVGWidth; // Bearish FVG Width ...
color mBearishFVGColor; // Bearish FVG Color ...
ENUM_LINE_STYLE mBearishFVGStyle; // Bearish FVG Style ...
//
// Ticks Zone ...
XTickZoneLevelSpecs mTicksZoneSpecs[]; // Zone Draw Specifications ...
//
};