/////////////////////////////////////////////////////// // // 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; } // // XOHCL ... /** * Get Bar Width ... * * @return ( int ) */ int BarWidth() { return mBarWidth; } /** * Set Bar Width ... * * @param value: Integer ... */ void BarWidth(int value) { // if (value < 0) { value = 0; } // mBarWidth = value; } /** * Get Bar Bullish Color ... * * @return ( color ) */ color BarBullishColor() { return mBarBullishColor; } /** * Set Bar Bullish Color ... * * @param value: Color ... */ void BarBullishColor(color value) { mBarBullishColor = value; } /** * Get Bar Bearish Color ... * * @return ( color ) */ color BarBearishColor() { return mBarBearishColor; } /** * Set Bar Bearish Color ... * * @param value: Color ... */ void BarBearishColor(color value) { mBarBearishColor = value; } /** * Get Fill Bar High Shadow State ... * * @return ( bool ) */ bool BarFillHighShadow() { return mBarFillHighShadow; } /** * Set Fill Bar High Shadow State ... * * @param value: Boolean ... */ void BarFillHighShadow(bool value) { mBarFillHighShadow = value; } /** * Get Bar High Shadow Style ... * * @return ( ENUM_LINE_STYLE ) */ ENUM_LINE_STYLE BarHighShadowStyle() { return mBarHighShadowStyle; } /** * Set Bar High Shadow Style ... * * @param value: ENUM_LINE_STYLE member ... */ void BarHighShadowStyle(ENUM_LINE_STYLE value) { mBarHighShadowStyle = value; } /** * Get Fill Bar Body State ... * * @return ( bool ) */ bool BarFillBody() { return mBarFillBody; } /** * Set Fill Bar Body State ... * * @param value: Boolean ... */ void BarFillBody(bool value) { mBarFillBody = value; } /** * Get Bar Body Style ... * * @return ( ENUM_LINE_STYLE ) */ ENUM_LINE_STYLE BarBodyStyle() { return mBarBodyStyle; } /** * Set Bar Body Style ... * * @param value: ENUM_LINE_STYLE member ... */ void BarBodyStyle(ENUM_LINE_STYLE value) { mBarBodyStyle = value; } /** * Get Fill Bar Low Show State ... * * @return ( bool ) */ bool BarFillLowShadow() { return mBarFillLowShadow; } /** * Set Fill Bar Low Show State ... * * @param value: Boolean ... */ void BarFillLowShadow(bool value) { mBarFillLowShadow = value; } /** * Get Bar Low Shadow Style ... * * @return ( ENUM_LINE_STYLE ) */ ENUM_LINE_STYLE BarLowShadowStyle() { return mBarLowShadowStyle; } /** * Set Bar Low Shadow Style ... * * @param value: ENUM_LINE_STYLE member ... */ void BarLowShadowStyle(ENUM_LINE_STYLE value) { mBarLowShadowStyle = 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); // BarWidth(1); BarBearishColor(clrRed); BarBullishColor(clrLime); BarFillBody(false); BarFillHighShadow(false); BarFillLowShadow(false); BarBodyStyle(STYLE_DOT); BarLowShadowStyle(STYLE_DOT); BarHighShadowStyle(STYLE_DOT); // 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(); // object = new XCTicksZoneObject(); result = object.Create( chartID, window, zone, mTicksZoneSpecs, prefix // ); // if (!result) { return result; } // return result; } /** * Create Consolidation Zone Object ... * * @param zone: XConsolidationZone instance Reference ... * * @return ( bool ) */ bool CreateConsolidationZone( XConsolidationZone &zone, XCConsolidationZoneObject *&object // ) { // bool result = false; // object = NULL; // result = zone.IsValid(); if (!result) { return result; } // string prefix = Prefix(); long chartID = ChartIdentification(); int window = SubWindowIdentification(); // object = new XCConsolidationZoneObject(); result = object.Create( chartID, window, zone, prefix // ); // return result; } /** * Create Bar Object ... * * @param bar: XOHCL instance Reference .. * @param object: XCOHCLObject pointer Reference .. * @param to: Datetime ... * * @return ( bool ) */ bool CreateBar( XOHCL &bar, XCOHCLObject *&object, datetime to = NULL // ) { // bool result = false; // object = NULL; // result = bar.IsValid(); if (!result) { return result; } // if (!IsValid(to)) { to = bar.time + PeriodSeconds(bar.period); } // string prefix = Prefix(); long chartID = ChartIdentification(); int window = SubWindowIdentification(); // int width = BarWidth(); // color bullishColor = BarBullishColor(); color bearishColor = BarBearishColor(); // bool fillBody = BarFillBody(); bool fillHighShadow = BarFillHighShadow(); bool fillLowShadow = BarFillLowShadow(); // ENUM_LINE_STYLE bodyStyle = BarBodyStyle(); ENUM_LINE_STYLE highShadowStyle = BarHighShadowStyle(); ENUM_LINE_STYLE lowShadowStyle = BarLowShadowStyle(); // object = new XCOHCLObject(); result = object.Create( chartID, window, bar, to, prefix // ); if (result) { // // Apply Styling ... // object.BodyWidth(width); object.LowShadowWidth(width); object.HighShadowWidth(width); // object.BodyStyle(bodyStyle); object.LowShadowStyle(lowShadowStyle); object.HighShadowStyle(highShadowStyle); // bool isBullish = bar.IsBullish(); if (isBullish) { // object.BodyColor(bullishColor); object.LowShadowColor(bullishColor); object.HighShadowColor(bullishColor); } else { // object.BodyColor(bearishColor); object.LowShadowColor(bearishColor); object.HighShadowColor(bearishColor); } // object.BodyFill(fillBody); object.HighShadowFill(fillHighShadow); object.LowShadowFill(fillLowShadow); } // return result; } /** * Create Specific Box on Chart ... * * @param upper: Double ... * @param lower: Double ... * @param from: Datetime ... * @param to: Datetime ... * @param clr: Color ... * @param width: Integer ... * @param fill: Boolean ... * @param style: ENUM_LINE_STYLE member ... * * @return ( bool ) */ bool CreateBox( XCBoxObject *&object, double upper, double lower, datetime from, datetime to, color clr = clrYellowGreen, int width = 1, bool fill = false, ENUM_LINE_STYLE style = STYLE_SOLID // ) { // bool result = false; // object = NULL; // to = NormalizeTime(to); // string dateStr = ToFormatString(from) + "|" + ToFormatString(to); string dateMD5 = ToMD5(dateStr); string name = "XBox_" + ToString(upper) + "_" + ToString(lower) + "_" + dateMD5; // result = upper > 0 && lower > 0 && to > from && IsValid(to) && IsValid(name) && IsValid(from) && upper > lower; if (!result) { return result; } // string prefix = Prefix(); long chartID = ChartIdentification(); int window = SubWindowIdentification(); // object = new XCBoxObject(); result = object.Create( chartID, window, name, upper, lower, from, to, prefix // ); // if (!result) { return result; } // object.BoxColor(clr); object.BoxFill(fill); object.BoxWidth(width); object.BoxStyle(style); // return result; } /** * Draw Specified Signal ... * * @param signal: XSignal instance ... */ bool DrawSignal( XSignal &signal, XCSignalObject *&object // ) { // bool result = false; // object = NULL; // result = signal.IsValid(); if (!result) { return result; } // string prefix = Prefix(); long chartID = ChartIdentification(); int window = SubWindowIdentification(); // object = new XCSignalObject(); result = object.Create( chartID, window, signal, prefix // ); if (!result) { return result; } // object.TPWidth(1); object.TPColor(clrGreen); object.TPWidth(STYLE_DOT); // object.SLWidth(1); object.SLColor(clrRed); object.SLWidth(STYLE_DOT); // object.TargetWidth(1); object.TargetColor(clrLightBlue); object.TargetWidth(STYLE_DOT); // object.EntryWidth(1); object.EntryColor(clrYellow); object.EntryWidth(STYLE_DOT); // return result; } /** * Draw Price Zone ... * * @param zone: XPriceZones instance Reference ... * @param forDir: ENUM_X_DIRECTION member ... * * @return ( int ) */ int DrawPriceZone( XPriceZones &zone, XCBaseObject *&drawnObjects[], ENUM_X_DIRECTION forDir = X_DIRECTION_NONE, bool onlyBoundary = false // ) { // int result = 0; // Clean(drawnObjects); // if (!zone.IsValid()) { return result; } // bool isBullish = IsBullish(forDir); bool isBearish = IsBearish(forDir); bool isAll = forDir == X_DIRECTION_ALL || forDir == X_DIRECTION_NONE; // if (isAll || isBullish) { // if (onlyBoundary) { // double upper = 0; double lower = 0; datetime to = NULL; datetime from = NULL; // bool isRetrieved = zone.GetBoxData( X_DIRECTION_NONE, upper, lower, from, to // ); if (isRetrieved) { // color clr = isBullish ? BarBullishColor() : isBearish ? BarBearishColor() : clrGray; XCBoxObject *iObj; result = CreateBox( iObj, upper, lower, from, to, clr, 1, false, STYLE_DOT // ); if (result) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } else { // // Support Zone ... if (zone.HasSupportZone()) { // XCSupportZoneObject *iObj; bool isCreated = CreateSupportZone( zone.supportZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // // Demand Zone ... if (zone.HasDemandZone()) { // XCDemandZoneObject *iObj; bool isCreated = CreateDemandZone( zone.demandZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // // OrderBlock ... if (zone.HasOrderBlock() && zone.orderBlock.IsBullish()) { // XCBullishOrderBlockObject *iObj; bool isCreated = CreateBullishOrderBlock( zone.orderBlock, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // // FairValueGap ... if (zone.HasFairValueGap() && zone.fairValueGap.IsBullish()) { // XCBullishFairValueGapObject *iObj; bool isCreated = CreateBullishFairValueGap( zone.fairValueGap, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // if (isAll || isBearish) { // if (onlyBoundary) { // double upper = 0; double lower = 0; datetime to = NULL; datetime from = NULL; // bool isRetrieved = zone.GetBoxData( X_DIRECTION_NONE, upper, lower, from, to // ); if (isRetrieved) { // color clr = isBullish ? BarBullishColor() : isBearish ? BarBearishColor() : clrGray; XCBoxObject *iObj; result = CreateBox( iObj, upper, lower, from, to, clr, 1, false, STYLE_DOT // ); if (result) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } else { // // Resistance Zone ... if (zone.HasResistanceZone()) { // XCResistanceZoneObject *iObj; bool isCreated = CreateResistanceZone( zone.resistanceZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // // Supply Zone ... if (zone.HasSupplyZone()) { // XCSupplyZoneObject *iObj; bool isCreated = CreateSupplyZone( zone.supplyZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // // OrderBlock ... if (zone.HasOrderBlock() && zone.orderBlock.IsBearish()) { // XCBearishOrderBlockObject *iObj; bool isCreated = CreateBearishOrderBlock( zone.orderBlock, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // // FairValueGap ... if (zone.HasFairValueGap() && zone.fairValueGap.IsBearish()) { // XCBearishFairValueGapObject *iObj; bool isCreated = CreateBearishFairValueGap( zone.fairValueGap, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // result = ArraySize(drawnObjects); // return result; } /** * Draw Specified State Zone ... * * @param source: XStateZones instance Reference ... * * @return ( int ) */ int DrawStateZones( XStateZones &source, XCBaseObject *&drawnObjects[] // ) { // int result = 0; // Clean(drawnObjects); // if (!source.IsValid()) { return result; } // // SupportZones ... int count = source.CountSupportZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCSupportZone *iZone = source.supportZones[i]; XCSupportZoneObject *iObj; // bool isCreated = CreateSupportZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // // ResistanceZones ... count = source.CountResistanceZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCResistanceZone *iZone = source.resistanceZones[i]; XCResistanceZoneObject *iObj; // bool isCreated = CreateResistanceZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // // SupplyZones ... count = source.CountSupplyZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCSupplyZone *iZone = source.supplyZones[i]; XCSupplyZoneObject *iObj; // bool isCreated = CreateSupplyZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // // DemandZones ... count = source.CountDemandZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCDemandZone *iZone = source.demandZones[i]; XCDemandZoneObject *iObj; // bool isCreated = CreateDemandZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // // BullishOrderBlocks ... count = source.CountBullishOrderBlocks(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCOrderBlock *iZone = source.bullishOrderBlocks[i]; XCBullishOrderBlockObject *iObj; // bool isCreated = CreateBullishOrderBlock( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // // BearishOrderBlocks ... count = source.CountBearishOrderBlocks(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCOrderBlock *iZone = source.bearishOrderBlocks[i]; XCBearishOrderBlockObject *iObj; // bool isCreated = CreateBearishOrderBlock( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // // BullishFairValueGaps ... count = source.CountBullishFairValueGaps(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCFVG *iZone = source.bullishFairValueGaps[i]; XCBullishFairValueGapObject *iObj; // bool isCreated = CreateBullishFairValueGap( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // // BearishFairValueGaps ... count = source.CountBearishFairValueGaps(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCFVG *iZone = source.bearishFairValueGaps[i]; XCBearishFairValueGapObject *iObj; // bool isCreated = CreateBearishFairValueGap( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } // result = ArraySize(drawnObjects); // return result; } /** * Draw Specified Market Structure ... * * @param model: XMarketStructure instance Reference ... * * @return ( int ) */ int DrawMarketStructure( XMarketStructure &model, XCBaseObject *&drawnObjects[] // ) { // int result = 0; // Clean(drawnObjects); // datetime cTime = TimeCurrent(); // bool isValid = model.IsValid(); if (!isValid) { return result; } // if (model.lowestValeBar.IsValid()) { // XCOHCLObject *iObj; bool isCreated = CreateBar( model.lowestValeBar, iObj, cTime // ); // if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // if (model.lowestValePeakBreakeUpBar.IsValid()) { // XCOHCLObject *iObj; bool isCreated = CreateBar( model.lowestValePeakBreakeUpBar, iObj, cTime // ); // if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // if (model.valeAboveLowestValePeakBar.IsValid()) { // XCOHCLObject *iObj; bool isCreated = CreateBar( model.valeAboveLowestValePeakBar, iObj, cTime // ); // if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // if (model.highestPeakBar.IsValid()) { // XCOHCLObject *iObj; bool isCreated = CreateBar( model.highestPeakBar, iObj, cTime // ); // if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // if (model.peakBelowHighestPeakValeBar.IsValid()) { // XCOHCLObject *iObj; bool isCreated = CreateBar( model.peakBelowHighestPeakValeBar, iObj, cTime // ); // if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // if (model.highestPeakValeBreakeDownBar.IsValid()) { // XCOHCLObject *iObj; bool isCreated = CreateBar( model.highestPeakValeBreakeDownBar, iObj, cTime // ); // if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } // if (HasChild(model.valePriceZones)) { // int count = ArraySize(model.valePriceZones); for (int i = 0; i < count; i++) { // XPriceZones ipZone = model.valePriceZones[i]; // XCBaseObject *ipObjects[]; int ipDrawnObjects = DrawPriceZone( ipZone, ipObjects, model.bias // ); if (IsValidSize(ipObjects)) { // Copy( ipObjects, drawnObjects, false // ); } } } // if (HasChild(model.peakPriceZones)) { // int count = ArraySize(model.peakPriceZones); for (int i = 0; i < count; i++) { // XPriceZones ipZone = model.peakPriceZones[i]; // XCBaseObject *ipObjects[]; int ipDrawnObjects = DrawPriceZone( ipZone, ipObjects, model.bias // ); if (IsValidSize(ipObjects)) { // Copy( ipObjects, drawnObjects, false // ); } } } // result = ArraySize(drawnObjects); // return result; } /** * Draw Specified POI State ... * * @param state: XPOIState instance Reference ... * @param drawnObjects: CArrayObj instance for Holding Drawn Objects ... * @param drawTicksZone: Boolean ... * @param ignoreSwingHighs: Boolean ... * @param ignoreSwingLows: Boolean ... * @param ignoreSupportZones: Boolean ... * @param ignoreResistanceZones: Boolean ... * @param ignoreSupplyZones: Boolean ... * @param ignoreDemandZones: Boolean ... * @param ignoreBullishOrderBlocks: Boolean ... * @param ignoreBearishOrderBlocks: Boolean ... * @param ignoreBullishFairValueGaps: Boolean ... * @param ignoreBearishFairValueGaps: Boolean ... * @param ignoreBullishRejectionBars: Boolean ... * @param ignoreBearishRejectionBars: Boolean ... * @param ignoreBullishMomentumBars: Boolean ... * @param ignoreBearishMomentumBars: Boolean ... */ int DrawState( XPOIState &state, XCBaseObject *&drawnObjects[], bool drawTicksZone = false, bool ignoreSwingHighs = false, bool ignoreSwingLows = false, bool ignoreSupportZones = false, bool ignoreResistanceZones = false, bool ignoreSupplyZones = false, bool ignoreDemandZones = false, bool ignoreBullishOrderBlocks = false, bool ignoreBearishOrderBlocks = false, bool ignoreBullishFairValueGaps = false, bool ignoreBearishFairValueGaps = false, bool ignoreBullishRejectionBars = false, bool ignoreBearishRejectionBars = false, bool ignoreBullishMomentumBars = false, bool ignoreBearishMomentumBars = false // ) { // int result = 0; // if (!state.IsValid() || !state.HasChild()) { return result; } // Clean(drawnObjects); // // SwingHighs ... if (!ignoreSwingHighs) { // int count = state.CountSwingHighs(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCSwing *iSwing = state.swingHighs[i]; XCSwingHighObject *iObj; // bool isCreated = CreateSwingHigh( iSwing, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // SwingLows ... if (!ignoreSwingLows) { // int count = state.CountSwingLows(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCSwing *iSwing = state.swingLows[i]; XCSwingLowObject *iObj; // bool isCreated = CreateSwingLow( iSwing, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // SupportZones ... if (!ignoreSupportZones) { // int count = state.CountSupportZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCSupportZone *iZone = state.supportZones[i]; XCSupportZoneObject *iObj; // bool isCreated = CreateSupportZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // ResistanceZones ... if (!ignoreResistanceZones) { // int count = state.CountResistanceZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCResistanceZone *iZone = state.resistanceZones[i]; XCResistanceZoneObject *iObj; // bool isCreated = CreateResistanceZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // SupplyZones ... if (!ignoreSupplyZones) { // int count = state.CountSupplyZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCSupplyZone *iZone = state.supplyZones[i]; XCSupplyZoneObject *iObj; // bool isCreated = CreateSupplyZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // DemandZones ... if (!ignoreDemandZones) { // int count = state.CountDemandZones(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCDemandZone *iZone = state.demandZones[i]; XCDemandZoneObject *iObj; // bool isCreated = CreateDemandZone( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BullishOrderBlocks ... if (!ignoreBullishOrderBlocks) { // int count = state.CountBullishOrderBlocks(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCOrderBlock *iZone = state.bullishOrderBlocks[i]; XCBullishOrderBlockObject *iObj; // bool isCreated = CreateBullishOrderBlock( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BearishOrderBlocks ... if (!ignoreBearishOrderBlocks) { // int count = state.CountBearishOrderBlocks(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCOrderBlock *iZone = state.bearishOrderBlocks[i]; XCBearishOrderBlockObject *iObj; // bool isCreated = CreateBearishOrderBlock( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BullishFairValueGaps ... if (!ignoreBullishFairValueGaps) { // int count = state.CountBullishFairValueGaps(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCFVG *iZone = state.bullishFairValueGaps[i]; XCBullishFairValueGapObject *iObj; // bool isCreated = CreateBullishFairValueGap( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BearishFairValueGaps ... if (!ignoreBearishFairValueGaps) { // int count = state.CountBearishFairValueGaps(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCFVG *iZone = state.bearishFairValueGaps[i]; XCBearishFairValueGapObject *iObj; // bool isCreated = CreateBearishFairValueGap( iZone, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BullishRejectionBars ... if (!ignoreBullishRejectionBars) { // int count = state.CountBullishRejectionBars(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCRejectionBar *iBar = state.bullishRejectionBars[i]; XCBullishRejectionBarObject *iObj; // bool isCreated = CreateBullishRejectionBar( iBar, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BearishRejectionBars ... if (!ignoreBearishRejectionBars) { // int count = state.CountBearishRejectionBars(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCRejectionBar *iBar = state.bearishRejectionBars[i]; XCBearishRejectionBarObject *iObj; // bool isCreated = CreateBearishRejectionBar( iBar, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BullishMomentumBars ... if (!ignoreBullishMomentumBars) { // int count = state.CountBullishMomentumBars(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCMomentumBar *iBar = state.bullishMomentumBars[i]; XCBullishMomentumBarObject *iObj; // bool isCreated = CreateBullishMomentumBar( iBar, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // // BearishMomentumBars ... if (!ignoreBearishMomentumBars) { // int count = state.CountBearishMomentumBars(); if (IsValidSize(count)) { // for (int i = 0; i < count; i++) { // XCMomentumBar *iBar = state.bearishMomentumBars[i]; XCBearishMomentumBarObject *iObj; // bool isCreated = CreateBearishMomentumBar( iBar, iObj // ); if (isCreated) { // Add( (XCBaseObject *)iObj, drawnObjects // ); } } } } // if (drawTicksZone && state.ticksZone != NULL) { // XCTicksZoneObject *iObj; bool isCreated = CreateTicksZone( state.ticksZone, iObj // ); if (isCreated) { Add( (XCBaseObject *)iObj, drawnObjects // ); } } // result = ArraySize(drawnObjects); // return result; } /** * Draw Specific Pivot ... * * @param pivot: XPVPivot instance Reference ... * @param drawState: Boolean ... * @param drawTicksZone: Boolean ... * @param ignoreSwingHighs: Boolean ... * @param ignoreSwingLows: Boolean ... * @param ignoreSupportZones: Boolean ... * @param ignoreResistanceZones: Boolean ... * @param ignoreSupplyZones: Boolean ... * @param ignoreDemandZones: Boolean ... * @param ignoreBullishOrderBlocks: Boolean ... * @param ignoreBearishOrderBlocks: Boolean ... * @param ignoreBullishFairValueGaps: Boolean ... * @param ignoreBearishFairValueGaps: Boolean ... * @param ignoreBullishRejectionBars: Boolean ... * @param ignoreBearishRejectionBars: Boolean ... * @param ignoreBullishMomentumBars: Boolean ... * @param ignoreBearishMomentumBars: Boolean ... */ int DrawPivot( XPVPivot &pivot, XCBaseObject *&drawnObjects[], bool drawState = false, bool drawTicksZone = false, bool ignoreSwingHighs = false, bool ignoreSwingLows = false, bool ignoreSupportZones = false, bool ignoreResistanceZones = false, bool ignoreSupplyZones = false, bool ignoreDemandZones = false, bool ignoreBullishOrderBlocks = false, bool ignoreBearishOrderBlocks = false, bool ignoreBullishFairValueGaps = false, bool ignoreBearishFairValueGaps = false, bool ignoreBullishRejectionBars = false, bool ignoreBearishRejectionBars = false, bool ignoreBullishMomentumBars = false, bool ignoreBearishMomentumBars = false // ) { // int result = 0; // Clean(drawnObjects); // if (!pivot.IsValid()) { return result; } // string prefix = Prefix(); long chartID = ChartIdentification(); int window = SubWindowIdentification(); // // Draw Pivot it self ... XCXPVPivotObject *iPivotObj; iPivotObj = new XCXPVPivotObject(); bool isCreated = iPivotObj.Create( chartID, window, pivot, prefix // ); if (!isCreated) { return result; } // color clrPivotColor = pivot.IsPeak() ? clrAqua : clrMagenta; iPivotObj.PivotColor(clrPivotColor); iPivotObj.PivotWidth(2); // Add( (XCBaseObject *)iPivotObj, drawnObjects // ); // result = ArraySize(drawnObjects); // if (!drawState) { return result; } // if (!pivot.state.IsValid()) { return result; } // XCBaseObject *stateObjects[]; int stateCount = DrawState( pivot.state, stateObjects, drawTicksZone, ignoreSwingHighs, ignoreSwingLows, ignoreSupportZones, ignoreResistanceZones, ignoreSupplyZones, ignoreDemandZones, ignoreBullishOrderBlocks, ignoreBearishOrderBlocks, ignoreBullishFairValueGaps, ignoreBearishFairValueGaps, ignoreBullishRejectionBars, ignoreBearishRejectionBars, ignoreBullishMomentumBars, ignoreBearishMomentumBars // ); // if (IsValidSize(stateCount)) { // Copy( stateObjects, drawnObjects, false // Doesn't Clean ... ); } // result = ArraySize(drawnObjects); // return result; } /** * Draw Specified XFVGOrderBlock Object ... * * @param models: XFVGOrderBlock instance Reference ... * * @return ( int ) */ int DrawFVGOrderBlock( XFVGOrderBlock &model, XCBaseObject *&drawnObjects[] // ) { // int result = 0; // Clean(drawnObjects); // if (!model.IsValid()) { return result; } // ENUM_X_DIRECTION iDir; result = model.GetDirection(iDir); if (!result) { return result; } // bool isBullish = IsBullish(iDir); if (isBullish) { // // Order Block ... XCBullishOrderBlockObject *iOBObj; bool isCreated = CreateBullishOrderBlock( model.orderBlock, iOBObj // ); if (isCreated) { // Add( (XCBaseObject *)iOBObj, drawnObjects // ); } // // FVG ... XCBullishFairValueGapObject *iFVGObj; isCreated = CreateBullishFairValueGap( model.fairValueGap, iFVGObj // ); if (isCreated) { // Add( (XCBaseObject *)iOBObj, drawnObjects // ); } } else { // // Order Block ... XCBearishOrderBlockObject *iOBObj; bool isCreated = CreateBearishOrderBlock( model.orderBlock, iOBObj // ); if (isCreated) { // Add( (XCBaseObject *)iOBObj, drawnObjects // ); } // // FVG ... XCBearishFairValueGapObject *iFVGObj; isCreated = CreateBearishFairValueGap( model.fairValueGap, iFVGObj // ); if (isCreated) { // Add( (XCBaseObject *)iFVGObj, drawnObjects // ); } } // result = ArraySize(drawnObjects); // return result; } // protected: // // private: // // // Props ... // string mPrefix; // Prefix of Created Objects ... long mChartIdentification; // Chart Id ... int mSubWindowIdentification; // Sub Window ... // // XOHCL ... int mBarWidth; // Bar Width ... color mBarBullishColor; // Bar Bullish Color ... color mBarBearishColor; // Bar Bearish Color ... bool mBarFillHighShadow; // Fill Bar High Shadow ... ENUM_LINE_STYLE mBarHighShadowStyle; // Bar High Shadow Style ... bool mBarFillBody; // Fill Bar Body ... ENUM_LINE_STYLE mBarBodyStyle; // Bar Body Style ... bool mBarFillLowShadow; // Fill Bar Low Show ... ENUM_LINE_STYLE mBarLowShadowStyle; // Bar Low Shadow Style ... // // 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 ... // };