/////////////////////////////////////////////////////// // // 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-chart-objects.class.mq5" // // Definitions ... class XCPOIDrawer : public XSCBase { // 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) { mBearishFVGFill = 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; } // // Object Creators ... // // Swings ... /** * Create Swing High Object ... * * @param swing: XOHCL instance ... * * @return ( bool ) */ bool CreateSwingHigh( XOHCL &swing, XCSwingHighObject *&object // ) { // bool result = false; // object = NULL; // result = swing.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = swing.GetTag(ToString(X_POI_SWING_HIGH)); // int arrow = SwingHighArrow(); int width = SwingHighWidth(); color crl = SwingHighColor(); // object = new XCSwingHighObject(); result = object.CreateBySwing( chartID, name, window, swing, (char)arrow // ); // if (!result) { return result; } // object.ArrowColor(crl); object.ArrowWidth(width); object.ArrowAnchor(ANCHOR_BOTTOM); // return result; } /** * Create Swing Low Object ... * * @param swing: XOHCL instance ... * * @return ( bool ) */ bool CreateSwingLow( XOHCL &swing, XCSwingLowObject *&object // ) { // bool result = false; // object = NULL; // result = swing.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = swing.GetTag(ToString(X_POI_SWING_LOW)); // int arrow = SwingLowArrow(); int width = SwingLowWidth(); color crl = SwingLowColor(); // object = new XCSwingLowObject(); result = object.CreateBySwing( chartID, name, window, swing, (char)arrow // ); // if (!result) { return result; } // object.ArrowColor(crl); object.ArrowWidth(width); object.ArrowAnchor(ANCHOR_TOP); // return result; } // // Momentum Bars ... /** * Create Bullish Momentum Bar Object ... * * @param bar: XOHCL instance ... * * @return ( bool ) */ bool CreateBullishMomentumBar( XOHCL &bar, XCBullishMomentumBarObject *&object // ) { // bool result = false; // object = NULL; // result = bar.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = bar.GetTag(ToString(X_POI_MOMENTUM_BAR)); // int arrow = BullishMomentumBarArrow(); int width = BullishMomentumBarWidth(); color crl = BullishMomentumBarColor(); // object = new XCBullishMomentumBarObject(); result = object.CreateByBar( chartID, name, window, bar, (char)arrow // ); // if (!result) { return result; } // object.ArrowColor(crl); object.ArrowWidth(width); object.ArrowAnchor(ANCHOR_TOP); // return result; } /** * Create Bearish Momentum Bar Object ... * * @param bar: XOHCL instance ... * * @return ( bool ) */ bool CreateBearishMomentumBar( XOHCL &bar, XCBearishMomentumBarObject *&object // ) { // bool result = false; // object = NULL; // result = bar.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = bar.GetTag(ToString(X_POI_MOMENTUM_BAR)); // int arrow = BearishMomentumBarArrow(); int width = BearishMomentumBarWidth(); color crl = BearishMomentumBarColor(); // object = new XCBearishMomentumBarObject(); result = object.CreateByBar( chartID, name, window, bar, (char)arrow // ); // if (!result) { return result; } // object.ArrowColor(crl); object.ArrowWidth(width); object.ArrowAnchor(ANCHOR_TOP); // return result; } // // Rejection Bars ... /** * Create Bullish Rejection Bar Object ... * * @param bar: XOHCL instance ... * * @return ( bool ) */ bool CreateBullishRejectionBar( XOHCL &bar, XCBullishRejectionBarObject *&object // ) { // bool result = false; // object = NULL; // result = bar.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = bar.GetTag(ToString(X_POI_REJECTION_BAR)); // int arrow = BullishRejectionBarArrow(); int width = BullishRejectionBarWidth(); color crl = BullishRejectionBarColor(); // object = new XCBullishRejectionBarObject(); result = object.CreateByBar( chartID, name, window, bar, (char)arrow // ); // if (!result) { return result; } // object.ArrowColor(crl); object.ArrowWidth(width); object.ArrowAnchor(ANCHOR_TOP); // return result; } /** * Create Bearish Rejection Bar Object ... * * @param bar: XOHCL instance ... * * @return ( bool ) */ bool CreateBearishRejectionBar( XOHCL &bar, XCBearishRejectionBarObject *&object // ) { // bool result = false; // object = NULL; // result = bar.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = bar.GetTag(ToString(X_POI_REJECTION_BAR)); // int arrow = BearishRejectionBarArrow(); int width = BearishRejectionBarWidth(); color crl = BearishRejectionBarColor(); // object = new XCBearishRejectionBarObject(); result = object.CreateByBar( chartID, name, window, bar, (char)arrow // ); // if (!result) { return result; } // object.ArrowColor(crl); object.ArrowWidth(width); object.ArrowAnchor(ANCHOR_TOP); // return result; } // // Support and Resistance Zones ... /** * Create Support Zone Object ... * * @param bar: XOHCL instance ... * @param destTime: DateTime ... * * @return ( bool ) */ bool CreateSupportZone( XOHCL &bar, XCSupportZoneObject *&object, datetime destTime = NULL // ) { // bool result = false; // object = NULL; // result = bar.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = bar.GetTag(ToString(X_POI_SUPPORT_ZONE)); // datetime time2 = IsValid(destTime) ? destTime : (datetime)((int)bar.time + (PeriodSeconds(bar.period) * 5)); // bool fill = SupportZoneFill(); int width = SupportZoneWidth(); color crl = SupportZoneColor(); ENUM_LINE_STYLE style = SupportZoneStyle(); // object = new XCSupportZoneObject(); result = object.CreateBySupport( chartID, name, window, bar, time2, true // ); // if (!result) { return result; } // object.ZoneFill(fill); object.ZoneColor(crl); object.ZoneWidth(width); object.ZoneStyle(style); // return result; } /** * Create Resistance Zone Object ... * * @param bar: XOHCL instance ... * * @return ( bool ) */ bool CreateResistanceZone( XOHCL &bar, XCResistanceZoneObject *&object // ) { // bool result = false; // object = NULL; // result = bar.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = bar.GetTag(ToString(X_POI_RESISTANCE_ZONE)); // datetime time2 = (datetime)((int)bar.time + (PeriodSeconds(bar.period) * 5)); // bool fill = ResistanceZoneFill(); int width = ResistanceZoneWidth(); color crl = ResistanceZoneColor(); ENUM_LINE_STYLE style = ResistanceZoneStyle(); // object = new XCResistanceZoneObject(); result = object.CreateByResistance( chartID, name, window, bar, time2, true // ); // if (!result) { return result; } // object.ZoneFill(fill); object.ZoneColor(crl); object.ZoneWidth(width); object.ZoneStyle(style); // return result; } // // Supply and Demand Zones ... /** * Create Supply Zone Object ... * * @param zone: XZone instance ... * * @return ( bool ) */ bool CreateSupplyZone( XZone &zone, XCSupplyZoneObject *&object // ) { // bool result = false; // object = NULL; // result = zone.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = zone.GetTag(); result = Contains( ToString(X_POI_SUPPLY_ZONE), name // ); if (!result) { return result; } // bool fill = SupplyZoneFill(); int width = SupplyZoneWidth(); color crl = SupplyZoneColor(); ENUM_LINE_STYLE style = SupplyZoneStyle(); // object = new XCSupplyZoneObject(); result = object.CreateByZone( chartID, name, window, zone, NULL, true // ); // if (!result) { return result; } // object.ZoneFill(fill); object.ZoneColor(crl); object.ZoneWidth(width); object.ZoneStyle(style); // return result; } /** * Create Demand Zone Object ... * * @param zone: XZone instance ... * * @return ( bool ) */ bool CreateDemandZone( XZone &zone, XCDemandZoneObject *&object // ) { // bool result = false; // object = NULL; // result = zone.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = zone.GetTag(); result = Contains( ToString(X_POI_DEMAND_ZONE), name // ); if (!result) { return result; } // bool fill = DemandZoneFill(); int width = DemandZoneWidth(); color crl = DemandZoneColor(); ENUM_LINE_STYLE style = DemandZoneStyle(); // object = new XCDemandZoneObject(); result = object.CreateByZone( chartID, name, window, zone, NULL, true // ); // 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: XZone instance ... * * @return ( bool ) */ bool CreateBullishOrderBlock( XZone &zone, XCBullishOrderBlockObject *&object // ) { // bool result = false; // object = NULL; // result = zone.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = zone.GetTag(); result = Contains( ToString(X_POI_BULLISH_ORDERBLOCK), name // ); if (!result) { return result; } // bool fill = BullishOrderBlockFill(); int width = BullishOrderBlockWidth(); color crl = BullishOrderBlockColor(); ENUM_LINE_STYLE style = BullishOrderBlockStyle(); // object = new XCBullishOrderBlockObject(); result = object.CreateByZone( chartID, name, window, zone, NULL, true // ); // 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: XZone instance ... * * @return ( bool ) */ bool CreateBearishOrderBlock( XZone &zone, XCBearishOrderBlockObject *&object // ) { // bool result = false; // object = NULL; // result = zone.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = zone.GetTag(); result = Contains( ToString(X_POI_BEARISH_ORDERBLOCK), name // ); if (!result) { return result; } // bool fill = BearishOrderBlockFill(); int width = BearishOrderBlockWidth(); color crl = BearishOrderBlockColor(); ENUM_LINE_STYLE style = BearishOrderBlockStyle(); // object = new XCBearishOrderBlockObject(); result = object.CreateByZone( chartID, name, window, zone, NULL, true // ); // if (!result) { return result; } // object.ZoneFill(fill); object.ZoneColor(crl); object.ZoneWidth(width); object.ZoneStyle(style); // return result; } // // Order Blocks ... /** * Create Bullish FVG Object ... * * @param zone: XZone instance ... * * @return ( bool ) */ bool CreateBullishFVG( XZone &zone, XCBullishFVGObject *&object // ) { // bool result = false; // object = NULL; // result = zone.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = zone.GetTag(); result = Contains( ToString(X_POI_BULLISH_FVG), name // ); if (!result) { return result; } // bool fill = BullishFVGFill(); int width = BullishFVGWidth(); color crl = BullishFVGColor(); ENUM_LINE_STYLE style = BullishFVGStyle(); // object = new XCBullishFVGObject(); result = object.CreateByZone( chartID, name, window, zone, NULL, true // ); // if (!result) { return result; } // object.ZoneFill(fill); object.ZoneColor(crl); object.ZoneWidth(width); object.ZoneStyle(style); // return result; } /** * Create Bearish FVG Object ... * * @param zone: XZone instance ... * * @return ( bool ) */ bool CreateBearishFVG( XZone &zone, XCBearishFVGObject *&object // ) { // bool result = false; // object = NULL; // result = zone.IsValid(); if (!result) { return result; } // long chartID = ChartIdentification(); int window = SubWindowIdentification(); // string name = zone.GetTag(); result = Contains( ToString(X_POI_BEARISH_ORDERBLOCK), name // ); if (!result) { return result; } // bool fill = BearishFVGFill(); int width = BearishFVGWidth(); color crl = BearishFVGColor(); ENUM_LINE_STYLE style = BearishFVGStyle(); // object = new XCBearishFVGObject(); result = object.CreateByZone( chartID, name, window, zone, NULL, true // ); // if (!result) { return result; } // object.ZoneFill(fill); object.ZoneColor(crl); object.ZoneWidth(width); object.ZoneStyle(style); // return result; } // protected: // // void Default() { // // Apply Default Props ... // Prefix(NULL); ChartIdentification(0); SubWindowIdentification(0); // SwingLowWidth(1); SwingLowArrow(108); SwingLowColor(clrLime); // SwingHighWidth(1); SwingHighArrow(108); SwingHighColor(clrRed); // BullishMomentumBarWidth(1); BullishMomentumBarArrow(225); BullishMomentumBarColor(clrLime); // BearishMomentumBarWidth(1); BearishMomentumBarArrow(226); BearishMomentumBarColor(clrRed); // BullishRejectionBarWidth(1); BullishRejectionBarArrow(217); BullishRejectionBarColor(clrLime); // BearishRejectionBarWidth(1); BearishRejectionBarArrow(218); BearishRejectionBarColor(clrRed); // SupportZoneFill(true); SupportZoneWidth(1); SupportZoneStyle(STYLE_DOT); SupportZoneColor(clrLime); // ResistanceZoneFill(true); ResistanceZoneWidth(1); ResistanceZoneStyle(STYLE_DOT); ResistanceZoneColor(clrRed); // SupplyZoneFill(true); SupplyZoneWidth(1); SupplyZoneStyle(STYLE_DOT); SupplyZoneColor(clrMagenta); // DemandZoneFill(true); DemandZoneWidth(1); DemandZoneStyle(STYLE_DOT); DemandZoneColor(clrAqua); // BullishOrderBlockFill(true); BullishOrderBlockWidth(1); BullishOrderBlockStyle(STYLE_DOT); BullishOrderBlockColor(clrLime); // BearishOrderBlockFill(true); BearishOrderBlockWidth(1); BearishOrderBlockStyle(STYLE_DOT); BearishOrderBlockColor(clrRed); // BullishFVGFill(true); BullishFVGWidth(1); BullishFVGStyle(STYLE_DOT); BullishFVGColor(clrLime); // BearishFVGFill(true); BearishFVGWidth(1); BearishFVGStyle(STYLE_DOT); BearishFVGColor(clrRed); // } // 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 ... // };