/////////////////////////////////////////////////////// // // SaherElm IT Center MQL5 Helper Class Library // ---------------------------------------------- // Name: XCX121Helper // Description: provides all Indicator // Helper requirements ... // // // 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.x-helper.class.mq5" // // Definitions ... enum ENUM_X121_BUFFERS { // // Main Buffers ... X121_PEAKS_LINE = 0, X121_VALES_LINE = 1, X121_SAR_LINE = 2, X121_ATR_UPPER_LINE = 3, X121_ATR_LOWER_LINE = 4, X121_VWAP_FAST_LINE = 5, X121_VWAP_MID_LINE = 7, X121_VWAP_SLOW_LINE = 9, X121_DON_OPEN_UPPER_LINE = 11, X121_DON_OPEN_LOWER_LINE = 12, X121_DON_HIGH_UPPER_LINE = 13, X121_DON_HIGH_LOWER_LINE = 14, X121_DON_LOW_UPPER_LINE = 15, X121_DON_LOW_LOWER_LINE = 16, X121_DON_CLOSE_UPPER_LINE = 17, X121_DON_CLOSE_LOWER_LINE = 18, X121_FIB_LEVEL_1_LINE = 19, X121_FIB_LEVEL_2_LINE = 20, X121_FIB_LEVEL_3_LINE = 21, X121_FIB_LEVEL_4_LINE = 22, X121_FIB_LEVEL_5_LINE = 23, // // Data Buffers ... // // XPV Data ... X121_CURRENT_HH_LINE = 24, X121_CURRENT_LL_LINE = 25, X121_SHORT_HH_LINE = 26, X121_SHORT_LL_LINE = 27, X121_MEDIUM_HH_LINE = 28, X121_MEDIUM_LL_LINE = 29, X121_LONG_HH_LINE = 30, X121_LONG_LL_LINE = 31, X121_HIND_HH_LINE = 32, X121_HIND_LL_LINE = 33, // // VWAP Data ... X121_VWAP_VOLUME_LINE = 34, X121_VWAP_PRICE_LINE = 35, X121_VWAP_FAST_STATE_LINE = 36, X121_VWAP_MID_STATE_LINE = 37, X121_VWAP_SLOW_STATE_LINE = 38, // // ATR ... X121_ATR_LINE = 39, X121_ATR_UPPER_RAW_LINE = 40, X121_ATR_LOWER_RAW_LINE = 41, }; // enum ENUM_XVWAP_STATES { // XVWAP_STATE_BULLISH = 1, XVWAP_STATE_BEARISH = 2, XVWAP_STATE_NEUTURAL = 3, }; // // Inputs ... struct X121Inputs { // // Props ... // // Cycles ... // // Short ... ENUM_X_PERIOD_METHOD scMethod; // How to Find Period ENUM_TIMEFRAMES scPeriod; // Time Period // // Medium ... ENUM_X_PERIOD_METHOD mcMethod; // How to Find Period ENUM_TIMEFRAMES mcPeriod; // Time Period // // Long ... ENUM_X_PERIOD_METHOD lcMethod; // How to Find Period ENUM_TIMEFRAMES lcPeriod; // Time Period // // Hind ... ENUM_X_PERIOD_METHOD hcMethod; // How to Find Period ENUM_TIMEFRAMES hcPeriod; // Time Period // // Boundary Detection ... ENUM_SERIESMODE hhMode; // Highest High Calculation Method ENUM_SERIESMODE llMode; // Lowest Low Calculation Method // // Parabolic Sar Detection ... double sarStep; // Step double sarMax; // Maximum // // Atr Detection ... int atrLength; // Length double atrMultiplier; // Multiplier ENUM_APPLIED_PRICE atrUpperAppliedTo; // Upper Zone Applied To ENUM_APPLIED_PRICE atrLowerAppliedTo; // Lower Zone Applied To ENUM_X_MA_METHOD atrSmoothingMode; // Smoothing Method // // VWap Detection ... int vwapFastLength; // Fast Length int vwapMidLength; // Mid Length int vwapSlowLength; // Slow Length ENUM_APPLIED_PRICE vwapAppliedTo; // Applied To // // Donchain Detection ... int donchainLength; // Donchain Length // // Fibonacci ... double fiboLevel1; // Fibio 1st Level double fiboLevel2; // Fibio 2st Level double fiboLevel3; // Fibio 3rd Level double fiboLevel4; // Fibio 4th Level double fiboLevel5; // Fibio 5th Level // // Presentation ... // int startCalculationForLastBars; // Calculate Last n Bars // int sarArrowCode; // Parabolic Sar Arrow Code int peaksArrowCode; // Peaks Arrow Code int valesArrowCode; // Vales Arrow Code // // Global ... bool showSar; // Show Parabolic Sar bool showAtr; // Show Atr bool showPeaks; // Show Peaks bool showVales; // Show Vales bool showVWap; // Show VWap bool showDonchain; // Show Donchain // // Fibonachi Presentation ... bool showFibo1Levels; // Show Fibo 1st Level bool showFibo2Levels; // Show Fibo 2nd Level bool showFibo3Levels; // Show Fibo 3rd Level bool showFibo4Levels; // Show Fibo 4th Level bool showFibo5Levels; // Show Fibo 5th Level // // Atr Presentation ... bool showAtrUpper; // Show Upper Zone bool showAtrLower; // Show Lower Zone // // VWap Presentation ... bool showVWapFast; // Show VWap Fast bool showVWapMedium; // Show VWap Medium bool showVWapSlow; // Show VWap Slow // // Donchain Presentation ... // bool showUpper; // Show Upper Band bool showLower; // Show Lower Band // bool showOpen; // Show Open bool showHigh; // Show High bool showClose; // Show Close bool showLow; // Show Low // // Constructor ... X121Inputs() { Clean(); } // // Tools ... /** * Cleaning Up ... */ void Clean() { // // Cycles ... // // Short ... scMethod = X_PERIOD_NOTHING; scPeriod = NULL; // // Medium ... mcMethod = X_PERIOD_NOTHING; mcPeriod = NULL; // // Long ... lcMethod = X_PERIOD_NOTHING; lcPeriod = NULL; // // Hind ... hcMethod = X_PERIOD_NOTHING; hcPeriod = NULL; // // Boundary Detection ... hhMode = MODE_HIGH; llMode = MODE_LOW; // // Paraboli Sar Detection ... sarStep = 0; sarMax = 0; // // Atr Detection ... atrLength = 0; // Length atrMultiplier = 0; // Multiplier atrUpperAppliedTo = PRICE_HIGH; // Upper Zone Applied To atrLowerAppliedTo = PRICE_LOW; // Lower Zone Applied To atrSmoothingMode = X_MA_MODE_NONE; // Smoothing Method // // VWap Detection ... vwapFastLength = 0; vwapMidLength = 0; vwapSlowLength = 0; vwapAppliedTo = PRICE_CLOSE; // // Donchain Detection ... donchainLength = 0; // // Fibonacci ... fiboLevel1 = 0; fiboLevel2 = 0; fiboLevel3 = 0; fiboLevel4 = 0; fiboLevel5 = 0; // // Presentation ... // startCalculationForLastBars = 0; // sarArrowCode = 0; peaksArrowCode = 0; valesArrowCode = 0; // // Globals ... showSar = false; showAtr = false; showPeaks = false; showVales = false; showVWap = false; showDonchain = false; // // Fibonachi Presentation ... showFibo1Levels = false; showFibo2Levels = false; showFibo3Levels = false; showFibo4Levels = false; showFibo5Levels = false; // // Atr Presentation ... showAtrUpper = false; // Show Upper Zone showAtrLower = false; // Show Lower Zone // // VWap Presentation ... showVWapFast = false; showVWapMedium = false; showVWapSlow = false; // // Donchain Presentation ... // showUpper = false; showLower = false; // showOpen = false; showHigh = false; showClose = false; showLow = false; } /** * Set Default Values ... */ void Default() { // // Cycles ... // // Short ... scMethod = X_PERIOD_AUTO; scPeriod = NULL; // // Medium ... mcMethod = X_PERIOD_AUTO; mcPeriod = NULL; // // Long ... lcMethod = X_PERIOD_AUTO; lcPeriod = NULL; // // Hind ... hcMethod = X_PERIOD_AUTO; hcPeriod = NULL; // // Boundary Detection ... hhMode = MODE_HIGH; llMode = MODE_LOW; // // Paraboli Sar Detection ... sarStep = 0.02; sarMax = 0.2; // // Atr Detection ... atrLength = 14; // Length atrMultiplier = 1; // Multiplier atrUpperAppliedTo = PRICE_HIGH; // Upper Zone Applied To atrLowerAppliedTo = PRICE_LOW; // Lower Zone Applied To atrSmoothingMode = X_MA_MODE_EMA; // Smoothing Method // // VWap Detection ... vwapFastLength = 20; vwapMidLength = 40; vwapSlowLength = 60; vwapAppliedTo = PRICE_CLOSE; // // Donchain Detection ... donchainLength = 40; // // Fibonacci ... fiboLevel1 = 0.236; fiboLevel2 = 0.382; fiboLevel3 = 0.5; fiboLevel4 = 0.618; fiboLevel5 = 0.764; // // Presentation ... // startCalculationForLastBars = 1500; // sarArrowCode = 159; peaksArrowCode = 159; valesArrowCode = 159; // // Globals ... showSar = true; showAtr = true; showPeaks = true; showVales = true; showVWap = true; showDonchain = true; // // Fibonachi Presentation ... showFibo1Levels = false; showFibo2Levels = false; showFibo3Levels = true; showFibo4Levels = false; showFibo5Levels = false; // // Atr Presentation ... showAtrUpper = true; // Show Upper Zone showAtrLower = true; // Show Lower Zone // // VWap Presentation ... showVWapFast = true; showVWapMedium = true; showVWapSlow = true; // // Donchain Presentation ... // showUpper = true; showLower = true; // showOpen = true; showHigh = false; showClose = true; showLow = false; } /** * Validate ... * * @return ( bool ) */ bool IsValid() { // bool result = false; // result = // // PSAR ... sarMax > 0 && sarStep > 0 && sarMax > sarStep && // // ATR ... atrLength > 0 && atrMultiplier > 0 && // // XDON ... donchainLength > 0 && // // VWAP ... vwapFastLength > 2 && vwapMidLength > vwapFastLength && vwapSlowLength > vwapMidLength && // // XPV ... (IsValid(scMethod, scPeriod) && IsValid(mcMethod, mcPeriod) && IsValid(lcMethod, lcPeriod) && IsValid(hcMethod, hcPeriod)) // ; // return result; } /** * Extract Max Input Length ... * * @return ( int ) */ int Max() { // int result = 0; // // VWAP ... result = MathMax(result, vwapFastLength); result = MathMax(result, vwapFastLength); result = MathMax(result, vwapMidLength); // // ATR ... result = MathMax(result, atrLength); // return result; } }; // // Conditions ... struct X121Conditions { // // Common ... string symbol; ENUM_TIMEFRAMES period; datetime time; // // Buffers ... double peaksBuffer[]; double valesBuffer[]; double sarBuffer[]; double atrUpperBuffer[]; double atrLowerBuffer[]; double vwapFastBuffer[]; double vwapMidBuffer[]; double vwapSlowBuffer[]; double donOpenUpperBuffer[]; double donOpenLowerBuffer[]; double donCloseUpperBuffer[]; double donCloseLowerBuffer[]; double donHighUpperBuffer[]; double donHighLowerBuffer[]; double donLowUpperBuffer[]; double donLowLowerBuffer[]; double fl1Buffer[]; double fl2Buffer[]; double fl3Buffer[]; double fl4Buffer[]; double fl5Buffer[]; double cHHBuffer[]; double cLLBuffer[]; double sHHBuffer[]; double sLLBuffer[]; double mHHBuffer[]; double mLLBuffer[]; double lHHBuffer[]; double lLLBuffer[]; double hHHBuffer[]; double hLLBuffer[]; double atrBuffer[]; double atrUpperRawBuffer[]; double atrLowerRawBuffer[]; double vwapVolumeBuffer[]; double vwapPriceBuffer[]; double vwapFastStateBuffer[]; double vwapMidStateBuffer[]; double vwapSlowStateBuffer[]; double validPeaksBuffer[]; double validValesBuffer[]; // // Conditions ... // // XSAR ... // bool isSarBullish; bool isSarBearish; // bool isSarSwitchedToBullish; bool isSarSwitchedToBearish; // // XPV ... // bool isNewPeak; bool isNewPeakOverLast; bool isNewPeakUnderLast; // bool isNewVale; bool isNewValeOverLast; bool isNewValeUnderLast; // // XVWAP ... // bool isVWapFastBullish; bool isVWapFastBearish; bool isVWapFastNeutural; // bool isVWapMidBullish; bool isVWapMidBearish; bool isVWapMidNeutural; // bool isVWapSlowBullish; bool isVWapSlowBearish; bool isVWapSlowNeutural; // bool isVWapFastOverMid; bool isVWapMidOverSlow; // bool isVWapFastUnderMid; bool isVWapMidUnderSlow; // bool isVWapBullishState; bool isVWapBearishState; bool isVWapNeuturalState; // bool isVWapBullishOrdered; bool isVWapBearishOrdered; // bool isVWapSwitchedToBullishOrdered; bool isVWapSwitchedToBearishOrdered; // bool isVWapSwitchedToBullishState; bool isVWapSwitchedToBearishState; bool isVWapSwitchedToNeuturalState; // // XDON ... // // bool isCloseLower // // XFIBONACCI ... // bool isOerFib1; bool isOerFib2; bool isOerFib3; bool isOerFib4; bool isOerFib5; // bool isUnderFib1; bool isUnderFib2; bool isUnderFib3; bool isUnderFib4; bool isUnderFib5; // bool isCloseOerFib1; bool isCloseOerFib2; bool isCloseOerFib3; bool isCloseOerFib4; bool isCloseOerFib5; // bool isCloseUnderFib1; bool isCloseUnderFib2; bool isCloseUnderFib3; bool isCloseUnderFib4; bool isCloseUnderFib5; // // Constructor ... X121Conditions() { Clean(); } // // Tools ... /** * Cleaning Up ... */ void Clean() { // // Commons ... symbol = NULL; period = NULL; time = NULL; // // Buffers ... // Clean(peaksBuffer); Clean(valesBuffer); Clean(sarBuffer); Clean(atrUpperBuffer); Clean(atrLowerBuffer); Clean(vwapFastBuffer); Clean(vwapMidBuffer); Clean(vwapSlowBuffer); Clean(donOpenUpperBuffer); Clean(donOpenLowerBuffer); Clean(donCloseUpperBuffer); Clean(donCloseLowerBuffer); Clean(donHighUpperBuffer); Clean(donHighLowerBuffer); Clean(donLowUpperBuffer); Clean(donLowLowerBuffer); Clean(fl1Buffer); Clean(fl2Buffer); Clean(fl3Buffer); Clean(fl4Buffer); Clean(fl5Buffer); Clean(cHHBuffer); Clean(cLLBuffer); Clean(sHHBuffer); Clean(sLLBuffer); Clean(mHHBuffer); Clean(mLLBuffer); Clean(lHHBuffer); Clean(lLLBuffer); Clean(hHHBuffer); Clean(hLLBuffer); Clean(atrBuffer); Clean(atrUpperRawBuffer); Clean(atrLowerRawBuffer); Clean(vwapVolumeBuffer); Clean(vwapPriceBuffer); Clean(vwapFastStateBuffer); Clean(vwapMidStateBuffer); Clean(vwapSlowStateBuffer); Clean(validPeaksBuffer); Clean(validValesBuffer); // ArraySetAsSeries(peaksBuffer, true); ArraySetAsSeries(valesBuffer, true); ArraySetAsSeries(sarBuffer, true); ArraySetAsSeries(atrUpperBuffer, true); ArraySetAsSeries(atrLowerBuffer, true); ArraySetAsSeries(vwapFastBuffer, true); ArraySetAsSeries(vwapMidBuffer, true); ArraySetAsSeries(vwapSlowBuffer, true); ArraySetAsSeries(donOpenUpperBuffer, true); ArraySetAsSeries(donOpenLowerBuffer, true); ArraySetAsSeries(donCloseUpperBuffer, true); ArraySetAsSeries(donCloseLowerBuffer, true); ArraySetAsSeries(donHighUpperBuffer, true); ArraySetAsSeries(donHighLowerBuffer, true); ArraySetAsSeries(donLowUpperBuffer, true); ArraySetAsSeries(donLowLowerBuffer, true); ArraySetAsSeries(fl1Buffer, true); ArraySetAsSeries(fl2Buffer, true); ArraySetAsSeries(fl3Buffer, true); ArraySetAsSeries(fl4Buffer, true); ArraySetAsSeries(fl5Buffer, true); ArraySetAsSeries(cHHBuffer, true); ArraySetAsSeries(cLLBuffer, true); ArraySetAsSeries(sHHBuffer, true); ArraySetAsSeries(sLLBuffer, true); ArraySetAsSeries(mHHBuffer, true); ArraySetAsSeries(mLLBuffer, true); ArraySetAsSeries(lHHBuffer, true); ArraySetAsSeries(lLLBuffer, true); ArraySetAsSeries(hHHBuffer, true); ArraySetAsSeries(hLLBuffer, true); ArraySetAsSeries(atrBuffer, true); ArraySetAsSeries(atrUpperRawBuffer, true); ArraySetAsSeries(atrLowerRawBuffer, true); ArraySetAsSeries(vwapVolumeBuffer, true); ArraySetAsSeries(vwapPriceBuffer, true); ArraySetAsSeries(vwapFastStateBuffer, true); ArraySetAsSeries(vwapMidStateBuffer, true); ArraySetAsSeries(vwapSlowStateBuffer, true); ArraySetAsSeries(validPeaksBuffer, true); ArraySetAsSeries(validValesBuffer, true); // // Conditions ... // // XSAR ... // isSarBullish = false; isSarBearish = false; // isSarSwitchedToBullish = false; isSarSwitchedToBearish = false; // // XPV ... // isNewPeak = false; isNewPeakOverLast = false; isNewPeakUnderLast = false; // isNewVale = false; isNewValeOverLast = false; isNewValeUnderLast = false; // // XVWAP ... // isVWapFastBullish = false; isVWapFastBearish = false; isVWapFastNeutural = false; // isVWapMidBullish = false; isVWapMidBearish = false; isVWapMidNeutural = false; // isVWapSlowBullish = false; isVWapSlowBearish = false; isVWapSlowNeutural = false; // isVWapFastOverMid = false; isVWapMidOverSlow = false; // isVWapFastUnderMid = false; isVWapMidUnderSlow = false; // isVWapBullishState = false; isVWapBearishState = false; isVWapNeuturalState = false; // isVWapBullishOrdered = false; isVWapBearishOrdered = false; // isVWapSwitchedToBullishOrdered = false; isVWapSwitchedToBearishOrdered = false; // isVWapSwitchedToBullishState = false; isVWapSwitchedToBearishState = false; isVWapSwitchedToNeuturalState = false; // // XDON ... // // XFIBONACCI ... // isOerFib1 = false; isOerFib2 = false; isOerFib3 = false; isOerFib4 = false; isOerFib5 = false; // isUnderFib1 = false; isUnderFib2 = false; isUnderFib3 = false; isUnderFib4 = false; isUnderFib5 = false; // isCloseOerFib1 = false; isCloseOerFib2 = false; isCloseOerFib3 = false; isCloseOerFib4 = false; isCloseOerFib5 = false; // isCloseUnderFib1 = false; isCloseUnderFib2 = false; isCloseUnderFib3 = false; isCloseUnderFib4 = false; isCloseUnderFib5 = false; } /** * Generate Conditions Scores ... * * @param bullishScore: Double, Directional Scores Reference ... * @param bearishScore: Double, Directional Scores Reference ... */ void GenerateScore( double &bullishScore, double &bearishScore // ) { // bullishScore = 0; bearishScore = 0; // // TODO: Implement if Required ... } /** * Generate Summary String for Represent Conditions State ... * * @param onlyCommons: Boolean, Just Generate Only Commons Conditions ... * @param onlyConditions: Boolean, Just Generate Only Conditions ... * @param includeScores: Boolean, Attach Scores Representations on Result ... * @param ignoreFalseConditions: Boolean, Ignore False Conditions on Result ... * @param separator: String, Separate Lines ... * * @return ( string ) */ string GenerateSummary( bool onlyCommons = false, bool onlyConditions = false, bool includeScores = true, bool ignoreFalseConditions = true, string separator = "\n" // ) { // string result = NULL; // double bullishScore = 0; double bearishScore = 0; GenerateScore( bullishScore, bearishScore // ); // string scoresStr = // "Scores: " + separator + "---------------" + separator + "Bullish: " + ToString(bullishScore) + separator + "Bearish: " + ToString(bearishScore) + separator + "" // ; // string commonStr = GenerateSpecifiedCommonSummary( this, separator, includeScores // ); // // TODO: Implement this if required ... string conditionsStr = // // XSAR ... ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) + ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) + ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) + ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) + // // XPV ... ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) + ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) + ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) + ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) + ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) + ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) + // // XVWAP ... ToString("isVWapFastBullish", isVWapFastBullish, ignoreFalseConditions, separator) + ToString("isVWapFastBearish", isVWapFastBearish, ignoreFalseConditions, separator) + ToString("isVWapFastNeutural", isVWapFastNeutural, ignoreFalseConditions, separator) + ToString("isVWapMidBullish", isVWapMidBullish, ignoreFalseConditions, separator) + ToString("isVWapMidBearish", isVWapMidBearish, ignoreFalseConditions, separator) + ToString("isVWapMidNeutural", isVWapMidNeutural, ignoreFalseConditions, separator) + ToString("isVWapSlowBullish", isVWapSlowBullish, ignoreFalseConditions, separator) + ToString("isVWapSlowBearish", isVWapSlowBearish, ignoreFalseConditions, separator) + ToString("isVWapSlowNeutural", isVWapSlowNeutural, ignoreFalseConditions, separator) + ToString("isVWapFastOverMid", isVWapFastOverMid, ignoreFalseConditions, separator) + ToString("isVWapMidOverSlow", isVWapMidOverSlow, ignoreFalseConditions, separator) + ToString("isVWapFastUnderMid", isVWapFastUnderMid, ignoreFalseConditions, separator) + ToString("isVWapMidUnderSlow", isVWapMidUnderSlow, ignoreFalseConditions, separator) + ToString("isVWapBullishState", isVWapBullishState, ignoreFalseConditions, separator) + ToString("isVWapBearishState", isVWapBearishState, ignoreFalseConditions, separator) + ToString("isVWapNeuturalState", isVWapNeuturalState, ignoreFalseConditions, separator) + ToString("isVWapBullishOrdered", isVWapBullishOrdered, ignoreFalseConditions, separator) + ToString("isVWapBearishOrdered", isVWapBearishOrdered, ignoreFalseConditions, separator) + ToString("isVWapSwitchedToBullishOrdered", isVWapSwitchedToBullishOrdered, ignoreFalseConditions, separator) + ToString("isVWapSwitchedToBearishOrdered", isVWapSwitchedToBearishOrdered, ignoreFalseConditions, separator) + ToString("isVWapSwitchedToBullishState", isVWapSwitchedToBullishState, ignoreFalseConditions, separator) + ToString("isVWapSwitchedToBearishState", isVWapSwitchedToBearishState, ignoreFalseConditions, separator) + ToString("isVWapSwitchedToNeuturalState", isVWapSwitchedToNeuturalState, ignoreFalseConditions, separator) + // // XFIBONACCI ... ToString("isOerFib1", isOerFib1, ignoreFalseConditions, separator) + ToString("isOerFib2", isOerFib2, ignoreFalseConditions, separator) + ToString("isOerFib3", isOerFib3, ignoreFalseConditions, separator) + ToString("isOerFib4", isOerFib4, ignoreFalseConditions, separator) + ToString("isOerFib5", isOerFib5, ignoreFalseConditions, separator) + ToString("isUnderFib1", isUnderFib1, ignoreFalseConditions, separator) + ToString("isUnderFib2", isUnderFib2, ignoreFalseConditions, separator) + ToString("isUnderFib3", isUnderFib3, ignoreFalseConditions, separator) + ToString("isUnderFib4", isUnderFib4, ignoreFalseConditions, separator) + ToString("isUnderFib5", isUnderFib5, ignoreFalseConditions, separator) + ToString("isCloseOerFib1", isCloseOerFib1, ignoreFalseConditions, separator) + ToString("isCloseOerFib2", isCloseOerFib2, ignoreFalseConditions, separator) + ToString("isCloseOerFib3", isCloseOerFib3, ignoreFalseConditions, separator) + ToString("isCloseOerFib4", isCloseOerFib4, ignoreFalseConditions, separator) + ToString("isCloseOerFib5", isCloseOerFib5, ignoreFalseConditions, separator) + ToString("isCloseUnderFib1", isCloseUnderFib1, ignoreFalseConditions, separator) + ToString("isCloseUnderFib2", isCloseUnderFib2, ignoreFalseConditions, separator) + ToString("isCloseUnderFib3", isCloseUnderFib3, ignoreFalseConditions, separator) + ToString("isCloseUnderFib4", isCloseUnderFib4, ignoreFalseConditions, separator) + ToString("isCloseUnderFib5", isCloseUnderFib5, ignoreFalseConditions, separator) + // "" // ; // result = // "[" + GetTag() + "]" + separator + (onlyConditions ? "" : commonStr) + (!includeScores ? "" : scoresStr) + " " + separator + (onlyCommons ? "" : conditionsStr) + "" // ; // return result; } /** * Retrieve nique Tag Identifier ... * * @return ( string ) */ string GetTag() { return GetTypeName(this); } // }; // // Implementation ... class XCX121Helper : public XCBaseHelper { // public: // // // Constructors ... XCX121Helper() : XCBaseHelper(_Symbol, _Period) { } // // Deconstructor ... ~XCX121Helper() { } // // Tools ... /** * Initialize Indicator Helper ... * * @param symbol: String, Symbol ... * @param period: ENUM_TIMEFRAMES member, Period ... * @param inputs: X121Inputs instance, Indicator Inputs ... * * @return ( bool ) */ bool Init( string symbol, // Trading Symbol ENUM_TIMEFRAMES period, // Trading Period X121Inputs &inputs // Inputs ) { // bool result = false; // mSymbol = symbol; mPeriod = period; // // Validate Inputs ... result = inputs.IsValid(); if (!result) { return result; } // mInputs = inputs; // // Setting Arrays As Series ... ArraySetAsSeries(peaksBuffer, true); ArraySetAsSeries(valesBuffer, true); ArraySetAsSeries(sarBuffer, true); ArraySetAsSeries(atrUpperBuffer, true); ArraySetAsSeries(atrLowerBuffer, true); ArraySetAsSeries(vwapFastBuffer, true); ArraySetAsSeries(vwapMidBuffer, true); ArraySetAsSeries(vwapSlowBuffer, true); ArraySetAsSeries(donOpenUpperBuffer, true); ArraySetAsSeries(donOpenLowerBuffer, true); ArraySetAsSeries(donCloseUpperBuffer, true); ArraySetAsSeries(donCloseLowerBuffer, true); ArraySetAsSeries(donHighUpperBuffer, true); ArraySetAsSeries(donHighLowerBuffer, true); ArraySetAsSeries(donLowUpperBuffer, true); ArraySetAsSeries(donLowLowerBuffer, true); ArraySetAsSeries(fl1Buffer, true); ArraySetAsSeries(fl2Buffer, true); ArraySetAsSeries(fl3Buffer, true); ArraySetAsSeries(fl4Buffer, true); ArraySetAsSeries(fl5Buffer, true); ArraySetAsSeries(cHHBuffer, true); ArraySetAsSeries(cLLBuffer, true); ArraySetAsSeries(sHHBuffer, true); ArraySetAsSeries(sLLBuffer, true); ArraySetAsSeries(mHHBuffer, true); ArraySetAsSeries(mLLBuffer, true); ArraySetAsSeries(lHHBuffer, true); ArraySetAsSeries(lLLBuffer, true); ArraySetAsSeries(hHHBuffer, true); ArraySetAsSeries(hLLBuffer, true); ArraySetAsSeries(atrBuffer, true); ArraySetAsSeries(atrUpperRawBuffer, true); ArraySetAsSeries(atrLowerRawBuffer, true); ArraySetAsSeries(vwapVolumeBuffer, true); ArraySetAsSeries(vwapPriceBuffer, true); ArraySetAsSeries(vwapFastStateBuffer, true); ArraySetAsSeries(vwapMidStateBuffer, true); ArraySetAsSeries(vwapSlowStateBuffer, true); // mHandler = iCustom( mSymbol, mPeriod, "x-saherelm.x121", // // Inputs ... // // Cycles ... "", // // Short ... "", mInputs.scMethod, mInputs.scPeriod, // // Medium ... "", mInputs.mcMethod, mInputs.mcPeriod, // // Long ... "", mInputs.lcMethod, mInputs.lcPeriod, // // Hind ... "", mInputs.hcMethod, mInputs.hcPeriod, // // Boundary Detection ... "", mInputs.hhMode, mInputs.llMode, // // Parabolic Sar Detection ... "", mInputs.sarStep, mInputs.sarMax, // // Atr Detection ... "", mInputs.atrLength, mInputs.atrMultiplier, mInputs.atrUpperAppliedTo, mInputs.atrLowerAppliedTo, mInputs.atrSmoothingMode, // // VWap Detection ... "", mInputs.vwapFastLength, mInputs.vwapMidLength, mInputs.vwapSlowLength, mInputs.vwapAppliedTo, // // Donchain Detection ... "", mInputs.donchainLength, // // Presentation ... "", mInputs.startCalculationForLastBars, // // Commons ... mInputs.showSar, mInputs.showAtr, mInputs.showPeaks, mInputs.showVales, mInputs.showVWap, mInputs.showDonchain, // // Fibonachi Presentation ... "", mInputs.showFibo1Levels, mInputs.showFibo2Levels, mInputs.showFibo3Levels, mInputs.showFibo4Levels, mInputs.showFibo5Levels, // // Atr Presentation ... "", mInputs.showAtrUpper, mInputs.showAtrLower, // // VWap Presentation ... "", mInputs.showVWapFast, mInputs.showVWapMedium, mInputs.showVWapSlow, // // Donchain Presentation ... "", mInputs.showUpper, mInputs.showLower, mInputs.showOpen, mInputs.showHigh, mInputs.showClose, mInputs.showLow // // Non Important Inpust ... // // Fibonacci ... // "", // mInputs.fiboLevel1, // mInputs.fiboLevel2, // mInputs.fiboLevel3, // mInputs.fiboLevel4, // mInputs.fiboLevel5, // // // mInputs.sarArrowCode, // mInputs.peaksArrowCode, // mInputs.valesArrowCode // ); result = mHandler != INVALID_HANDLE; if (!result) { return result; } // return result; } /** * Retrieve Current Indicator Configs ... * * @return ( Inputs ) */ X121Inputs GetInputs() { return mInputs; } /** * Set New Indicator Inputs ... * * @param inputs: X121Inputs instance, Indicator Inputs ... * * @return ( bool ) */ bool SetInputs( X121Inputs &inputs // Configs ) { // return Init( mSymbol, mPeriod, inputs // ); } /** * Retrieve DON Chain Length ... * * @return ( int ) */ int GetDonChainLength() { return mInputs.donchainLength; } // // Implement Value Getters ... // // SAR ... // double GetSar( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(sarBuffer); if (barIndex >= count) { barIndex = count - 1; } // return sarBuffer[barIndex]; } // int CopySar( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, sarBuffer, buffer, forceClean // ); } // // ATR ... // // Common ... // double GetAtr( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(atrBuffer); if (barIndex >= count) { barIndex = count - 1; } // return atrBuffer[barIndex]; } // int CopyAtr( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, atrBuffer, buffer, forceClean // ); } // double GetAtrUpper( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(atrUpperBuffer); if (barIndex >= count) { barIndex = count - 1; } // return atrUpperBuffer[barIndex]; } // int CopyAtrUpper( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, atrUpperBuffer, buffer, forceClean // ); } // double GetAtrUpperRaw( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(atrUpperRawBuffer); if (barIndex >= count) { barIndex = count - 1; } // return atrUpperRawBuffer[barIndex]; } // int CopyAtrUpperRaw( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, atrUpperRawBuffer, buffer, forceClean // ); } // double GetAtrLower( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(atrLowerBuffer); if (barIndex >= count) { barIndex = count - 1; } // return atrLowerBuffer[barIndex]; } // int CopyAtrLower( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, atrLowerBuffer, buffer, forceClean // ); } // double GetAtrLowerRaw( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(atrLowerRawBuffer); if (barIndex >= count) { barIndex = count - 1; } // return atrLowerRawBuffer[barIndex]; } // int CopyAtrLowerRaw( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, atrLowerRawBuffer, buffer, forceClean // ); } // // PV ... // // PEAKS ... // double GetPeak( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(peaksBuffer); if (barIndex >= count) { barIndex = count - 1; } // return peaksBuffer[barIndex]; } // int CopyPeak( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, peaksBuffer, buffer, forceClean // ); } // // VALES ... // double GetVale( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(valesBuffer); if (barIndex >= count) { barIndex = count - 1; } // return valesBuffer[barIndex]; } // int CopyVale( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, valesBuffer, buffer, forceClean // ); } // double GetLowestPeak( int barIndex, int &index, double &vale, int loopback = 576 // ) { // double result = 0; // index = -1; vale = 0; // if (barIndex < 0) { barIndex = 0; } // Calculate(); // for (int i = 0; i < barIndex + loopback; i++) { // double iPeak = GetPeak(i); if (iPeak == 0) { break; } // if (iPeak > 0 && (result == 0 || result >= iPeak)) { // index = i; result = iPeak; vale = GetVale(index); } } // return result; } // double GetHighestPeak( int barIndex, int &index, double &vale, int loopback = 576 // ) { // double result = 0; // index = -1; vale = 0; // if (barIndex < 0) { barIndex = 0; } // Calculate(); // for (int i = 0; i < barIndex + loopback; i++) { // double iPeak = GetPeak(i); if (iPeak == 0) { break; } // if (iPeak > 0 && (result == 0 || result <= iPeak)) { // index = i; result = iPeak; vale = GetVale(index); } } // return result; } // double GetLowestVale( int barIndex, int &index, double &peak, int loopback = 576 // ) { // double result = 0; // index = -1; peak = 0; // if (barIndex < 0) { barIndex = 0; } // Calculate(); // for (int i = 0; i < barIndex + loopback; i++) { // double iPeak = GetVale(i); if (iPeak == 0) { break; } // if (iPeak > 0 && (result == 0 || result >= iPeak)) { // index = i; result = iPeak; peak = GetPeak(index); } } // return result; } // double GetHighestVale( int barIndex, int &index, double &peak, int loopback = 576 // ) { // double result = 0; // index = -1; peak = 0; // if (barIndex < 0) { barIndex = 0; } // Calculate(); // for (int i = 0; i < barIndex + loopback; i++) { // double iPeak = GetVale(i); if (iPeak == 0) { break; } // if (iPeak > 0 && (result == 0 || result <= iPeak)) { // index = i; result = iPeak; peak = GetPeak(index); } } // return result; } // // CURRENT ... // // HH ... // double GetCHH( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(cHHBuffer); if (barIndex >= count) { barIndex = count - 1; } // return cHHBuffer[barIndex]; } // int CopyCHH( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, cHHBuffer, buffer, forceClean // ); } // // LL ... // double GetCLL( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(cLLBuffer); if (barIndex >= count) { barIndex = count - 1; } // return cLLBuffer[barIndex]; } // int CopyCLL( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, cLLBuffer, buffer, forceClean // ); } // // SHORT ... // // HH ... // double GetSHH( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(sHHBuffer); if (barIndex >= count) { barIndex = count - 1; } // return sHHBuffer[barIndex]; } // int CopySHH( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, sHHBuffer, buffer, forceClean // ); } // // LL ... // double GetSLL( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(sLLBuffer); if (barIndex >= count) { barIndex = count - 1; } // return sLLBuffer[barIndex]; } // int CopySLL( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, sLLBuffer, buffer, forceClean // ); } // // MEDIUM ... // // HH ... // double GetMHH( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(mHHBuffer); if (barIndex >= count) { barIndex = count - 1; } // return mHHBuffer[barIndex]; } // int CopyMHH( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, mHHBuffer, buffer, forceClean // ); } // // LL ... // double GetMLL( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(mLLBuffer); if (barIndex >= count) { barIndex = count - 1; } // return mLLBuffer[barIndex]; } // int CopyMLL( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, mLLBuffer, buffer, forceClean // ); } // // LONG ... // // HH ... // double GetLHH( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(lHHBuffer); if (barIndex >= count) { barIndex = count - 1; } // return lHHBuffer[barIndex]; } // int CopyLHH( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, lHHBuffer, buffer, forceClean // ); } // // LL ... // double GetLLL( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(lLLBuffer); if (barIndex >= count) { barIndex = count - 1; } // return lLLBuffer[barIndex]; } // int CopyLLL( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, lLLBuffer, buffer, forceClean // ); } // // HIND ... // // HH ... // double GetHHH( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(hHHBuffer); if (barIndex >= count) { barIndex = count - 1; } // return hHHBuffer[barIndex]; } // int CopyHHH( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, hHHBuffer, buffer, forceClean // ); } // // LL ... // double GetHLL( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(hLLBuffer); if (barIndex >= count) { barIndex = count - 1; } // return hLLBuffer[barIndex]; } // int CopyHLL( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, hLLBuffer, buffer, forceClean // ); } // // VWAP ... // // FAST ... // double GetVWapFast( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapFastBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapFastBuffer[barIndex]; } // int CopyVWapFast( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapFastBuffer, buffer, forceClean // ); } // // STATE FAST ... // double GetVWapFastState( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapFastStateBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapFastStateBuffer[barIndex]; } // int CopyVWapFastState( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapFastStateBuffer, buffer, forceClean // ); } // // MID ... // double GetVWapMid( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapMidBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapMidBuffer[barIndex]; } // int CopyVWapMid( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapMidBuffer, buffer, forceClean // ); } // // STATE MID ... // double GetVWapMidState( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapMidStateBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapMidStateBuffer[barIndex]; } // int CopyVWapMidState( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapMidStateBuffer, buffer, forceClean // ); } // // SLOW ... // double GetVWapSlowBuffer( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapSlowBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapSlowBuffer[barIndex]; } // int CopyVWapSlow( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapSlowBuffer, buffer, forceClean // ); } // // STATE SLOW ... // double GetVWapSlowState( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapSlowStateBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapSlowStateBuffer[barIndex]; } // int CopyVWapSlowState( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapSlowStateBuffer, buffer, forceClean // ); } // // VOLUME ... // double GetVWapVolume( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapVolumeBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapVolumeBuffer[barIndex]; } // int CopyVWapVolume( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapVolumeBuffer, buffer, forceClean // ); } // // PRICE ... // double GetVWapPrice( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(vwapPriceBuffer); if (barIndex >= count) { barIndex = count - 1; } // return vwapPriceBuffer[barIndex]; } // int CopyVWapPrice( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, vwapPriceBuffer, buffer, forceClean // ); } // // Converts to State ... ENUM_XVWAP_STATES ToVWAPState(double value) { // ENUM_XVWAP_STATES result = value == 1 ? XVWAP_STATE_BULLISH : value == 2 ? XVWAP_STATE_BEARISH : XVWAP_STATE_NEUTURAL; // return result; } // bool IsVWAPBullish(double value) { // bool result = false; // result = ToVWAPState(value) == XVWAP_STATE_BULLISH; // return result; } // bool IsVWAPBearish(double value) { // bool result = false; // result = ToVWAPState(value) == XVWAP_STATE_BEARISH; // return result; } // bool IsVWAPNeutural(double value) { // bool result = false; // result = ToVWAPState(value) == XVWAP_STATE_NEUTURAL; // return result; } // // XDON ... // // OPEN ... // // UPPER ... // double GetDonOpenUpper( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donOpenUpperBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donOpenUpperBuffer[barIndex]; } // int CopyDonOpenUpper( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donOpenUpperBuffer, buffer, forceClean // ); } // // LOWER ... // double GetDonOpenLower( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donOpenLowerBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donOpenLowerBuffer[barIndex]; } // int CopyDonOpenLower( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donOpenLowerBuffer, buffer, forceClean // ); } // // CLOSE ... // // UPPER ... // double GetDonCloseUpper( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donCloseUpperBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donCloseUpperBuffer[barIndex]; } // int CopyDonCloseUpper( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donCloseUpperBuffer, buffer, forceClean // ); } // // LOWER ... // double GetDonCloseLower( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donCloseLowerBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donCloseLowerBuffer[barIndex]; } // int CopyDonCloseLower( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donCloseLowerBuffer, buffer, forceClean // ); } // // HIGH ... // // UPPER ... // double GetDonHighUpper( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donHighUpperBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donHighUpperBuffer[barIndex]; } // int CopyDonHighUpper( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donHighUpperBuffer, buffer, forceClean // ); } // // LOWER ... // double GetDonHighLower( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donHighLowerBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donHighLowerBuffer[barIndex]; } // int CopyDonHighLower( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donHighLowerBuffer, buffer, forceClean // ); } // // LOW ... // // UPPER ... // double GetDonLowUpper( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donLowUpperBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donLowUpperBuffer[barIndex]; } // int CopyDonLowUpper( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donLowUpperBuffer, buffer, forceClean // ); } // // LOWER ... // double GetDonLoweLower( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(donLowLowerBuffer); if (barIndex >= count) { barIndex = count - 1; } // return donLowLowerBuffer[barIndex]; } // int CopyDonLoweLower( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // Force To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, donLowLowerBuffer, buffer, forceClean // ); } // // FIBONACCHI ... // // LEVEL 1 ... // double GetFiboLevel1( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(fl1Buffer); if (barIndex >= count) { barIndex = count - 1; } // return fl1Buffer[barIndex]; } // int CopyFiboLevel1( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // FiboLevel To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, fl1Buffer, buffer, forceClean // ); } // // LEVEL 2 ... // double GetFiboLevel2( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(fl2Buffer); if (barIndex >= count) { barIndex = count - 1; } // return fl2Buffer[barIndex]; } // int CopyFiboLevel2( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // FiboLevel To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, fl2Buffer, buffer, forceClean // ); } // // LEVEL 3 ... // double GetFiboLevel3( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(fl3Buffer); if (barIndex >= count) { barIndex = count - 1; } // return fl3Buffer[barIndex]; } // int CopyFiboLevel3( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // FiboLevel To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, fl3Buffer, buffer, forceClean // ); } // // LEVEL 4 ... // double GetFiboLevel4( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(fl4Buffer); if (barIndex >= count) { barIndex = count - 1; } // return fl4Buffer[barIndex]; } // int CopyFiboLevel4( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // FiboLevel To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, fl4Buffer, buffer, forceClean // ); } // // LEVEL 5 ... // double GetFiboLevel5( int barIndex // Bar Index ) { // if (barIndex < 0) { barIndex = 0; } // Calculate(); // int count = ArraySize(fl5Buffer); if (barIndex >= count) { barIndex = count - 1; } // return fl5Buffer[barIndex]; } // int CopyFiboLevel5( int start, // Start int count, // Number of Items for read double &buffer[], // Dest Buffer bool forceClean = true // FiboLevel To Clean buffer ) { // // Update Calculations ... Calculate(); // // Copy Items ... return Copy( start, count, fl5Buffer, buffer, forceClean // ); } // // Conditions Generation ... bool GetConditions( X121Conditions &conditions, // int barIndex = 0, // int loopback = 5 // ) { // bool result = true; // if (loopback < 5) { loopback = 5; } // conditions.Clean(); // conditions.symbol = mSymbol; conditions.period = mPeriod; conditions.time = TimeCurrent(); // int zIndex = barIndex; int cIndex = zIndex + 1; int pIndex = cIndex + 1; int ppIndex = pIndex + 1; // XOHCL zBar; result = zBar.Init( mSymbol, mPeriod, zIndex // ); if (!result) { return result; } // XOHCL cBar; result = cBar.Init( mSymbol, mPeriod, cIndex // ); if (!result) { return result; } // XOHCL pBar; result = pBar.Init( mSymbol, mPeriod, pIndex // ); if (!result) { return result; } // // Buffers ... // CopySar( zIndex, loopback, conditions.sarBuffer // ); // CopyAtr( zIndex, loopback, conditions.atrBuffer // ); // CopyAtrUpper( zIndex, loopback, conditions.atrUpperBuffer // ); // CopyAtrUpperRaw( zIndex, loopback, conditions.atrUpperRawBuffer // ); // CopyAtrLower( zIndex, loopback, conditions.atrLowerBuffer // ); // CopyAtrLowerRaw( zIndex, loopback, conditions.atrLowerRawBuffer // ); // CopyPeak( zIndex, loopback, conditions.peaksBuffer // ); // CopyVale( zIndex, loopback, conditions.valesBuffer // ); // CopyCHH( zIndex, loopback, conditions.cHHBuffer // ); // CopyCLL( zIndex, loopback, conditions.cLLBuffer // ); // CopySHH( zIndex, loopback, conditions.sHHBuffer // ); // CopySLL( zIndex, loopback, conditions.sLLBuffer // ); // CopyMHH( zIndex, loopback, conditions.mHHBuffer // ); // CopyMLL( zIndex, loopback, conditions.mLLBuffer // ); // CopyLHH( zIndex, loopback, conditions.lHHBuffer // ); // CopyLLL( zIndex, loopback, conditions.lLLBuffer // ); // CopyHHH( zIndex, loopback, conditions.hHHBuffer // ); // CopyHLL( zIndex, loopback, conditions.hLLBuffer // ); // CopyVWapFast( zIndex, loopback, conditions.vwapFastBuffer // ); // CopyVWapFastState( zIndex, loopback, conditions.vwapFastStateBuffer // ); // CopyVWapMid( zIndex, loopback, conditions.vwapMidBuffer // ); // CopyVWapMidState( zIndex, loopback, conditions.vwapMidStateBuffer // ); // CopyVWapSlow( zIndex, loopback, conditions.vwapSlowBuffer // ); // CopyVWapSlowState( zIndex, loopback, conditions.vwapSlowStateBuffer // ); // CopyVWapVolume( zIndex, loopback, conditions.vwapVolumeBuffer // ); // CopyVWapPrice( zIndex, loopback, conditions.vwapPriceBuffer // ); // CopyDonOpenUpper( zIndex, loopback, conditions.donOpenUpperBuffer // ); // CopyDonOpenLower( zIndex, loopback, conditions.donOpenLowerBuffer // ); // CopyDonCloseUpper( zIndex, loopback, conditions.donCloseUpperBuffer // ); // CopyDonCloseLower( zIndex, loopback, conditions.donCloseLowerBuffer // ); // CopyDonHighUpper( zIndex, loopback, conditions.donHighUpperBuffer // ); // CopyDonHighLower( zIndex, loopback, conditions.donHighLowerBuffer // ); // CopyDonLowUpper( zIndex, loopback, conditions.donLowUpperBuffer // ); // CopyDonLoweLower( zIndex, loopback, conditions.donLowLowerBuffer // ); // CopyFiboLevel1( zIndex, loopback, conditions.fl1Buffer // ); // CopyFiboLevel2( zIndex, loopback, conditions.fl2Buffer // ); // CopyFiboLevel3( zIndex, loopback, conditions.fl3Buffer // ); // CopyFiboLevel4( zIndex, loopback, conditions.fl4Buffer // ); // CopyFiboLevel5( zIndex, loopback, conditions.fl5Buffer // ); // // Conditions ... // int cIDX = 1; int pIDX = cIDX + 1; // // XSAR ... // bool isSarBullish = conditions.sarBuffer[cIDX] < cBar.low; bool isSarBullishPrev = conditions.sarBuffer[pIDX] < pBar.low; // bool isSarBearish = conditions.sarBuffer[cIDX] > cBar.high; bool isSarBearishPrev = conditions.sarBuffer[pIDX] > pBar.high; // bool isSarSwitchedToBullish = isSarBullish && !isSarBullishPrev; bool isSarSwitchedToBearish = isSarBearish && !isSarBearishPrev; // // XPV ... // bool isNewPeak = conditions.peaksBuffer[cIDX] != conditions.peaksBuffer[pIDX]; bool isNewPeakOverLast = isNewPeak && conditions.peaksBuffer[cIDX] > conditions.peaksBuffer[pIDX]; bool isNewPeakUnderLast = isNewPeak && conditions.peaksBuffer[cIDX] < conditions.peaksBuffer[pIDX]; // bool isNewVale = conditions.valesBuffer[cIDX] != conditions.valesBuffer[pIDX]; bool isNewValeOverLast = isNewVale && conditions.valesBuffer[cIDX] > conditions.valesBuffer[pIDX]; bool isNewValeUnderLast = isNewVale && conditions.valesBuffer[cIDX] < conditions.valesBuffer[pIDX]; // // XVWAP ... // bool isVWapFastBullish = IsVWAPBullish(conditions.vwapFastStateBuffer[cIDX]); bool isVWapFastBullishPrev = IsVWAPBullish(conditions.vwapFastStateBuffer[pIDX]); // bool isVWapFastBearish = IsVWAPBearish(conditions.vwapFastStateBuffer[cIDX]); bool isVWapFastBearishPrev = IsVWAPBearish(conditions.vwapFastStateBuffer[pIDX]); // bool isVWapFastNeutural = IsVWAPNeutural(conditions.vwapFastStateBuffer[cIDX]); bool isVWapFastNeuturalPrev = IsVWAPNeutural(conditions.vwapFastStateBuffer[pIDX]); // bool isVWapMidBullish = IsVWAPBullish(conditions.vwapMidStateBuffer[cIDX]); bool isVWapMidBullishPrev = IsVWAPBullish(conditions.vwapMidStateBuffer[pIDX]); // bool isVWapMidBearish = IsVWAPBearish(conditions.vwapMidStateBuffer[cIDX]); bool isVWapMidBearishPrev = IsVWAPBearish(conditions.vwapMidStateBuffer[pIDX]); // bool isVWapMidNeutural = IsVWAPNeutural(conditions.vwapMidStateBuffer[cIDX]); bool isVWapMidNeuturalPrev = IsVWAPNeutural(conditions.vwapMidStateBuffer[pIDX]); // bool isVWapSlowBullish = IsVWAPBullish(conditions.vwapSlowStateBuffer[cIDX]); bool isVWapSlowBullishPrev = IsVWAPBullish(conditions.vwapSlowStateBuffer[pIDX]); // bool isVWapSlowBearish = IsVWAPBearish(conditions.vwapSlowStateBuffer[cIDX]); bool isVWapSlowBearishPrev = IsVWAPBearish(conditions.vwapSlowStateBuffer[pIDX]); // bool isVWapSlowNeutural = IsVWAPNeutural(conditions.vwapSlowStateBuffer[cIDX]); bool isVWapSlowNeuturalPrev = IsVWAPNeutural(conditions.vwapSlowStateBuffer[pIDX]); // bool isVWapFastOverMid = conditions.vwapFastBuffer[cIDX] > conditions.vwapMidBuffer[cIDX]; bool isVWapFastOverMidPrev = conditions.vwapFastBuffer[pIDX] > conditions.vwapMidBuffer[pIDX]; // bool isVWapMidOverSlow = conditions.vwapMidBuffer[cIDX] > conditions.vwapSlowBuffer[cIDX]; bool isVWapMidOverSlowPrev = conditions.vwapMidBuffer[pIDX] > conditions.vwapSlowBuffer[pIDX]; // bool isVWapFastUnderMid = conditions.vwapFastBuffer[cIDX] < conditions.vwapMidBuffer[cIDX]; bool isVWapFastUnderMidPrev = conditions.vwapFastBuffer[pIDX] < conditions.vwapMidBuffer[pIDX]; // bool isVWapMidUnderSlow = conditions.vwapMidBuffer[cIDX] < conditions.vwapSlowBuffer[cIDX]; bool isVWapMidUnderSlowPrev = conditions.vwapMidBuffer[pIDX] < conditions.vwapSlowBuffer[pIDX]; // bool isVWapBullishState = isVWapFastBullish && isVWapMidBullish && isVWapSlowBullish; bool isVWapBullishStatePrev = isVWapFastBullishPrev && isVWapMidBullishPrev && isVWapSlowBullishPrev; // bool isVWapBearishState = isVWapFastBearish && isVWapMidBearish && isVWapSlowBearish; bool isVWapBearishStatePrev = isVWapFastBearishPrev && isVWapMidBearishPrev && isVWapSlowBearishPrev; // bool isVWapNeuturalState = isVWapFastNeutural && isVWapMidNeutural && isVWapSlowNeutural; bool isVWapNeuturalStatePrev = isVWapFastNeuturalPrev && isVWapMidNeuturalPrev && isVWapSlowNeuturalPrev; // bool isVWapBullishOrdered = isVWapFastOverMid && isVWapMidOverSlow; bool isVWapBullishOrderedPrev = isVWapFastOverMidPrev && isVWapMidOverSlowPrev; // bool isVWapBearishOrdered = isVWapFastUnderMid && isVWapMidUnderSlow; bool isVWapBearishOrderedPrev = isVWapFastUnderMidPrev && isVWapMidUnderSlowPrev; // bool isVWapSwitchedToBullishOrdered = isVWapBullishOrdered && !isVWapBullishOrderedPrev; bool isVWapSwitchedToBearishOrdered = isVWapBearishOrdered && !isVWapBearishOrderedPrev; // bool isVWapSwitchedToBullishState = isVWapBullishState && !isVWapBullishStatePrev; bool isVWapSwitchedToBearishState = isVWapBearishState && !isVWapBearishStatePrev; bool isVWapSwitchedToNeuturalState = isVWapNeuturalState && !isVWapNeuturalStatePrev; // // XDON ... // // XFIBONACCI ... // bool isOerFib1 = cBar.low > conditions.fl1Buffer[cIDX]; bool isOerFib2 = cBar.low > conditions.fl2Buffer[cIDX]; bool isOerFib3 = cBar.low > conditions.fl3Buffer[cIDX]; bool isOerFib4 = cBar.low > conditions.fl4Buffer[cIDX]; bool isOerFib5 = cBar.low > conditions.fl5Buffer[cIDX]; // bool isUnderFib1 = cBar.high < conditions.fl1Buffer[cIDX]; bool isUnderFib2 = cBar.high < conditions.fl2Buffer[cIDX]; bool isUnderFib3 = cBar.high < conditions.fl3Buffer[cIDX]; bool isUnderFib4 = cBar.high < conditions.fl4Buffer[cIDX]; bool isUnderFib5 = cBar.high < conditions.fl5Buffer[cIDX]; // bool isCloseOerFib1 = cBar.close > conditions.fl1Buffer[cIDX]; bool isCloseOerFib2 = cBar.close > conditions.fl2Buffer[cIDX]; bool isCloseOerFib3 = cBar.close > conditions.fl3Buffer[cIDX]; bool isCloseOerFib4 = cBar.close > conditions.fl4Buffer[cIDX]; bool isCloseOerFib5 = cBar.close > conditions.fl5Buffer[cIDX]; // bool isCloseUnderFib1 = cBar.close < conditions.fl1Buffer[cIDX]; bool isCloseUnderFib2 = cBar.close < conditions.fl2Buffer[cIDX]; bool isCloseUnderFib3 = cBar.close < conditions.fl3Buffer[cIDX]; bool isCloseUnderFib4 = cBar.close < conditions.fl4Buffer[cIDX]; bool isCloseUnderFib5 = cBar.close < conditions.fl5Buffer[cIDX]; // // // Set ... conditions.isSarBullish = isSarBullish; conditions.isSarBearish = isSarBearish; conditions.isSarSwitchedToBullish = isSarSwitchedToBullish; conditions.isSarSwitchedToBearish = isSarSwitchedToBearish; conditions.isNewPeak = isNewPeak; conditions.isNewPeakOverLast = isNewPeakOverLast; conditions.isNewPeakUnderLast = isNewPeakUnderLast; conditions.isNewVale = isNewVale; conditions.isNewValeOverLast = isNewValeOverLast; conditions.isNewValeUnderLast = isNewValeUnderLast; conditions.isVWapFastBullish = isVWapFastBullish; conditions.isVWapFastBearish = isVWapFastBearish; conditions.isVWapFastNeutural = isVWapFastNeutural; conditions.isVWapMidBullish = isVWapMidBullish; conditions.isVWapMidBearish = isVWapMidBearish; conditions.isVWapMidNeutural = isVWapMidNeutural; conditions.isVWapSlowBullish = isVWapSlowBullish; conditions.isVWapSlowBearish = isVWapSlowBearish; conditions.isVWapSlowNeutural = isVWapSlowNeutural; conditions.isVWapFastOverMid = isVWapFastOverMid; conditions.isVWapMidOverSlow = isVWapMidOverSlow; conditions.isVWapFastUnderMid = isVWapFastUnderMid; conditions.isVWapMidUnderSlow = isVWapMidUnderSlow; conditions.isVWapBullishState = isVWapBullishState; conditions.isVWapBearishState = isVWapBearishState; conditions.isVWapNeuturalState = isVWapNeuturalState; conditions.isVWapBullishOrdered = isVWapBullishOrdered; conditions.isVWapBearishOrdered = isVWapBearishOrdered; conditions.isVWapSwitchedToBullishOrdered = isVWapSwitchedToBullishOrdered; conditions.isVWapSwitchedToBearishOrdered = isVWapSwitchedToBearishOrdered; conditions.isVWapSwitchedToBullishState = isVWapSwitchedToBullishState; conditions.isVWapSwitchedToBearishState = isVWapSwitchedToBearishState; conditions.isVWapSwitchedToNeuturalState = isVWapSwitchedToNeuturalState; conditions.isOerFib1 = isOerFib1; conditions.isOerFib2 = isOerFib2; conditions.isOerFib3 = isOerFib3; conditions.isOerFib4 = isOerFib4; conditions.isOerFib5 = isOerFib5; conditions.isUnderFib1 = isUnderFib1; conditions.isUnderFib2 = isUnderFib2; conditions.isUnderFib3 = isUnderFib3; conditions.isUnderFib4 = isUnderFib4; conditions.isUnderFib5 = isUnderFib5; conditions.isCloseOerFib1 = isCloseOerFib1; conditions.isCloseOerFib2 = isCloseOerFib2; conditions.isCloseOerFib3 = isCloseOerFib3; conditions.isCloseOerFib4 = isCloseOerFib4; conditions.isCloseOerFib5 = isCloseOerFib5; conditions.isCloseUnderFib1 = isCloseUnderFib1; conditions.isCloseUnderFib2 = isCloseUnderFib2; conditions.isCloseUnderFib3 = isCloseUnderFib3; conditions.isCloseUnderFib4 = isCloseUnderFib4; conditions.isCloseUnderFib5 = isCloseUnderFib5; // return result; } // protected: // // private: // // Props ... X121Inputs mInputs; // Inputs ... // // Buffers ... // // Buffers ... double peaksBuffer[]; double valesBuffer[]; double sarBuffer[]; double atrUpperBuffer[]; double atrLowerBuffer[]; double vwapFastBuffer[]; double vwapMidBuffer[]; double vwapSlowBuffer[]; double donOpenUpperBuffer[]; double donOpenLowerBuffer[]; double donCloseUpperBuffer[]; double donCloseLowerBuffer[]; double donHighUpperBuffer[]; double donHighLowerBuffer[]; double donLowUpperBuffer[]; double donLowLowerBuffer[]; double fl1Buffer[]; double fl2Buffer[]; double fl3Buffer[]; double fl4Buffer[]; double fl5Buffer[]; double cHHBuffer[]; double cLLBuffer[]; double sHHBuffer[]; double sLLBuffer[]; double mHHBuffer[]; double mLLBuffer[]; double lHHBuffer[]; double lLLBuffer[]; double hHHBuffer[]; double hLLBuffer[]; double atrBuffer[]; double atrUpperRawBuffer[]; double atrLowerRawBuffer[]; double vwapVolumeBuffer[]; double vwapPriceBuffer[]; double vwapFastStateBuffer[]; double vwapMidStateBuffer[]; double vwapSlowStateBuffer[]; double validPeaksBuffer[]; double validValesBuffer[]; // // Tools ... /** * Calculate Buffers ... */ void Calculate() { // int totalBars = CountBars(); if (totalBars > 1000) { totalBars = 1000; } // // Buffers ... // // XSAR ... CopyBuffer( mHandler, X121_SAR_LINE, 0, totalBars, sarBuffer // ); // // ATR ... // CopyBuffer( mHandler, X121_ATR_UPPER_LINE, 0, totalBars, atrUpperBuffer // ); // CopyBuffer( mHandler, X121_ATR_LOWER_LINE, 0, totalBars, atrLowerBuffer // ); // CopyBuffer( mHandler, X121_ATR_LINE, 0, totalBars, atrBuffer // ); // CopyBuffer( mHandler, X121_ATR_UPPER_RAW_LINE, 0, totalBars, atrUpperRawBuffer // ); // CopyBuffer( mHandler, X121_ATR_LOWER_RAW_LINE, 0, totalBars, atrLowerRawBuffer // ); // // XPV ... // // PEAKS ... CopyBuffer( mHandler, X121_PEAKS_LINE, 0, totalBars, peaksBuffer // ); // // VALES ... CopyBuffer( mHandler, X121_VALES_LINE, 0, totalBars, valesBuffer // ); // // CURRENT ... // // HH ... CopyBuffer( mHandler, X121_CURRENT_HH_LINE, 0, totalBars, cHHBuffer // ); // // LL ... CopyBuffer( mHandler, X121_CURRENT_LL_LINE, 0, totalBars, cLLBuffer // ); // // SHORT ... // // HH ... CopyBuffer( mHandler, X121_SHORT_HH_LINE, 0, totalBars, sHHBuffer // ); // // LL ... CopyBuffer( mHandler, X121_SHORT_LL_LINE, 0, totalBars, sLLBuffer // ); // // MEDIUM ... // // HH ... CopyBuffer( mHandler, X121_MEDIUM_HH_LINE, 0, totalBars, mHHBuffer // ); // // LL ... CopyBuffer( mHandler, X121_MEDIUM_LL_LINE, 0, totalBars, mLLBuffer // ); // // LONG ... // // HH ... CopyBuffer( mHandler, X121_LONG_HH_LINE, 0, totalBars, lHHBuffer // ); // // LL ... CopyBuffer( mHandler, X121_LONG_LL_LINE, 0, totalBars, lLLBuffer // ); // // HIND ... // // HH ... CopyBuffer( mHandler, X121_HIND_HH_LINE, 0, totalBars, hHHBuffer // ); // // LL ... CopyBuffer( mHandler, X121_HIND_LL_LINE, 0, totalBars, hLLBuffer // ); // // XVWAP ... // // FAST ... CopyBuffer( mHandler, X121_VWAP_FAST_LINE, 0, totalBars, vwapFastBuffer // ); // // FAST STATE ... CopyBuffer( mHandler, X121_VWAP_FAST_STATE_LINE, 0, totalBars, vwapFastStateBuffer // ); // // MID ... CopyBuffer( mHandler, X121_VWAP_MID_LINE, 0, totalBars, vwapMidBuffer // ); // // MID STATE ... CopyBuffer( mHandler, X121_VWAP_MID_STATE_LINE, 0, totalBars, vwapMidStateBuffer // ); // // SLOW ... CopyBuffer( mHandler, X121_VWAP_SLOW_LINE, 0, totalBars, vwapSlowBuffer // ); // // SLOW STATE ... CopyBuffer( mHandler, X121_VWAP_SLOW_STATE_LINE, 0, totalBars, vwapSlowStateBuffer // ); // // VOLUME ... CopyBuffer( mHandler, X121_VWAP_VOLUME_LINE, 0, totalBars, vwapVolumeBuffer // ); // // PRICE ... CopyBuffer( mHandler, X121_VWAP_PRICE_LINE, 0, totalBars, vwapPriceBuffer // ); // // FIBONACCI ... // // LEVEL 1 ... CopyBuffer( mHandler, X121_FIB_LEVEL_1_LINE, 0, totalBars, fl1Buffer // ); // // LEVEL 2 ... CopyBuffer( mHandler, X121_FIB_LEVEL_2_LINE, 0, totalBars, fl2Buffer // ); // // LEVEL 3 ... CopyBuffer( mHandler, X121_FIB_LEVEL_3_LINE, 0, totalBars, fl3Buffer // ); // // LEVEL 4 ... CopyBuffer( mHandler, X121_FIB_LEVEL_4_LINE, 0, totalBars, fl4Buffer // ); // // LEVEL 5 ... CopyBuffer( mHandler, X121_FIB_LEVEL_5_LINE, 0, totalBars, fl5Buffer // ); // // XDON ... // // OPEN ... // // Upper ... CopyBuffer( mHandler, X121_DON_OPEN_UPPER_LINE, 0, totalBars, donOpenUpperBuffer // ); // // Lower ... CopyBuffer( mHandler, X121_DON_OPEN_LOWER_LINE, 0, totalBars, donOpenLowerBuffer // ); // // CLOSE ... // // Upper ... CopyBuffer( mHandler, X121_DON_CLOSE_UPPER_LINE, 0, totalBars, donCloseUpperBuffer // ); // // Lower ... CopyBuffer( mHandler, X121_DON_CLOSE_LOWER_LINE, 0, totalBars, donCloseLowerBuffer // ); // // HIGH ... // // Upper ... CopyBuffer( mHandler, X121_DON_HIGH_UPPER_LINE, 0, totalBars, donHighUpperBuffer // ); // // Lower ... CopyBuffer( mHandler, X121_DON_HIGH_LOWER_LINE, 0, totalBars, donHighLowerBuffer // ); // // LOW ... // // Upper ... CopyBuffer( mHandler, X121_DON_LOW_UPPER_LINE, 0, totalBars, donLowUpperBuffer // ); // // Lower ... CopyBuffer( mHandler, X121_DON_LOW_LOWER_LINE, 0, totalBars, donLowLowerBuffer // ); } }; //