From 09886d76ae19913c30fb0cc8c5ac13486bf94b67 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 24 Oct 2023 01:18:46 +0100 Subject: [PATCH 1/4] Renames Shift to Timeframe --- .github/workflows/backtest.yml | 6 +++--- .github/workflows/compile.yml | 4 ++-- README.md | 14 +++++++------- ...Shift.mq4 => Stg_Oscillator_Cross_Timeframe.mq4 | 2 +- ...Shift.mq5 => Stg_Oscillator_Cross_Timeframe.mq5 | 2 +- ...Shift.mqh => Stg_Oscillator_Cross_Timeframe.mqh | 0 6 files changed, 14 insertions(+), 14 deletions(-) rename Stg_Oscillator_Cross_Shift.mq4 => Stg_Oscillator_Cross_Timeframe.mq4 (90%) rename Stg_Oscillator_Cross_Shift.mq5 => Stg_Oscillator_Cross_Timeframe.mq5 (98%) rename Stg_Oscillator_Cross_Shift.mqh => Stg_Oscillator_Cross_Timeframe.mqh (100%) diff --git a/.github/workflows/backtest.yml b/.github/workflows/backtest.yml index bb9eb86..8cd7ba3 100644 --- a/.github/workflows/backtest.yml +++ b/.github/workflows/backtest.yml @@ -37,14 +37,14 @@ jobs: include: . init-platform: true mt-version: 5.0.0.2361 - path: Stg_Oscillator_Cross_Shift.mq4 + path: Stg_Oscillator_Cross_Timeframe.mq4 verbose: true - name: Compile for MQL5 uses: fx31337/mql-compile-action@master with: include: . mt-version: 5.0.0.2515 - path: Stg_Oscillator_Cross_Shift.mq5 + path: Stg_Oscillator_Cross_Timeframe.mq5 verbose: true - name: List compiled files run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' @@ -75,7 +75,7 @@ jobs: OptFormatBrief: true OptFormatJson: true OptVerbose: true - TestExpert: "Stg_Oscillator_Cross_Shift" + TestExpert: "Stg_Oscillator_Cross_Timeframe" TestPeriod: M1 TestReportName: Report-${{ matrix.year }}-${{ matrix.month }} - name: Upload results diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 026f73c..2582633 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -39,14 +39,14 @@ jobs: include: . init-platform: true mt-version: 5.0.0.2361 - path: Stg_Oscillator_Cross_Shift.mq4 + path: Stg_Oscillator_Cross_Timeframe.mq4 verbose: true - name: Compile for MQL5 uses: fx31337/mql-compile-action@master with: include: . mt-version: 5.0.0.2515 - path: Stg_Oscillator_Cross_Shift.mq5 + path: Stg_Oscillator_Cross_Timeframe.mq5 verbose: true - name: List compiled files run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' diff --git a/README.md b/README.md index db709bc..965cc6a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Strategy Oscillator Cross Shift +# Strategy Oscillator Cross Timeframe [![Status][gha-image-check-master]][gha-link-check-master] [![Status][gha-image-compile-master]][gha-link-compile-master] @@ -10,7 +10,7 @@ ## Description -Strategy based on selected oscillator-type indicators with shift crossable logic. +Strategy based on selected oscillator-type indicators with timeframe crossable signals. ## Dependencies @@ -25,12 +25,12 @@ Strategy based on selected oscillator-type indicators with shift crossable logic [gh-discuss-link]: https://github.com/EA31337/EA31337-Strategies/discussions [gh-edit-badge]: https://img.shields.io/badge/GitHub-edit-purple.svg?logo=github -[gh-edit-link]: https://github.dev/EA31337/Strategy-Oscillator_Cross_Shift +[gh-edit-link]: https://github.dev/EA31337/Strategy-Oscillator_Cross_Timeframe -[gha-link-check-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Shift/actions?query=workflow:Check+branch%3Amaster -[gha-image-check-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Shift/workflows/Check/badge.svg?branch=master -[gha-link-compile-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Shift/actions?query=workflow:Compile+branch%3Amaster -[gha-image-compile-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Shift/workflows/Compile/badge.svg?branch=master +[gha-link-check-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Timeframe/actions?query=workflow:Check+branch%3Amaster +[gha-image-check-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Timeframe/workflows/Check/badge.svg?branch=master +[gha-link-compile-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Timeframe/actions?query=workflow:Compile+branch%3Amaster +[gha-image-compile-master]: https://github.com/EA31337/Strategy-Oscillator_Cross_Timeframe/workflows/Compile/badge.svg?branch=master [license-image]: https://img.shields.io/github/license/EA31337/EA31337-Strategies.svg [license-link]: https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3) diff --git a/Stg_Oscillator_Cross_Shift.mq4 b/Stg_Oscillator_Cross_Timeframe.mq4 similarity index 90% rename from Stg_Oscillator_Cross_Shift.mq4 rename to Stg_Oscillator_Cross_Timeframe.mq4 index cc72a4c..5ddea0e 100644 --- a/Stg_Oscillator_Cross_Shift.mq4 +++ b/Stg_Oscillator_Cross_Timeframe.mq4 @@ -10,4 +10,4 @@ */ // Includes the main code. -#include "Stg_Oscillator_Cross_Shift.mq5" +#include "Stg_Oscillator_Cross_Timeframe.mq5" diff --git a/Stg_Oscillator_Cross_Shift.mq5 b/Stg_Oscillator_Cross_Timeframe.mq5 similarity index 98% rename from Stg_Oscillator_Cross_Shift.mq5 rename to Stg_Oscillator_Cross_Timeframe.mq5 index f5f3070..6ebc3dc 100644 --- a/Stg_Oscillator_Cross_Shift.mq5 +++ b/Stg_Oscillator_Cross_Timeframe.mq5 @@ -47,7 +47,7 @@ input ENUM_LOG_LEVEL Log_Level = V_INFO; // Log level. input bool Info_On_Chart = true; // Display info on chart. // Includes strategy. -#include "Stg_Oscillator_Cross_Shift.mqh" +#include "Stg_Oscillator_Cross_Timeframe.mqh" // Defines. #define ea_name "Strategy Oscillator Cross Shift" diff --git a/Stg_Oscillator_Cross_Shift.mqh b/Stg_Oscillator_Cross_Timeframe.mqh similarity index 100% rename from Stg_Oscillator_Cross_Shift.mqh rename to Stg_Oscillator_Cross_Timeframe.mqh From b27f5a74900f0726f5b79ca0618765ad4f9b9ae0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 24 Oct 2023 01:22:28 +0100 Subject: [PATCH 2/4] Replaces Shift with Timeframe --- Stg_Oscillator_Cross_Timeframe.mq4 | 2 +- Stg_Oscillator_Cross_Timeframe.mq5 | 8 +- Stg_Oscillator_Cross_Timeframe.mqh | 1068 ++++++++++++++-------------- 3 files changed, 542 insertions(+), 536 deletions(-) diff --git a/Stg_Oscillator_Cross_Timeframe.mq4 b/Stg_Oscillator_Cross_Timeframe.mq4 index 5ddea0e..6f96af1 100644 --- a/Stg_Oscillator_Cross_Timeframe.mq4 +++ b/Stg_Oscillator_Cross_Timeframe.mq4 @@ -6,7 +6,7 @@ /** * @file - * Implements Oscillator Cross Shift strategy. + * Implements Oscillator Cross Timeframe strategy. */ // Includes the main code. diff --git a/Stg_Oscillator_Cross_Timeframe.mq5 b/Stg_Oscillator_Cross_Timeframe.mq5 index 6ebc3dc..03c4c5c 100644 --- a/Stg_Oscillator_Cross_Timeframe.mq5 +++ b/Stg_Oscillator_Cross_Timeframe.mq5 @@ -1,6 +1,6 @@ /** * @file - * Implements Oscillator Cross Shift strategy. + * Implements Oscillator Cross Timeframe strategy. */ // Includes conditional compilation directives. @@ -50,10 +50,10 @@ input bool Info_On_Chart = true; // Display info on chart. #include "Stg_Oscillator_Cross_Timeframe.mqh" // Defines. -#define ea_name "Strategy Oscillator Cross Shift" +#define ea_name "Strategy Oscillator Cross Timeframe" #define ea_version "2.000" #define ea_desc "Strategy based on selected oscillator-type indicators with shift crossable logic." -#define ea_link "https://github.com/EA31337/Strategy-Oscillator_Cross_Shift" +#define ea_link "https://github.com/EA31337/Strategy-Oscillator_Cross_Timeframe" #define ea_author "EA31337 Ltd" // Properties. @@ -79,7 +79,7 @@ int OnInit() { bool _result = true; EAParams ea_params(__FILE__, Log_Level); ea = new EA(ea_params); - _result &= ea.StrategyAdd(Active_Tfs); + _result &= ea.StrategyAdd(Active_Tfs); return (_result ? INIT_SUCCEEDED : INIT_FAILED); } diff --git a/Stg_Oscillator_Cross_Timeframe.mqh b/Stg_Oscillator_Cross_Timeframe.mqh index ad11a4d..4a22630 100644 --- a/Stg_Oscillator_Cross_Timeframe.mqh +++ b/Stg_Oscillator_Cross_Timeframe.mqh @@ -1,256 +1,258 @@ /** * @file - * Implements Oscillator Cross Shift strategy. + * Implements Oscillator Cross Timeframe strategy. */ // Enums. -enum ENUM_STG_OSCILLATOR_CROSS_SHIFT_TYPE { - STG_OSCILLATOR_CROSS_SHIFT_TYPE_0_NONE = 0, // (None) - STG_OSCILLATOR_SHIFT_TYPE_AC, // AC: Accelerator/Decelerator - STG_OSCILLATOR_SHIFT_TYPE_AD, // AD: Accumulation/Distribution - STG_OSCILLATOR_SHIFT_TYPE_AO, // AO: Awesome - STG_OSCILLATOR_SHIFT_TYPE_ATR, // ATR - STG_OSCILLATOR_SHIFT_TYPE_BEARS, // Bears Power - STG_OSCILLATOR_SHIFT_TYPE_BULLS, // Bulls Power - STG_OSCILLATOR_SHIFT_TYPE_BWMFI, // BWMFI - STG_OSCILLATOR_SHIFT_TYPE_CCI, // CCI - STG_OSCILLATOR_SHIFT_TYPE_CHO, // CHO: Chaikin - STG_OSCILLATOR_SHIFT_TYPE_CHV, // CHV: Chaikin Volatility - STG_OSCILLATOR_SHIFT_TYPE_DEMARKER, // DeMarker - STG_OSCILLATOR_SHIFT_TYPE_MFI, // MFI - STG_OSCILLATOR_SHIFT_TYPE_MOM, // MOM: Momentum - STG_OSCILLATOR_SHIFT_TYPE_OBV, // OBV: On Balance Volume - STG_OSCILLATOR_SHIFT_TYPE_PVT, // PVT: Price and Volume Trend - STG_OSCILLATOR_SHIFT_TYPE_ROC, // ROC: Rate of Change - STG_OSCILLATOR_SHIFT_TYPE_RSI, // RSI - STG_OSCILLATOR_SHIFT_TYPE_STDDEV, // StdDev: Standard Deviation - STG_OSCILLATOR_SHIFT_TYPE_STOCH, // Stochastic - STG_OSCILLATOR_SHIFT_TYPE_TRIX, // TRIX: Triple Exponential Average - STG_OSCILLATOR_SHIFT_TYPE_UO, // UO: Ultimate Oscillator - STG_OSCILLATOR_SHIFT_TYPE_WAD, // WAD: Larry Williams' Accumulation/Distribution - STG_OSCILLATOR_SHIFT_TYPE_WPR, // WPR - STG_OSCILLATOR_SHIFT_TYPE_VOL, // VOL: Volumes - // STG_OSCILLATOR_CROSS_SHIFT_TYPE_ADX, // ADX - // STG_OSCILLATOR_CROSS_SHIFT_TYPE_ADXW, // ADXW - // STG_OSCILLATOR_CROSS_SHIFT_TYPE_MACD, // MACD - // STG_OSCILLATOR_CROSS_SHIFT_TYPE_RVI, // RVI: Relative Vigor Index +enum ENUM_STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE { + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_0_NONE = 0, // (None) + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AC, // AC: Accelerator/Decelerator + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD, // AD: Accumulation/Distribution + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AO, // AO: Awesome + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ATR, // ATR + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BEARS, // Bears Power + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BULLS, // Bulls Power + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BWMFI, // BWMFI + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CCI, // CCI + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHO, // CHO: Chaikin + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHV, // CHV: Chaikin Volatility + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_DEMARKER, // DeMarker + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MFI, // MFI + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MOM, // MOM: Momentum + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_OBV, // OBV: On Balance Volume + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_PVT, // PVT: Price and Volume Trend + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ROC, // ROC: Rate of Change + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_RSI, // RSI + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STDDEV, // StdDev: Standard Deviation + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STOCH, // Stochastic + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_TRIX, // TRIX: Triple Exponential Average + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_UO, // UO: Ultimate Oscillator + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WAD, // WAD: Larry Williams' Accumulation/Distribution + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WPR, // WPR + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_VOL, // VOL: Volumes + // STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ADX, // ADX + // STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ADXW, // ADXW + // STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MACD, // MACD + // STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_RVI, // RVI: Relative Vigor Index }; // User input params. -INPUT_GROUP("Oscillator Cross Shift strategy: main strategy params"); -INPUT ENUM_STG_OSCILLATOR_CROSS_SHIFT_TYPE Oscillator_Cross_Shift_Type = - STG_OSCILLATOR_SHIFT_TYPE_AD; // Oscillator type -INPUT_GROUP("Oscillator Cross Shift strategy: strategy params"); -INPUT float Oscillator_Cross_Shift_LotSize = 0; // Lot size -INPUT int Oscillator_Cross_Shift_SignalOpenMethod = 6; // Signal open method -INPUT float Oscillator_Cross_Shift_SignalOpenLevel = 5.0f; // Signal open level -INPUT int Oscillator_Cross_Shift_SignalOpenFilterMethod = 32; // Signal open filter method -INPUT int Oscillator_Cross_Shift_SignalOpenFilterTime = 3; // Signal open filter time (0-31) -INPUT int Oscillator_Cross_Shift_SignalOpenBoostMethod = 0; // Signal open boost method -INPUT int Oscillator_Cross_Shift_SignalCloseMethod = 0; // Signal close method -INPUT int Oscillator_Cross_Shift_SignalCloseFilter = 32; // Signal close filter (-127-127) -INPUT float Oscillator_Cross_Shift_SignalCloseLevel = 5.0f; // Signal close level -INPUT int Oscillator_Cross_Shift_PriceStopMethod = 0; // Price limit method -INPUT float Oscillator_Cross_Shift_PriceStopLevel = 2; // Price limit level -INPUT int Oscillator_Cross_Shift_TickFilterMethod = 32; // Tick filter method (0-255) -INPUT float Oscillator_Cross_Shift_MaxSpread = 4.0; // Max spread to trade (in pips) -INPUT short Oscillator_Cross_Shift_Shift = 0; // Shift -INPUT float Oscillator_Cross_Shift_OrderCloseLoss = 80; // Order close loss -INPUT float Oscillator_Cross_Shift_OrderCloseProfit = 80; // Order close profit -INPUT int Oscillator_Cross_Shift_OrderCloseTime = -30; // Order close time in mins (>0) or bars (<0) +INPUT_GROUP("Oscillator Cross Timeframe strategy: main strategy params"); +INPUT ENUM_STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE Oscillator_Cross_Timeframe_Type = + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD; // Oscillator type +INPUT_GROUP("Oscillator Cross Timeframe strategy: strategy params"); +INPUT float Oscillator_Cross_Timeframe_LotSize = 0; // Lot size +INPUT int Oscillator_Cross_Timeframe_SignalOpenMethod = 6; // Signal open method +INPUT float Oscillator_Cross_Timeframe_SignalOpenLevel = 5.0f; // Signal open level +INPUT int Oscillator_Cross_Timeframe_SignalOpenFilterMethod = 32; // Signal open filter method +INPUT int Oscillator_Cross_Timeframe_SignalOpenFilterTime = 3; // Signal open filter time (0-31) +INPUT int Oscillator_Cross_Timeframe_SignalOpenBoostMethod = 0; // Signal open boost method +INPUT int Oscillator_Cross_Timeframe_SignalCloseMethod = 0; // Signal close method +INPUT int Oscillator_Cross_Timeframe_SignalCloseFilter = 32; // Signal close filter (-127-127) +INPUT float Oscillator_Cross_Timeframe_SignalCloseLevel = 5.0f; // Signal close level +INPUT int Oscillator_Cross_Timeframe_PriceStopMethod = 0; // Price limit method +INPUT float Oscillator_Cross_Timeframe_PriceStopLevel = 2; // Price limit level +INPUT int Oscillator_Cross_Timeframe_TickFilterMethod = 32; // Tick filter method (0-255) +INPUT float Oscillator_Cross_Timeframe_MaxSpread = 4.0; // Max spread to trade (in pips) +INPUT short Oscillator_Cross_Timeframe_Shift = 0; // Shift +INPUT float Oscillator_Cross_Timeframe_OrderCloseLoss = 80; // Order close loss +INPUT float Oscillator_Cross_Timeframe_OrderCloseProfit = 80; // Order close profit +INPUT int Oscillator_Cross_Timeframe_OrderCloseTime = -30; // Order close time in mins (>0) or bars (<0) -INPUT_GROUP("Oscillator strategy: AC oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_AC_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_AC_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_AC_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: AD oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_AD_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_AD_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_AD_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: ATR oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_ATR_Period = 13; // Period -INPUT int Oscillator_Cross_Shift_Indi_ATR_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_ATR_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_ATR_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Awesome oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_Awesome_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_Awesome_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_Awesome_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: BearsPower oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_BearsPower_Period = 30; // Period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_BearsPower_Applied_Price = PRICE_CLOSE; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_BearsPower_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_BearsPower_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_BearsPower_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: BullsPower oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_BullsPower_Period = 30; // Period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_BullsPower_Applied_Price = PRICE_CLOSE; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_BullsPower_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_BullsPower_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_BullsPower_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: BWMFI oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_BWMFI_Shift = 1; // Shift -INPUT int Oscillator_Cross_Shift_Indi_BWMFI_Shift2 = 1; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_BWMFI_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: CCI oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_CCI_Period = 20; // Period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_CCI_Applied_Price = PRICE_TYPICAL; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_CCI_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_CCI_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_CCI_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Chaikin oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_CHO_InpFastMA = 10; // Fast EMA period -INPUT int Oscillator_Cross_Shift_Indi_CHO_InpSlowMA = 30; // Slow MA period -INPUT ENUM_MA_METHOD Oscillator_Cross_Shift_Indi_CHO_InpSmoothMethod = MODE_SMMA; // MA method -INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Shift_Indi_CHO_InpVolumeType = VOLUME_TICK; // Volumes -INPUT int Oscillator_Cross_Shift_Indi_CHO_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_CHO_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_CHO_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Chaikin Volatility oscillator params"); -INPUT unsigned int Oscillator_Cross_Shift_Indi_CHV_Smooth_Period; // Smooth period -INPUT unsigned int Oscillator_Cross_Shift_Indi_CHV_Period; // Period -INPUT ENUM_CHV_SMOOTH_METHOD Oscillator_Cross_Shift_Indi_CHV_Smooth_Method; // Smooth method -INPUT int Oscillator_Cross_Shift_Indi_CHV_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_CHV_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_CHV_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: DeMarker indicator params"); -INPUT int Oscillator_Cross_Shift_Indi_DeMarker_Period = 23; // Period -INPUT int Oscillator_Cross_Shift_Indi_DeMarker_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_DeMarker_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_DeMarker_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: MFI oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_MFI_MA_Period = 22; // MA Period -INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Shift_Indi_MFI_Applied_Volume = (ENUM_APPLIED_VOLUME)0; // Applied volume. -INPUT int Oscillator_Cross_Shift_Indi_MFI_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_MFI_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_MFI_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Momentum oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_Momentum_Period = 12; // Averaging period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_Momentum_Applied_Price = PRICE_CLOSE; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_Momentum_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_Momentum_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_Momentum_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: OBV oscillator params"); -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_OBV_Applied_Price = PRICE_CLOSE; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_OBV_Shift = 1; // Shift -INPUT int Oscillator_Cross_Shift_Indi_OBV_Shift2 = 1; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_OBV_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: PVT oscillator params"); -INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Shift_Indi_PVT_InpVolumeType = VOLUME_TICK; // Volumes -INPUT int Oscillator_Cross_Shift_Indi_PVT_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_PVT_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_PVT_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: ROC oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_ROC_Period = 16; // Period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_ROC_Applied_Price = PRICE_WEIGHTED; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_ROC_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_ROC_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_ROC_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: RSI oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_RSI_Period = 16; // Period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_RSI_Applied_Price = PRICE_WEIGHTED; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_RSI_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_RSI_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_RSI_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: StdDev oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_StdDev_MA_Period = 24; // Period -INPUT int Oscillator_Cross_Shift_Indi_StdDev_MA_Shift = 0; // MA Shift -INPUT ENUM_MA_METHOD Oscillator_Cross_Shift_Indi_StdDev_MA_Method = (ENUM_MA_METHOD)3; // MA Method -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_StdDev_Applied_Price = PRICE_WEIGHTED; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_StdDev_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_StdDev_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_StdDev_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Stochastic oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_Stochastic_KPeriod = 8; // K line period -INPUT int Oscillator_Cross_Shift_Indi_Stochastic_DPeriod = 12; // D line period -INPUT int Oscillator_Cross_Shift_Indi_Stochastic_Slowing = 12; // Slowing -INPUT ENUM_MA_METHOD Oscillator_Cross_Shift_Indi_Stochastic_MA_Method = MODE_EMA; // Moving Average method -INPUT ENUM_STO_PRICE Oscillator_Cross_Shift_Indi_Stochastic_Price_Field = 0; // Price (0 - Low/High or 1 - Close/Close) -INPUT int Oscillator_Cross_Shift_Indi_Stochastic_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_Stochastic_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_Stochastic_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: TRIX oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_TRIX_InpPeriodEMA = 14; // EMA period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_TRIX_Applied_Price = PRICE_WEIGHTED; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_TRIX_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_TRIX_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_TRIX_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Ultimate oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_UO_InpFastPeriod = 7; // Fast ATR period -INPUT int Oscillator_Cross_Shift_Indi_UO_InpMiddlePeriod = 14; // Middle ATR period -INPUT int Oscillator_Cross_Shift_Indi_UO_InpSlowPeriod = 28; // Slow ATR period -INPUT int Oscillator_Cross_Shift_Indi_UO_InpFastK = 4; // Fast K -INPUT int Oscillator_Cross_Shift_Indi_UO_InpMiddleK = 2; // Middle K -INPUT int Oscillator_Cross_Shift_Indi_UO_InpSlowK = 1; // Slow K -INPUT int Oscillator_Cross_Shift_Indi_UO_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_UO_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_UO_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Williams' Accumulation/Distribution oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_WAD_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_WAD_Shift2 = 0; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_WAD_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: WPR oscillator params"); -INPUT int Oscillator_Cross_Shift_Indi_WPR_Period = 18; // Period -INPUT int Oscillator_Cross_Shift_Indi_WPR_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_WPR_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_WPR_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: Volumes oscillator params"); -INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Shift_Indi_VOL_InpVolumeType = VOLUME_TICK; // Volumes -INPUT int Oscillator_Cross_Shift_Indi_VOL_Shift = 0; // Shift -INPUT int Oscillator_Cross_Shift_Indi_VOL_Shift2 = 10; // Shift 2 -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_VOL_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: AC oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_AC_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_AC_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_AC_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: AD oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_AD_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_AD_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_AD_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: ATR oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_ATR_Period = 13; // Period +INPUT int Oscillator_Cross_Timeframe_Indi_ATR_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_ATR_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_ATR_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Awesome oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_Awesome_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_Awesome_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_Awesome_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: BearsPower oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_BearsPower_Period = 30; // Period +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_BearsPower_Applied_Price = PRICE_CLOSE; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_BearsPower_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_BearsPower_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_BearsPower_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: BullsPower oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_BullsPower_Period = 30; // Period +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_BullsPower_Applied_Price = PRICE_CLOSE; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_BullsPower_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_BullsPower_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_BullsPower_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: BWMFI oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_BWMFI_Shift = 1; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_BWMFI_Shift2 = 1; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_BWMFI_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: CCI oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_CCI_Period = 20; // Period +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_CCI_Applied_Price = PRICE_TYPICAL; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_CCI_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_CCI_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_CCI_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Chaikin oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_CHO_InpFastMA = 10; // Fast EMA period +INPUT int Oscillator_Cross_Timeframe_Indi_CHO_InpSlowMA = 30; // Slow MA period +INPUT ENUM_MA_METHOD Oscillator_Cross_Timeframe_Indi_CHO_InpSmoothMethod = MODE_SMMA; // MA method +INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_CHO_InpVolumeType = VOLUME_TICK; // Volumes +INPUT int Oscillator_Cross_Timeframe_Indi_CHO_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_CHO_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_CHO_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Chaikin Volatility oscillator params"); +INPUT unsigned int Oscillator_Cross_Timeframe_Indi_CHV_Smooth_Period; // Smooth period +INPUT unsigned int Oscillator_Cross_Timeframe_Indi_CHV_Period; // Period +INPUT ENUM_CHV_SMOOTH_METHOD Oscillator_Cross_Timeframe_Indi_CHV_Smooth_Method; // Smooth method +INPUT int Oscillator_Cross_Timeframe_Indi_CHV_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_CHV_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_CHV_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: DeMarker indicator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_DeMarker_Period = 23; // Period +INPUT int Oscillator_Cross_Timeframe_Indi_DeMarker_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_DeMarker_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_DeMarker_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: MFI oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_MFI_MA_Period = 22; // MA Period +INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_MFI_Applied_Volume = + (ENUM_APPLIED_VOLUME)0; // Applied volume. +INPUT int Oscillator_Cross_Timeframe_Indi_MFI_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_MFI_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_MFI_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Momentum oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_Momentum_Period = 12; // Averaging period +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_Momentum_Applied_Price = PRICE_CLOSE; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_Momentum_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_Momentum_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_Momentum_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: OBV oscillator params"); +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_OBV_Applied_Price = PRICE_CLOSE; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_OBV_Shift = 1; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_OBV_Shift2 = 1; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_OBV_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: PVT oscillator params"); +INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_PVT_InpVolumeType = VOLUME_TICK; // Volumes +INPUT int Oscillator_Cross_Timeframe_Indi_PVT_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_PVT_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_PVT_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: ROC oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_ROC_Period = 16; // Period +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_ROC_Applied_Price = PRICE_WEIGHTED; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_ROC_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_ROC_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_ROC_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: RSI oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_RSI_Period = 16; // Period +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_RSI_Applied_Price = PRICE_WEIGHTED; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_RSI_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_RSI_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_RSI_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: StdDev oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_MA_Period = 24; // Period +INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_MA_Shift = 0; // MA Shift +INPUT ENUM_MA_METHOD Oscillator_Cross_Timeframe_Indi_StdDev_MA_Method = (ENUM_MA_METHOD)3; // MA Method +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_StdDev_Applied_Price = PRICE_WEIGHTED; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_StdDev_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Stochastic oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_KPeriod = 8; // K line period +INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_DPeriod = 12; // D line period +INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_Slowing = 12; // Slowing +INPUT ENUM_MA_METHOD Oscillator_Cross_Timeframe_Indi_Stochastic_MA_Method = MODE_EMA; // Moving Average method +INPUT ENUM_STO_PRICE Oscillator_Cross_Timeframe_Indi_Stochastic_Price_Field = + 0; // Price (0 - Low/High or 1 - Close/Close) +INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_Stochastic_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: TRIX oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_TRIX_InpPeriodEMA = 14; // EMA period +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_TRIX_Applied_Price = PRICE_WEIGHTED; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_TRIX_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_TRIX_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_TRIX_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Ultimate oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpFastPeriod = 7; // Fast ATR period +INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpMiddlePeriod = 14; // Middle ATR period +INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpSlowPeriod = 28; // Slow ATR period +INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpFastK = 4; // Fast K +INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpMiddleK = 2; // Middle K +INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpSlowK = 1; // Slow K +INPUT int Oscillator_Cross_Timeframe_Indi_UO_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_UO_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_UO_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Williams' Accumulation/Distribution oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_WAD_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_WAD_Shift2 = 0; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_WAD_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: WPR oscillator params"); +INPUT int Oscillator_Cross_Timeframe_Indi_WPR_Period = 18; // Period +INPUT int Oscillator_Cross_Timeframe_Indi_WPR_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_WPR_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_WPR_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: Volumes oscillator params"); +INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_VOL_InpVolumeType = VOLUME_TICK; // Volumes +INPUT int Oscillator_Cross_Timeframe_Indi_VOL_Shift = 0; // Shift +INPUT int Oscillator_Cross_Timeframe_Indi_VOL_Shift2 = 10; // Shift 2 +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_VOL_SourceType = IDATA_BUILTIN; // Source type /* @todo -INPUT_GROUP("Oscillator Cross Shift strategy: ADX indicator params"); -INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Shift_Indi_ADX_Fast_Line = LINE_PLUSDI; // Fast line -INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Shift_Indi_ADX_Slow_Line = LINE_MINUSDI; // Slow line to cross_shift -INPUT int Oscillator_Cross_Shift_Indi_ADX_Period = 16; // Averaging period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_ADX_AppliedPrice = PRICE_TYPICAL; // Applied price -INPUT int Oscillator_Cross_Shift_Indi_ADX_Shift = 0; // Shift -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_ADX_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator Cross Shift strategy: ADXW indicator params"); -INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Shift_Indi_ADXW_Fast_Line = LINE_PLUSDI; // Fast line -INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Shift_Indi_ADXW_Slow_Line = LINE_MINUSDI; // Slow line to cross_shift -INPUT int Oscillator_Cross_Shift_Indi_ADXW_Period = 16; // Averaging period -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_ADXW_AppliedPrice = PRICE_TYPICAL; // Applied price -INPUT int Oscillator_Cross_Shift_Indi_ADXW_Shift = 0; // Shift -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_ADXW_SourceType = IDATA_BUILTIN; // Source type -INPUT_GROUP("Oscillator strategy: MACD indicator params"); -INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Shift_Indi_MACD_Fast_Line = LINE_SIGNAL; // Fast line -INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Shift_Indi_MACD_Slow_Line = LINE_MAIN; // Slow line -INPUT int Oscillator_Cross_Shift_Indi_MACD_Period_Fast = 6; // Period Fast -INPUT int Oscillator_Cross_Shift_Indi_MACD_Period_Slow = 34; // Period Slow -INPUT int Oscillator_Cross_Shift_Indi_MACD_Period_Signal = 10; // Period Signal -INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Shift_Indi_MACD_Applied_Price = PRICE_OPEN; // Applied Price -INPUT int Oscillator_Cross_Shift_Indi_MACD_Shift = 0; // Shift -INPUT_GROUP("Oscillator strategy: RVI indicator params"); -INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Shift_Indi_RVI_Fast_Line = LINE_SIGNAL; // Fast line -INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Shift_Indi_RVI_Slow_Line = LINE_MAIN; // Slow line -INPUT unsigned int Oscillator_Cross_Shift_Indi_RVI_Period = 12; // Averaging -period INPUT int Oscillator_Cross_Shift_Indi_RVI_Shift = 0; // Shift -INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Shift_Indi_RVI_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: ADX indicator params"); +INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Timeframe_Indi_ADX_Fast_Line = LINE_PLUSDI; // Fast line +INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Timeframe_Indi_ADX_Slow_Line = LINE_MINUSDI; // Slow line to +cross_shift INPUT int Oscillator_Cross_Timeframe_Indi_ADX_Period = 16; // Averaging +period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_ADX_AppliedPrice = PRICE_TYPICAL; // Applied price +INPUT int Oscillator_Cross_Timeframe_Indi_ADX_Shift = 0; // Shift +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_ADX_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: ADXW indicator params"); +INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Timeframe_Indi_ADXW_Fast_Line = LINE_PLUSDI; // Fast line +INPUT ENUM_INDI_ADX_LINE Oscillator_Cross_Timeframe_Indi_ADXW_Slow_Line = LINE_MINUSDI; // Slow line to +cross_shift INPUT int Oscillator_Cross_Timeframe_Indi_ADXW_Period = 16; // Averaging +period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_ADXW_AppliedPrice = PRICE_TYPICAL; // Applied price +INPUT int Oscillator_Cross_Timeframe_Indi_ADXW_Shift = 0; // Shift +INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_ADXW_SourceType = IDATA_BUILTIN; // Source type +INPUT_GROUP("Oscillator Cross Timeframe strategy: MACD indicator params"); +INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Timeframe_Indi_MACD_Fast_Line = LINE_SIGNAL; // Fast line +INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Timeframe_Indi_MACD_Slow_Line = LINE_MAIN; // Slow line +INPUT int Oscillator_Cross_Timeframe_Indi_MACD_Period_Fast = 6; // Period Fast +INPUT int Oscillator_Cross_Timeframe_Indi_MACD_Period_Slow = 34; // Period Slow +INPUT int Oscillator_Cross_Timeframe_Indi_MACD_Period_Signal = 10; // Period Signal +INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_MACD_Applied_Price = PRICE_OPEN; // Applied Price +INPUT int Oscillator_Cross_Timeframe_Indi_MACD_Shift = 0; // Shift +INPUT_GROUP("Oscillator Cross Timeframe strategy: RVI indicator params"); +INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Timeframe_Indi_RVI_Fast_Line = LINE_SIGNAL; // Fast line +INPUT ENUM_SIGNAL_LINE Oscillator_Cross_Timeframe_Indi_RVI_Slow_Line = LINE_MAIN; // Slow line +INPUT unsigned int Oscillator_Cross_Timeframe_Indi_RVI_Period = 12; // Averaging +period INPUT int Oscillator_Cross_Timeframe_Indi_RVI_Shift = 0; // +Shift INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_RVI_SourceType = IDATA_BUILTIN; // Source type */ // Structs. // Defines struct with default user strategy values. -struct Stg_Oscillator_Cross_Shift_Params_Defaults : StgParams { +struct Stg_Oscillator_Cross_Timeframe_Params_Defaults : StgParams { uint shift1, shift2; - Stg_Oscillator_Cross_Shift_Params_Defaults() - : StgParams(::Oscillator_Cross_Shift_SignalOpenMethod, ::Oscillator_Cross_Shift_SignalOpenFilterMethod, - ::Oscillator_Cross_Shift_SignalOpenLevel, ::Oscillator_Cross_Shift_SignalOpenBoostMethod, - ::Oscillator_Cross_Shift_SignalCloseMethod, ::Oscillator_Cross_Shift_SignalCloseFilter, - ::Oscillator_Cross_Shift_SignalCloseLevel, ::Oscillator_Cross_Shift_PriceStopMethod, - ::Oscillator_Cross_Shift_PriceStopLevel, ::Oscillator_Cross_Shift_TickFilterMethod, - ::Oscillator_Cross_Shift_MaxSpread, ::Oscillator_Cross_Shift_Shift), + Stg_Oscillator_Cross_Timeframe_Params_Defaults() + : StgParams(::Oscillator_Cross_Timeframe_SignalOpenMethod, ::Oscillator_Cross_Timeframe_SignalOpenFilterMethod, + ::Oscillator_Cross_Timeframe_SignalOpenLevel, ::Oscillator_Cross_Timeframe_SignalOpenBoostMethod, + ::Oscillator_Cross_Timeframe_SignalCloseMethod, ::Oscillator_Cross_Timeframe_SignalCloseFilter, + ::Oscillator_Cross_Timeframe_SignalCloseLevel, ::Oscillator_Cross_Timeframe_PriceStopMethod, + ::Oscillator_Cross_Timeframe_PriceStopLevel, ::Oscillator_Cross_Timeframe_TickFilterMethod, + ::Oscillator_Cross_Timeframe_MaxSpread, ::Oscillator_Cross_Timeframe_Shift), shift1(0), shift2(0) { - Set(STRAT_PARAM_LS, ::Oscillator_Cross_Shift_LotSize); - Set(STRAT_PARAM_OCL, ::Oscillator_Cross_Shift_OrderCloseLoss); - Set(STRAT_PARAM_OCP, ::Oscillator_Cross_Shift_OrderCloseProfit); - Set(STRAT_PARAM_OCT, ::Oscillator_Cross_Shift_OrderCloseTime); - Set(STRAT_PARAM_SOFT, ::Oscillator_Cross_Shift_SignalOpenFilterTime); + Set(STRAT_PARAM_LS, ::Oscillator_Cross_Timeframe_LotSize); + Set(STRAT_PARAM_OCL, ::Oscillator_Cross_Timeframe_OrderCloseLoss); + Set(STRAT_PARAM_OCP, ::Oscillator_Cross_Timeframe_OrderCloseProfit); + Set(STRAT_PARAM_OCT, ::Oscillator_Cross_Timeframe_OrderCloseTime); + Set(STRAT_PARAM_SOFT, ::Oscillator_Cross_Timeframe_SignalOpenFilterTime); } // Getters. uint GetShift1() { return shift1; } @@ -260,24 +262,24 @@ struct Stg_Oscillator_Cross_Shift_Params_Defaults : StgParams { void SetShift2(uint _value) { shift2 = _value; } }; -class Stg_Oscillator_Cross_Shift : public Strategy { +class Stg_Oscillator_Cross_Timeframe : public Strategy { protected: - Stg_Oscillator_Cross_Shift_Params_Defaults ssparams; + Stg_Oscillator_Cross_Timeframe_Params_Defaults ssparams; public: - Stg_Oscillator_Cross_Shift(StgParams &_sparams, TradeParams &_tparams, ChartParams &_cparams, string _name = "") + Stg_Oscillator_Cross_Timeframe(StgParams &_sparams, TradeParams &_tparams, ChartParams &_cparams, string _name = "") : Strategy(_sparams, _tparams, _cparams, _name) {} - static Stg_Oscillator_Cross_Shift *Init(ENUM_TIMEFRAMES _tf = NULL, EA *_ea = NULL) { + static Stg_Oscillator_Cross_Timeframe *Init(ENUM_TIMEFRAMES _tf = NULL, EA *_ea = NULL) { // Initialize strategy initial values. - Stg_Oscillator_Cross_Shift_Params_Defaults stg_oscillator_cross_shift_defaults; - StgParams _stg_params(stg_oscillator_cross_shift_defaults); + Stg_Oscillator_Cross_Timeframe_Params_Defaults stg_oscillator_cross_timeframe_defaults; + StgParams _stg_params(stg_oscillator_cross_timeframe_defaults); // Initialize Strategy instance. ChartParams _cparams(_tf, _Symbol); TradeParams _tparams; - Stg_Oscillator_Cross_Shift *_strat = - new Stg_Oscillator_Cross_Shift(_stg_params, _tparams, _cparams, "Oscillator Cross Shift"); - _strat.ssparams = stg_oscillator_cross_shift_defaults; + Stg_Oscillator_Cross_Timeframe *_strat = + new Stg_Oscillator_Cross_Timeframe(_stg_params, _tparams, _cparams, "Oscillator Cross Timeframe"); + _strat.ssparams = stg_oscillator_cross_timeframe_defaults; return _strat; } @@ -286,117 +288,117 @@ class Stg_Oscillator_Cross_Shift : public Strategy { */ bool IsValidEntry(IndicatorBase *_indi, int _shift = 0) { bool _result = true; - switch (::Oscillator_Cross_Shift_Type) { - case STG_OSCILLATOR_SHIFT_TYPE_AC: + switch (::Oscillator_Cross_Timeframe_Type) { + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AC: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_AD: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_AO: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AO: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_ATR: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ATR: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_BEARS: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BEARS: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_BULLS: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BULLS: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_BWMFI: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BWMFI: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_CCI: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CCI: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_CHO: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHO: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_CHV: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHV: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_DEMARKER: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_DEMARKER: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_MFI: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MFI: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_MOM: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MOM: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_OBV: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_OBV: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_PVT: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_PVT: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_ROC: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ROC: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_RSI: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_RSI: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_STDDEV: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STDDEV: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_STOCH: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STOCH: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_TRIX: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_TRIX: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_UO: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_UO: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_WPR: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WPR: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_WAD: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WAD: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_SHIFT_TYPE_VOL: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_VOL: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; /* @todo - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_ADX: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ADX: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_ADXW: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ADXW: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_MACD: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MACD: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_RVI: + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_RVI: _result &= dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift) && dynamic_cast(_indi).GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift + 1); break; @@ -412,383 +414,387 @@ class Stg_Oscillator_Cross_Shift : public Strategy { */ void OnInit() { // Initialize indicators. - switch (Oscillator_Cross_Shift_Type) { - case STG_OSCILLATOR_SHIFT_TYPE_AC: // AC + switch (Oscillator_Cross_Timeframe_Type) { + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AC: // AC { - IndiACParams _indi_params(::Oscillator_Cross_Shift_Indi_AC_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_AC_SourceType); + IndiACParams _indi_params(::Oscillator_Cross_Timeframe_Indi_AC_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_AC_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_AC(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_AC_Shift2); - SetIndicator(new Indi_AC(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_AC_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_AC_Shift2); + SetIndicator(new Indi_AC(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_AC_Shift2); + SetIndicator(new Indi_AC(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_AC_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_AC_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_AD: // AD + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD: // AD { - IndiADParams _indi_params(::Oscillator_Cross_Shift_Indi_AD_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_AD_SourceType); + IndiADParams _indi_params(::Oscillator_Cross_Timeframe_Indi_AD_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_AD_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_AD(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_AD_Shift2); - SetIndicator(new Indi_AD(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_AD_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_AD_Shift2); + SetIndicator(new Indi_AD(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_AD_Shift2); + SetIndicator(new Indi_AD(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_AD_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_AD_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_AO: // AO + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AO: // AO { - IndiAOParams _indi_params(::Oscillator_Cross_Shift_Indi_Awesome_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_Awesome_SourceType); + IndiAOParams _indi_params(::Oscillator_Cross_Timeframe_Indi_Awesome_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_Awesome_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_AO(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_Awesome_Shift2); - SetIndicator(new Indi_AO(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_Awesome_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_Awesome_Shift2); + SetIndicator(new Indi_AO(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_Awesome_Shift2); + SetIndicator(new Indi_AO(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_Awesome_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_Awesome_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_ATR: // ATR + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ATR: // ATR { - IndiATRParams _indi_params(::Oscillator_Cross_Shift_Indi_ATR_Period, ::Oscillator_Cross_Shift_Indi_ATR_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_ATR_SourceType); + IndiATRParams _indi_params(::Oscillator_Cross_Timeframe_Indi_ATR_Period, + ::Oscillator_Cross_Timeframe_Indi_ATR_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_ATR_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_ATR(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_ATR_Shift2); - SetIndicator(new Indi_ATR(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_ATR_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_ATR_Shift2); + SetIndicator(new Indi_ATR(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_ATR_Shift2); + SetIndicator(new Indi_ATR(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_ATR_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_ATR_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_BEARS: // Bears + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BEARS: // Bears { - IndiBearsPowerParams _indi_params(::Oscillator_Cross_Shift_Indi_BearsPower_Period, - ::Oscillator_Cross_Shift_Indi_BearsPower_Applied_Price, - ::Oscillator_Cross_Shift_Indi_BearsPower_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_BearsPower_SourceType); + IndiBearsPowerParams _indi_params(::Oscillator_Cross_Timeframe_Indi_BearsPower_Period, + ::Oscillator_Cross_Timeframe_Indi_BearsPower_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_BearsPower_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_BearsPower_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_BearsPower(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_BearsPower_Shift2); - SetIndicator(new Indi_BearsPower(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_BearsPower_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_BearsPower_Shift2); + SetIndicator(new Indi_BearsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_BearsPower_Shift2); + SetIndicator(new Indi_BearsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_BearsPower_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_BearsPower_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_BULLS: // Bulls + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BULLS: // Bulls { - IndiBullsPowerParams _indi_params(::Oscillator_Cross_Shift_Indi_BullsPower_Period, - ::Oscillator_Cross_Shift_Indi_BullsPower_Applied_Price, - ::Oscillator_Cross_Shift_Indi_BullsPower_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_BullsPower_SourceType); + IndiBullsPowerParams _indi_params(::Oscillator_Cross_Timeframe_Indi_BullsPower_Period, + ::Oscillator_Cross_Timeframe_Indi_BullsPower_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_BullsPower_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_BullsPower_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_BullsPower(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_BullsPower_Shift2); - SetIndicator(new Indi_BullsPower(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_BullsPower_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_BullsPower_Shift2); + SetIndicator(new Indi_BullsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_BullsPower_Shift2); + SetIndicator(new Indi_BullsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_BullsPower_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_BullsPower_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_BWMFI: // BWMFI + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BWMFI: // BWMFI { - IndiBWIndiMFIParams _indi_params(::Oscillator_Cross_Shift_Indi_BWMFI_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_BWMFI_SourceType); + IndiBWIndiMFIParams _indi_params(::Oscillator_Cross_Timeframe_Indi_BWMFI_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_BWMFI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_BWMFI(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_BWMFI_Shift2); - SetIndicator(new Indi_BWMFI(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_BWMFI_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_BWMFI_Shift2); + SetIndicator(new Indi_BWMFI(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_BWMFI_Shift2); + SetIndicator(new Indi_BWMFI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_BWMFI_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_BWMFI_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_CCI: // CCI + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CCI: // CCI { - IndiCCIParams _indi_params(::Oscillator_Cross_Shift_Indi_CCI_Period, - ::Oscillator_Cross_Shift_Indi_CCI_Applied_Price, - ::Oscillator_Cross_Shift_Indi_CCI_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_CCI_SourceType); + IndiCCIParams _indi_params(::Oscillator_Cross_Timeframe_Indi_CCI_Period, + ::Oscillator_Cross_Timeframe_Indi_CCI_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_CCI_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_CCI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_CCI(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_CCI_Shift2); - SetIndicator(new Indi_CCI(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_CCI_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_CCI_Shift2); + SetIndicator(new Indi_CCI(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_CCI_Shift2); + SetIndicator(new Indi_CCI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_CCI_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_CCI_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_CHO: // Chaikin (CHO) + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHO: // Chaikin (CHO) { IndiCHOParams _indi_params( - ::Oscillator_Cross_Shift_Indi_CHO_InpFastMA, ::Oscillator_Cross_Shift_Indi_CHO_InpSlowMA, - ::Oscillator_Cross_Shift_Indi_CHO_InpSmoothMethod, ::Oscillator_Cross_Shift_Indi_CHO_InpVolumeType, - ::Oscillator_Cross_Shift_Indi_CHO_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_CHO_SourceType); + ::Oscillator_Cross_Timeframe_Indi_CHO_InpFastMA, ::Oscillator_Cross_Timeframe_Indi_CHO_InpSlowMA, + ::Oscillator_Cross_Timeframe_Indi_CHO_InpSmoothMethod, ::Oscillator_Cross_Timeframe_Indi_CHO_InpVolumeType, + ::Oscillator_Cross_Timeframe_Indi_CHO_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_CHO_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_CHO(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_CHO_Shift2); - SetIndicator(new Indi_CHO(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_CHO_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_CHO_Shift2); + SetIndicator(new Indi_CHO(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_CHO_Shift2); + SetIndicator(new Indi_CHO(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_CHO_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_CHO_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_CHV: // Chaikin Volatility (CHV) + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHV: // Chaikin Volatility (CHV) { IndiCHVParams _indi_params( - ::Oscillator_Cross_Shift_Indi_CHV_Smooth_Period, ::Oscillator_Cross_Shift_Indi_CHV_Period, - ::Oscillator_Cross_Shift_Indi_CHV_Smooth_Method, ::Oscillator_Cross_Shift_Indi_CHV_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_CHV_SourceType); + ::Oscillator_Cross_Timeframe_Indi_CHV_Smooth_Period, ::Oscillator_Cross_Timeframe_Indi_CHV_Period, + ::Oscillator_Cross_Timeframe_Indi_CHV_Smooth_Method, ::Oscillator_Cross_Timeframe_Indi_CHV_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_CHV_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_CHV(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_CHV_Shift2); - SetIndicator(new Indi_CHV(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_CHV_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_CHV_Shift2); + SetIndicator(new Indi_CHV(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_CHV_Shift2); + SetIndicator(new Indi_CHV(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_CHV_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_CHV_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_DEMARKER: // DeMarker + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_DEMARKER: // DeMarker { - IndiDeMarkerParams _indi_params(::Oscillator_Cross_Shift_Indi_DeMarker_Period, - ::Oscillator_Cross_Shift_Indi_DeMarker_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_DeMarker_SourceType); + IndiDeMarkerParams _indi_params(::Oscillator_Cross_Timeframe_Indi_DeMarker_Period, + ::Oscillator_Cross_Timeframe_Indi_DeMarker_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_DeMarker_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_DeMarker(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_DeMarker_Shift2); - SetIndicator(new Indi_DeMarker(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_DeMarker_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_DeMarker_Shift2); + SetIndicator(new Indi_DeMarker(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_DeMarker_Shift2); + SetIndicator(new Indi_DeMarker(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_DeMarker_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_DeMarker_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_MFI: // MFI + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MFI: // MFI { - IndiMFIParams _indi_params(::Oscillator_Cross_Shift_Indi_MFI_MA_Period, - ::Oscillator_Cross_Shift_Indi_MFI_Applied_Volume, - ::Oscillator_Cross_Shift_Indi_MFI_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_MFI_SourceType); + IndiMFIParams _indi_params(::Oscillator_Cross_Timeframe_Indi_MFI_MA_Period, + ::Oscillator_Cross_Timeframe_Indi_MFI_Applied_Volume, + ::Oscillator_Cross_Timeframe_Indi_MFI_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_MFI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_MFI(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_MFI_Shift2); - SetIndicator(new Indi_MFI(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_MFI_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_MFI_Shift2); + SetIndicator(new Indi_MFI(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_MFI_Shift2); + SetIndicator(new Indi_MFI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_MFI_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_MFI_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_MOM: // MOM + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MOM: // MOM { - IndiMomentumParams _indi_params(::Oscillator_Cross_Shift_Indi_Momentum_Period, - ::Oscillator_Cross_Shift_Indi_Momentum_Applied_Price, - ::Oscillator_Cross_Shift_Indi_Momentum_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_Momentum_SourceType); + IndiMomentumParams _indi_params(::Oscillator_Cross_Timeframe_Indi_Momentum_Period, + ::Oscillator_Cross_Timeframe_Indi_Momentum_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_Momentum_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_Momentum_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_Momentum(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_Momentum_Shift2); - SetIndicator(new Indi_Momentum(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_Momentum_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_Momentum_Shift2); + SetIndicator(new Indi_Momentum(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_Momentum_Shift2); + SetIndicator(new Indi_Momentum(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_Momentum_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_Momentum_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_OBV: // OBV + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_OBV: // OBV { - IndiOBVParams _indi_params(::Oscillator_Cross_Shift_Indi_OBV_Applied_Price, - ::Oscillator_Cross_Shift_Indi_OBV_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_OBV_SourceType); + IndiOBVParams _indi_params(::Oscillator_Cross_Timeframe_Indi_OBV_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_OBV_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_OBV_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_OBV(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_OBV_Shift2); - SetIndicator(new Indi_OBV(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_OBV_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_OBV_Shift2); + SetIndicator(new Indi_OBV(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_OBV_Shift2); + SetIndicator(new Indi_OBV(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_OBV_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_OBV_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_PVT: // PVT + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_PVT: // PVT { - IndiPriceVolumeTrendParams _indi_params(::Oscillator_Cross_Shift_Indi_PVT_InpVolumeType, - ::Oscillator_Cross_Shift_Indi_PVT_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_PVT_SourceType); + IndiPriceVolumeTrendParams _indi_params(::Oscillator_Cross_Timeframe_Indi_PVT_InpVolumeType, + ::Oscillator_Cross_Timeframe_Indi_PVT_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_PVT_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_PriceVolumeTrend(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_PVT_Shift2); - SetIndicator(new Indi_PriceVolumeTrend(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_PVT_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_PVT_Shift2); + SetIndicator(new Indi_PriceVolumeTrend(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_PVT_Shift2); + SetIndicator(new Indi_PriceVolumeTrend(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_PVT_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_PVT_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_ROC: // ROC + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ROC: // ROC { - IndiRateOfChangeParams _indi_params(::Oscillator_Cross_Shift_Indi_ROC_Period, - ::Oscillator_Cross_Shift_Indi_ROC_Applied_Price, - ::Oscillator_Cross_Shift_Indi_ROC_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_ROC_SourceType); + IndiRateOfChangeParams _indi_params(::Oscillator_Cross_Timeframe_Indi_ROC_Period, + ::Oscillator_Cross_Timeframe_Indi_ROC_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_ROC_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_ROC_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_RateOfChange(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_ROC_Shift2); - SetIndicator(new Indi_RateOfChange(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_ROC_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_ROC_Shift2); + SetIndicator(new Indi_RateOfChange(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_ROC_Shift2); + SetIndicator(new Indi_RateOfChange(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_ROC_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_ROC_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_RSI: // RSI + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_RSI: // RSI { - IndiRSIParams _indi_params(::Oscillator_Cross_Shift_Indi_RSI_Period, - ::Oscillator_Cross_Shift_Indi_RSI_Applied_Price, - ::Oscillator_Cross_Shift_Indi_RSI_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_RSI_SourceType); + IndiRSIParams _indi_params(::Oscillator_Cross_Timeframe_Indi_RSI_Period, + ::Oscillator_Cross_Timeframe_Indi_RSI_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_RSI_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_RSI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_RSI(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_RSI_Shift2); - SetIndicator(new Indi_RSI(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_RSI_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_RSI_Shift2); + SetIndicator(new Indi_RSI(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_RSI_Shift2); + SetIndicator(new Indi_RSI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_RSI_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_RSI_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_STDDEV: // StdDev + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STDDEV: // StdDev { IndiStdDevParams _indi_params( - ::Oscillator_Cross_Shift_Indi_StdDev_MA_Period, ::Oscillator_Cross_Shift_Indi_StdDev_MA_Shift, - ::Oscillator_Cross_Shift_Indi_StdDev_MA_Method, ::Oscillator_Cross_Shift_Indi_StdDev_Applied_Price, - ::Oscillator_Cross_Shift_Indi_StdDev_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_StdDev_SourceType); + ::Oscillator_Cross_Timeframe_Indi_StdDev_MA_Period, ::Oscillator_Cross_Timeframe_Indi_StdDev_MA_Shift, + ::Oscillator_Cross_Timeframe_Indi_StdDev_MA_Method, ::Oscillator_Cross_Timeframe_Indi_StdDev_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_StdDev_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_StdDev_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_StdDev(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_StdDev_Shift2); - SetIndicator(new Indi_StdDev(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_StdDev_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_StdDev_Shift2); + SetIndicator(new Indi_StdDev(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_StdDev_Shift2); + SetIndicator(new Indi_StdDev(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_StdDev_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_StdDev_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_STOCH: // Stochastic + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STOCH: // Stochastic { - IndiStochParams _indi_params( - ::Oscillator_Cross_Shift_Indi_Stochastic_KPeriod, ::Oscillator_Cross_Shift_Indi_Stochastic_DPeriod, - ::Oscillator_Cross_Shift_Indi_Stochastic_Slowing, ::Oscillator_Cross_Shift_Indi_Stochastic_MA_Method, - ::Oscillator_Cross_Shift_Indi_Stochastic_Price_Field, ::Oscillator_Cross_Shift_Indi_Stochastic_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_Stochastic_SourceType); + IndiStochParams _indi_params(::Oscillator_Cross_Timeframe_Indi_Stochastic_KPeriod, + ::Oscillator_Cross_Timeframe_Indi_Stochastic_DPeriod, + ::Oscillator_Cross_Timeframe_Indi_Stochastic_Slowing, + ::Oscillator_Cross_Timeframe_Indi_Stochastic_MA_Method, + ::Oscillator_Cross_Timeframe_Indi_Stochastic_Price_Field, + ::Oscillator_Cross_Timeframe_Indi_Stochastic_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_Stochastic_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_Stochastic(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_Stochastic_Shift2); - SetIndicator(new Indi_Stochastic(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_Stochastic_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_Stochastic_Shift2); + SetIndicator(new Indi_Stochastic(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_Stochastic_Shift2); + SetIndicator(new Indi_Stochastic(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_Stochastic_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_Stochastic_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_TRIX: // TRIX + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_TRIX: // TRIX { - IndiTRIXParams _indi_params(::Oscillator_Cross_Shift_Indi_TRIX_InpPeriodEMA, - ::Oscillator_Cross_Shift_Indi_TRIX_Applied_Price, - ::Oscillator_Cross_Shift_Indi_TRIX_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_TRIX_SourceType); + IndiTRIXParams _indi_params(::Oscillator_Cross_Timeframe_Indi_TRIX_InpPeriodEMA, + ::Oscillator_Cross_Timeframe_Indi_TRIX_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_TRIX_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_TRIX_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_TRIX(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_TRIX_Shift2); - SetIndicator(new Indi_TRIX(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_TRIX_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_TRIX_Shift2); + SetIndicator(new Indi_TRIX(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_TRIX_Shift2); + SetIndicator(new Indi_TRIX(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_TRIX_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_TRIX_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_UO: // UO + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_UO: // UO { IndiUltimateOscillatorParams _indi_params( - ::Oscillator_Cross_Shift_Indi_UO_InpFastPeriod, ::Oscillator_Cross_Shift_Indi_UO_InpMiddlePeriod, - ::Oscillator_Cross_Shift_Indi_UO_InpSlowPeriod, ::Oscillator_Cross_Shift_Indi_UO_InpFastK, - ::Oscillator_Cross_Shift_Indi_UO_InpMiddleK, ::Oscillator_Cross_Shift_Indi_UO_InpSlowK, - ::Oscillator_Cross_Shift_Indi_UO_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_UO_SourceType); + ::Oscillator_Cross_Timeframe_Indi_UO_InpFastPeriod, ::Oscillator_Cross_Timeframe_Indi_UO_InpMiddlePeriod, + ::Oscillator_Cross_Timeframe_Indi_UO_InpSlowPeriod, ::Oscillator_Cross_Timeframe_Indi_UO_InpFastK, + ::Oscillator_Cross_Timeframe_Indi_UO_InpMiddleK, ::Oscillator_Cross_Timeframe_Indi_UO_InpSlowK, + ::Oscillator_Cross_Timeframe_Indi_UO_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_UO_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_UltimateOscillator(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_UO_Shift2); - SetIndicator(new Indi_UltimateOscillator(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_UO_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_UO_Shift2); + SetIndicator(new Indi_UltimateOscillator(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_UO_Shift2); + SetIndicator(new Indi_UltimateOscillator(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_UO_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_UO_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_WAD: // Williams' AD + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WAD: // Williams' AD { - IndiWilliamsADParams _indi_params(::Oscillator_Cross_Shift_Indi_WAD_Shift); - _indi_params.SetDataSourceType(Oscillator_Cross_Shift_Indi_WAD_SourceType); + IndiWilliamsADParams _indi_params(::Oscillator_Cross_Timeframe_Indi_WAD_Shift); + _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_WAD_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_WilliamsAD(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_WAD_Shift2); - SetIndicator(new Indi_WilliamsAD(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_WAD_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_WAD_Shift2); + SetIndicator(new Indi_WilliamsAD(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_WAD_Shift2); + SetIndicator(new Indi_WilliamsAD(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_WAD_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_WAD_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_WPR: // WPR + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WPR: // WPR { - IndiWPRParams _indi_params(::Oscillator_Cross_Shift_Indi_WPR_Period, ::Oscillator_Cross_Shift_Indi_WPR_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_WPR_SourceType); + IndiWPRParams _indi_params(::Oscillator_Cross_Timeframe_Indi_WPR_Period, + ::Oscillator_Cross_Timeframe_Indi_WPR_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_WPR_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_WPR(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_WPR_Shift2); - SetIndicator(new Indi_WPR(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_WPR_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_WPR_Shift2); + SetIndicator(new Indi_WPR(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_WPR_Shift2); + SetIndicator(new Indi_WPR(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_WPR_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_WPR_Shift2); break; } - case STG_OSCILLATOR_SHIFT_TYPE_VOL: // Volumes + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_VOL: // Volumes { - IndiVolumesParams _indi_params(::Oscillator_Cross_Shift_Indi_VOL_InpVolumeType, - ::Oscillator_Cross_Shift_Indi_VOL_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_VOL_SourceType); + IndiVolumesParams _indi_params(::Oscillator_Cross_Timeframe_Indi_VOL_InpVolumeType, + ::Oscillator_Cross_Timeframe_Indi_VOL_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_VOL_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_Volumes(_indi_params), ::Oscillator_Cross_Shift_Type); - _indi_params.SetShift(::Oscillator_Cross_Shift_Indi_VOL_Shift2); - SetIndicator(new Indi_Volumes(_indi_params), ::Oscillator_Cross_Shift_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Shift_Indi_VOL_Shift); - ssparams.SetShift2(Oscillator_Cross_Shift_Indi_VOL_Shift2); + SetIndicator(new Indi_Volumes(_indi_params), ::Oscillator_Cross_Timeframe_Type); + _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_VOL_Shift2); + SetIndicator(new Indi_Volumes(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); + ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_VOL_Shift); + ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_VOL_Shift2); break; } /* @todo: Convert multi into single mode. - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_ADX: // ADX + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ADX: // ADX { - IndiADXParams _adx_params(::Oscillator_Cross_Shift_Indi_ADX_Period, - ::Oscillator_Cross_Shift_Indi_ADX_AppliedPrice, - ::Oscillator_Cross_Shift_Indi_ADX_Shift); - _adx_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_ADX_SourceType); + IndiADXParams _adx_params(::Oscillator_Cross_Timeframe_Indi_ADX_Period, + ::Oscillator_Cross_Timeframe_Indi_ADX_AppliedPrice, + ::Oscillator_Cross_Timeframe_Indi_ADX_Shift); + _adx_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_ADX_SourceType); _adx_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_ADX(_adx_params), ::Oscillator_Cross_Shift_Type); + SetIndicator(new Indi_ADX(_adx_params), ::Oscillator_Cross_Timeframe_Type); // sparams.SetLineFast(0); // @todo: Fix Strategy to allow custom params stored in sparam. - ssparams.SetLineFast((uint)Oscillator_Cross_Shift_Indi_ADX_Fast_Line); - ssparams.SetLineSlow((uint)Oscillator_Cross_Shift_Indi_ADX_Slow_Line); + ssparams.SetLineFast((uint)Oscillator_Cross_Timeframe_Indi_ADX_Fast_Line); + ssparams.SetLineSlow((uint)Oscillator_Cross_Timeframe_Indi_ADX_Slow_Line); break; } - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_ADXW: // ADXW + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ADXW: // ADXW { - IndiADXWParams _adxw_params(::Oscillator_Cross_Shift_Indi_ADXW_Period, - ::Oscillator_Cross_Shift_Indi_ADXW_AppliedPrice, - ::Oscillator_Cross_Shift_Indi_ADXW_Shift); - _adxw_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_ADXW_SourceType); + IndiADXWParams _adxw_params(::Oscillator_Cross_Timeframe_Indi_ADXW_Period, + ::Oscillator_Cross_Timeframe_Indi_ADXW_AppliedPrice, + ::Oscillator_Cross_Timeframe_Indi_ADXW_Shift); + _adxw_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_ADXW_SourceType); _adxw_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_ADXW(_adxw_params), ::Oscillator_Cross_Shift_Type); + SetIndicator(new Indi_ADXW(_adxw_params), ::Oscillator_Cross_Timeframe_Type); // sparams.SetLineFast(0); // @todo: Fix Strategy to allow custom params stored in sparam. - ssparams.SetLineFast((uint)Oscillator_Cross_Shift_Indi_ADXW_Fast_Line); - ssparams.SetLineSlow((uint)Oscillator_Cross_Shift_Indi_ADXW_Slow_Line); + ssparams.SetLineFast((uint)Oscillator_Cross_Timeframe_Indi_ADXW_Fast_Line); + ssparams.SetLineSlow((uint)Oscillator_Cross_Timeframe_Indi_ADXW_Slow_Line); break; } - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_MACD: // MACD + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MACD: // MACD { - IndiMACDParams _indi_params(::Oscillator_Cross_Shift_Indi_MACD_Period_Fast, - ::Oscillator_Cross_Shift_Indi_MACD_Period_Slow, - ::Oscillator_Cross_Shift_Indi_MACD_Period_Signal, - ::Oscillator_Cross_Shift_Indi_MACD_Applied_Price, - ::Oscillator_Cross_Shift_Indi_MACD_Shift); + IndiMACDParams _indi_params(::Oscillator_Cross_Timeframe_Indi_MACD_Period_Fast, + ::Oscillator_Cross_Timeframe_Indi_MACD_Period_Slow, + ::Oscillator_Cross_Timeframe_Indi_MACD_Period_Signal, + ::Oscillator_Cross_Timeframe_Indi_MACD_Applied_Price, + ::Oscillator_Cross_Timeframe_Indi_MACD_Shift); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_MACD(_indi_params), ::Oscillator_Cross_Shift_Type); - ssparams.SetLineFast((uint)Oscillator_Cross_Shift_Indi_MACD_Fast_Line); - ssparams.SetLineSlow((uint)Oscillator_Cross_Shift_Indi_MACD_Slow_Line); + SetIndicator(new Indi_MACD(_indi_params), ::Oscillator_Cross_Timeframe_Type); + ssparams.SetLineFast((uint)Oscillator_Cross_Timeframe_Indi_MACD_Fast_Line); + ssparams.SetLineSlow((uint)Oscillator_Cross_Timeframe_Indi_MACD_Slow_Line); break; } - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_RVI: // RVI + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_RVI: // RVI { - IndiRVIParams _indi_params(::Oscillator_Cross_Shift_Indi_RVI_Period, - ::Oscillator_Cross_Shift_Indi_RVI_Shift); - _indi_params.SetDataSourceType(::Oscillator_Cross_Shift_Indi_RVI_SourceType); + IndiRVIParams _indi_params(::Oscillator_Cross_Timeframe_Indi_RVI_Period, + ::Oscillator_Cross_Timeframe_Indi_RVI_Shift); + _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_RVI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); - SetIndicator(new Indi_RVI(_indi_params), ::Oscillator_Cross_Shift_Type); - ssparams.SetLineFast((uint)Oscillator_Cross_Shift_Indi_RVI_Fast_Line); - ssparams.SetLineSlow((uint)Oscillator_Cross_Shift_Indi_RVI_Slow_Line); + SetIndicator(new Indi_RVI(_indi_params), ::Oscillator_Cross_Timeframe_Type); + ssparams.SetLineFast((uint)Oscillator_Cross_Timeframe_Indi_RVI_Fast_Line); + ssparams.SetLineSlow((uint)Oscillator_Cross_Timeframe_Indi_RVI_Slow_Line); break; } */ - case STG_OSCILLATOR_CROSS_SHIFT_TYPE_0_NONE: // (None) + case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_0_NONE: // (None) default: break; } @@ -798,13 +804,13 @@ class Stg_Oscillator_Cross_Shift : public Strategy { * Check strategy's opening signal. */ bool SignalOpen(ENUM_ORDER_TYPE _cmd, int _method, float _level = 0.0f, int _shift = 0) { - IndicatorBase *_indi1 = GetIndicator(::Oscillator_Cross_Shift_Type); - IndicatorBase *_indi2 = GetIndicator(::Oscillator_Cross_Shift_Type + 1); + IndicatorBase *_indi1 = GetIndicator(::Oscillator_Cross_Timeframe_Type); + IndicatorBase *_indi2 = GetIndicator(::Oscillator_Cross_Timeframe_Type + 1); // uint _ishift1 = _indi1.GetParams().GetShift(); // @todo: Convert into Get(). // uint _ishift2 = _indi2.GetParams().GetShift(); // @todo: Convert into Get(). uint _ishift1 = ssparams.GetShift1(); uint _ishift2 = ssparams.GetShift2(); - bool _result = Oscillator_Cross_Shift_Type != STG_OSCILLATOR_CROSS_SHIFT_TYPE_0_NONE && + bool _result = Oscillator_Cross_Timeframe_Type != STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_0_NONE && IsValidEntry(_indi1, _ishift1) && IsValidEntry(_indi2, _ishift2); if (!_result) { // Returns false when indicator data is not valid. From dc86c5ad42bb81747da946dbc067b826f633f5a0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 24 Oct 2023 01:35:28 +0100 Subject: [PATCH 3/4] Implements strategy logic --- Stg_Oscillator_Cross_Timeframe.mqh | 195 ++++++++--------------------- 1 file changed, 55 insertions(+), 140 deletions(-) diff --git a/Stg_Oscillator_Cross_Timeframe.mqh b/Stg_Oscillator_Cross_Timeframe.mqh index 4a22630..bf6c372 100644 --- a/Stg_Oscillator_Cross_Timeframe.mqh +++ b/Stg_Oscillator_Cross_Timeframe.mqh @@ -40,7 +40,8 @@ enum ENUM_STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE { // User input params. INPUT_GROUP("Oscillator Cross Timeframe strategy: main strategy params"); INPUT ENUM_STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE Oscillator_Cross_Timeframe_Type = - STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD; // Oscillator type + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD; // Oscillator type +INPUT ENUM_TIMEFRAMES Oscillator_Cross_Timeframe_Tf = PERIOD_H6; // Oscillator timeframe to cross INPUT_GROUP("Oscillator Cross Timeframe strategy: strategy params"); INPUT float Oscillator_Cross_Timeframe_LotSize = 0; // Lot size INPUT int Oscillator_Cross_Timeframe_SignalOpenMethod = 6; // Signal open method @@ -62,42 +63,34 @@ INPUT int Oscillator_Cross_Timeframe_OrderCloseTime = -30; // Order clos INPUT_GROUP("Oscillator Cross Timeframe strategy: AC oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_AC_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_AC_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_AC_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: AD oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_AD_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_AD_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_AD_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: ATR oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_ATR_Period = 13; // Period INPUT int Oscillator_Cross_Timeframe_Indi_ATR_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_ATR_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_ATR_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Awesome oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_Awesome_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_Awesome_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_Awesome_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: BearsPower oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_BearsPower_Period = 30; // Period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_BearsPower_Applied_Price = PRICE_CLOSE; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_BearsPower_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_BearsPower_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_BearsPower_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: BullsPower oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_BullsPower_Period = 30; // Period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_BullsPower_Applied_Price = PRICE_CLOSE; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_BullsPower_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_BullsPower_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_BullsPower_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: BWMFI oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_BWMFI_Shift = 1; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_BWMFI_Shift2 = 1; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_BWMFI_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: CCI oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_CCI_Period = 20; // Period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_CCI_Applied_Price = PRICE_TYPICAL; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_CCI_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_CCI_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_CCI_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Chaikin oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_CHO_InpFastMA = 10; // Fast EMA period @@ -105,54 +98,45 @@ INPUT int Oscillator_Cross_Timeframe_Indi_CHO_InpSlowMA = 30; INPUT ENUM_MA_METHOD Oscillator_Cross_Timeframe_Indi_CHO_InpSmoothMethod = MODE_SMMA; // MA method INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_CHO_InpVolumeType = VOLUME_TICK; // Volumes INPUT int Oscillator_Cross_Timeframe_Indi_CHO_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_CHO_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_CHO_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Chaikin Volatility oscillator params"); INPUT unsigned int Oscillator_Cross_Timeframe_Indi_CHV_Smooth_Period; // Smooth period INPUT unsigned int Oscillator_Cross_Timeframe_Indi_CHV_Period; // Period INPUT ENUM_CHV_SMOOTH_METHOD Oscillator_Cross_Timeframe_Indi_CHV_Smooth_Method; // Smooth method INPUT int Oscillator_Cross_Timeframe_Indi_CHV_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_CHV_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_CHV_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: DeMarker indicator params"); INPUT int Oscillator_Cross_Timeframe_Indi_DeMarker_Period = 23; // Period INPUT int Oscillator_Cross_Timeframe_Indi_DeMarker_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_DeMarker_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_DeMarker_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: MFI oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_MFI_MA_Period = 22; // MA Period INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_MFI_Applied_Volume = (ENUM_APPLIED_VOLUME)0; // Applied volume. INPUT int Oscillator_Cross_Timeframe_Indi_MFI_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_MFI_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_MFI_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Momentum oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_Momentum_Period = 12; // Averaging period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_Momentum_Applied_Price = PRICE_CLOSE; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_Momentum_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_Momentum_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_Momentum_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: OBV oscillator params"); INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_OBV_Applied_Price = PRICE_CLOSE; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_OBV_Shift = 1; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_OBV_Shift2 = 1; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_OBV_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: PVT oscillator params"); INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_PVT_InpVolumeType = VOLUME_TICK; // Volumes INPUT int Oscillator_Cross_Timeframe_Indi_PVT_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_PVT_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_PVT_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: ROC oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_ROC_Period = 16; // Period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_ROC_Applied_Price = PRICE_WEIGHTED; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_ROC_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_ROC_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_ROC_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: RSI oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_RSI_Period = 16; // Period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_RSI_Applied_Price = PRICE_WEIGHTED; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_RSI_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_RSI_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_RSI_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: StdDev oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_MA_Period = 24; // Period @@ -160,7 +144,6 @@ INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_MA_Shift = 0; INPUT ENUM_MA_METHOD Oscillator_Cross_Timeframe_Indi_StdDev_MA_Method = (ENUM_MA_METHOD)3; // MA Method INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_StdDev_Applied_Price = PRICE_WEIGHTED; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_StdDev_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_StdDev_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Stochastic oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_KPeriod = 8; // K line period @@ -168,15 +151,13 @@ INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_DPeriod = 12; INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_Slowing = 12; // Slowing INPUT ENUM_MA_METHOD Oscillator_Cross_Timeframe_Indi_Stochastic_MA_Method = MODE_EMA; // Moving Average method INPUT ENUM_STO_PRICE Oscillator_Cross_Timeframe_Indi_Stochastic_Price_Field = - 0; // Price (0 - Low/High or 1 - Close/Close) -INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_Shift2 = 10; // Shift 2 + 0; // Price (0 - Low/High or 1 - Close/Close) +INPUT int Oscillator_Cross_Timeframe_Indi_Stochastic_Shift = 0; // Shift INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_Stochastic_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: TRIX oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_TRIX_InpPeriodEMA = 14; // EMA period INPUT ENUM_APPLIED_PRICE Oscillator_Cross_Timeframe_Indi_TRIX_Applied_Price = PRICE_WEIGHTED; // Applied Price INPUT int Oscillator_Cross_Timeframe_Indi_TRIX_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_TRIX_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_TRIX_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Ultimate oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpFastPeriod = 7; // Fast ATR period @@ -186,21 +167,17 @@ INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpFastK = 4; INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpMiddleK = 2; // Middle K INPUT int Oscillator_Cross_Timeframe_Indi_UO_InpSlowK = 1; // Slow K INPUT int Oscillator_Cross_Timeframe_Indi_UO_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_UO_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_UO_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Williams' Accumulation/Distribution oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_WAD_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_WAD_Shift2 = 0; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_WAD_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: WPR oscillator params"); INPUT int Oscillator_Cross_Timeframe_Indi_WPR_Period = 18; // Period INPUT int Oscillator_Cross_Timeframe_Indi_WPR_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_WPR_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_WPR_SourceType = IDATA_BUILTIN; // Source type INPUT_GROUP("Oscillator Cross Timeframe strategy: Volumes oscillator params"); INPUT ENUM_APPLIED_VOLUME Oscillator_Cross_Timeframe_Indi_VOL_InpVolumeType = VOLUME_TICK; // Volumes INPUT int Oscillator_Cross_Timeframe_Indi_VOL_Shift = 0; // Shift -INPUT int Oscillator_Cross_Timeframe_Indi_VOL_Shift2 = 10; // Shift 2 INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_VOL_SourceType = IDATA_BUILTIN; // Source type /* @todo @@ -238,34 +215,22 @@ Shift INPUT ENUM_IDATA_SOURCE_TYPE Oscillator_Cross_Timeframe_Indi_RVI_SourceTyp // Defines struct with default user strategy values. struct Stg_Oscillator_Cross_Timeframe_Params_Defaults : StgParams { - uint shift1, shift2; Stg_Oscillator_Cross_Timeframe_Params_Defaults() : StgParams(::Oscillator_Cross_Timeframe_SignalOpenMethod, ::Oscillator_Cross_Timeframe_SignalOpenFilterMethod, ::Oscillator_Cross_Timeframe_SignalOpenLevel, ::Oscillator_Cross_Timeframe_SignalOpenBoostMethod, ::Oscillator_Cross_Timeframe_SignalCloseMethod, ::Oscillator_Cross_Timeframe_SignalCloseFilter, ::Oscillator_Cross_Timeframe_SignalCloseLevel, ::Oscillator_Cross_Timeframe_PriceStopMethod, ::Oscillator_Cross_Timeframe_PriceStopLevel, ::Oscillator_Cross_Timeframe_TickFilterMethod, - ::Oscillator_Cross_Timeframe_MaxSpread, ::Oscillator_Cross_Timeframe_Shift), - shift1(0), - shift2(0) { + ::Oscillator_Cross_Timeframe_MaxSpread, ::Oscillator_Cross_Timeframe_Shift) { Set(STRAT_PARAM_LS, ::Oscillator_Cross_Timeframe_LotSize); Set(STRAT_PARAM_OCL, ::Oscillator_Cross_Timeframe_OrderCloseLoss); Set(STRAT_PARAM_OCP, ::Oscillator_Cross_Timeframe_OrderCloseProfit); Set(STRAT_PARAM_OCT, ::Oscillator_Cross_Timeframe_OrderCloseTime); Set(STRAT_PARAM_SOFT, ::Oscillator_Cross_Timeframe_SignalOpenFilterTime); } - // Getters. - uint GetShift1() { return shift1; } - uint GetShift2() { return shift2; } - // Setters. - void SetShift1(uint _value) { shift1 = _value; } - void SetShift2(uint _value) { shift2 = _value; } }; class Stg_Oscillator_Cross_Timeframe : public Strategy { - protected: - Stg_Oscillator_Cross_Timeframe_Params_Defaults ssparams; - public: Stg_Oscillator_Cross_Timeframe(StgParams &_sparams, TradeParams &_tparams, ChartParams &_cparams, string _name = "") : Strategy(_sparams, _tparams, _cparams, _name) {} @@ -279,7 +244,6 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { TradeParams _tparams; Stg_Oscillator_Cross_Timeframe *_strat = new Stg_Oscillator_Cross_Timeframe(_stg_params, _tparams, _cparams, "Oscillator Cross Timeframe"); - _strat.ssparams = stg_oscillator_cross_timeframe_defaults; return _strat; } @@ -421,10 +385,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_AC_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_AC(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_AC_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_AC(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_AC_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_AC_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD: // AD @@ -433,10 +395,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_AD_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_AD(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_AD_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_AD(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_AD_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_AD_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AO: // AO @@ -445,10 +405,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_Awesome_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_AO(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_Awesome_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_AO(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_Awesome_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_Awesome_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ATR: // ATR @@ -458,10 +416,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_ATR_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_ATR(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_ATR_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_ATR(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_ATR_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_ATR_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BEARS: // Bears @@ -472,10 +428,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_BearsPower_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_BearsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_BearsPower_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_BearsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_BearsPower_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_BearsPower_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BULLS: // Bulls @@ -486,10 +440,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_BullsPower_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_BullsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_BullsPower_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_BullsPower(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_BullsPower_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_BullsPower_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_BWMFI: // BWMFI @@ -498,10 +450,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_BWMFI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_BWMFI(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_BWMFI_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_BWMFI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_BWMFI_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_BWMFI_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CCI: // CCI @@ -512,10 +462,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_CCI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_CCI(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_CCI_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_CCI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_CCI_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_CCI_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHO: // Chaikin (CHO) @@ -527,10 +475,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_CHO_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_CHO(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_CHO_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_CHO(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_CHO_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_CHO_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_CHV: // Chaikin Volatility (CHV) @@ -541,10 +487,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_CHV_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_CHV(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_CHV_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_CHV(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_CHV_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_CHV_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_DEMARKER: // DeMarker @@ -554,10 +498,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_DeMarker_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_DeMarker(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_DeMarker_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_DeMarker(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_DeMarker_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_DeMarker_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MFI: // MFI @@ -568,10 +510,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_MFI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_MFI(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_MFI_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_MFI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_MFI_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_MFI_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_MOM: // MOM @@ -582,10 +522,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_Momentum_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_Momentum(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_Momentum_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_Momentum(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_Momentum_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_Momentum_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_OBV: // OBV @@ -595,10 +533,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_OBV_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_OBV(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_OBV_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_OBV(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_OBV_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_OBV_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_PVT: // PVT @@ -608,10 +544,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_PVT_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_PriceVolumeTrend(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_PVT_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_PriceVolumeTrend(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_PVT_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_PVT_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_ROC: // ROC @@ -622,10 +556,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_ROC_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_RateOfChange(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_ROC_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_RateOfChange(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_ROC_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_ROC_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_RSI: // RSI @@ -636,10 +568,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_RSI_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_RSI(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_RSI_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_RSI(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_RSI_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_RSI_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STDDEV: // StdDev @@ -651,10 +581,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_StdDev_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_StdDev(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_StdDev_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_StdDev(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_StdDev_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_StdDev_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_STOCH: // Stochastic @@ -668,10 +596,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_Stochastic_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_Stochastic(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_Stochastic_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_Stochastic(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_Stochastic_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_Stochastic_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_TRIX: // TRIX @@ -682,10 +608,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_TRIX_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_TRIX(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_TRIX_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_TRIX(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_TRIX_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_TRIX_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_UO: // UO @@ -698,10 +622,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_UO_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_UltimateOscillator(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_UO_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_UltimateOscillator(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_UO_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_UO_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WAD: // Williams' AD @@ -710,10 +632,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(Oscillator_Cross_Timeframe_Indi_WAD_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_WilliamsAD(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_WAD_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_WilliamsAD(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_WAD_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_WAD_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_WPR: // WPR @@ -723,10 +643,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_WPR_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_WPR(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_WPR_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_WPR(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_WPR_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_WPR_Shift2); break; } case STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_VOL: // Volumes @@ -736,10 +654,8 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { _indi_params.SetDataSourceType(::Oscillator_Cross_Timeframe_Indi_VOL_SourceType); _indi_params.SetTf(Get(STRAT_PARAM_TF)); SetIndicator(new Indi_Volumes(_indi_params), ::Oscillator_Cross_Timeframe_Type); - _indi_params.SetShift(::Oscillator_Cross_Timeframe_Indi_VOL_Shift2); + _indi_params.SetTf(::Oscillator_Cross_Timeframe_Tf); SetIndicator(new Indi_Volumes(_indi_params), ::Oscillator_Cross_Timeframe_Type + 1); - ssparams.SetShift1(Oscillator_Cross_Timeframe_Indi_VOL_Shift); - ssparams.SetShift2(Oscillator_Cross_Timeframe_Indi_VOL_Shift2); break; } /* @todo: Convert multi into single mode. @@ -806,51 +722,50 @@ class Stg_Oscillator_Cross_Timeframe : public Strategy { bool SignalOpen(ENUM_ORDER_TYPE _cmd, int _method, float _level = 0.0f, int _shift = 0) { IndicatorBase *_indi1 = GetIndicator(::Oscillator_Cross_Timeframe_Type); IndicatorBase *_indi2 = GetIndicator(::Oscillator_Cross_Timeframe_Type + 1); - // uint _ishift1 = _indi1.GetParams().GetShift(); // @todo: Convert into Get(). - // uint _ishift2 = _indi2.GetParams().GetShift(); // @todo: Convert into Get(). - uint _ishift1 = ssparams.GetShift1(); - uint _ishift2 = ssparams.GetShift2(); + // uint _ishift = _indi1.GetParams().GetShift(); // @todo: Convert into Get(). + // uint _ishift = _indi2.GetParams().GetShift(); // @todo: Convert into Get(). + uint _ishift = _shift; bool _result = Oscillator_Cross_Timeframe_Type != STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_0_NONE && - IsValidEntry(_indi1, _ishift1) && IsValidEntry(_indi2, _ishift2); + IsValidEntry(_indi1, _ishift) && IsValidEntry(_indi2, _ishift); if (!_result) { // Returns false when indicator data is not valid. return false; } - double _value1 = _indi1[_ishift1][0]; - double _value2 = _indi2[_ishift2][0]; + double _value1 = _indi1[_ishift][0]; + double _value2 = _indi2[_ishift][0]; switch (_cmd) { case ORDER_TYPE_BUY: // Buy signal. - _result &= _indi1.IsIncreasing(1, 0, _ishift1); - _result &= _indi1[_ishift1][0] > _indi2[_ishift2][0]; - _result &= _indi1[_ishift1 + 1][0] < _indi2[_ishift2 + 1][0]; - _result &= Math::ChangeInPct(_indi1[_ishift1 + 1][0], _indi1[_ishift1][0], true) > _level; + _result &= _indi1.IsIncreasing(1, 0, _ishift); + _result &= _indi1[_ishift][0] > _indi2[_ishift][0]; + _result &= _indi1[_ishift + 1][0] < _indi2[_ishift + 1][0]; + _result &= Math::ChangeInPct(_indi1[_ishift + 1][0], _indi1[_ishift][0], true) > _level; if (_result && _method != 0) { - if (METHOD(_method, 0)) _result &= _indi1[_ishift1][0] < _indi1[_ishift1 + 3][0]; - if (METHOD(_method, 1)) _result &= _indi2[_ishift2][0] < _indi2[_ishift2 + 3][0]; + if (METHOD(_method, 0)) _result &= _indi1[_ishift][0] < _indi1[_ishift + 3][0]; + if (METHOD(_method, 1)) _result &= _indi2[_ishift][0] < _indi2[_ishift + 3][0]; if (METHOD(_method, 2)) - _result &= fmax4(_indi1[_ishift1][0], _indi1[_ishift1 + 1][0], _indi1[_ishift1 + 2][0], - _indi1[_ishift1 + 3][0]) == _indi1[_ishift1][0]; + _result &= fmax4(_indi1[_ishift][0], _indi1[_ishift + 1][0], _indi1[_ishift + 2][0], + _indi1[_ishift + 3][0]) == _indi1[_ishift][0]; if (METHOD(_method, 3)) - _result &= fmax4(_indi2[_ishift2][0], _indi2[_ishift2 + 1][0], _indi2[_ishift2 + 2][0], - _indi2[_ishift2 + 3][0]) == _indi2[_ishift2][0]; + _result &= fmax4(_indi2[_ishift][0], _indi2[_ishift + 1][0], _indi2[_ishift + 2][0], + _indi2[_ishift + 3][0]) == _indi2[_ishift][0]; } break; case ORDER_TYPE_SELL: // Sell signal. - _result &= _indi1.IsDecreasing(1, 0, _ishift1); - _result &= _indi1[_ishift1][0] < _indi2[_ishift2][0]; - _result &= _indi1[_ishift1 + 1][0] > _indi2[_ishift2 + 1][0]; - _result &= Math::ChangeInPct(_indi1[_ishift1 + 1][0], _indi1[_ishift1][0], true) < _level; + _result &= _indi1.IsDecreasing(1, 0, _ishift); + _result &= _indi1[_ishift][0] < _indi2[_ishift][0]; + _result &= _indi1[_ishift + 1][0] > _indi2[_ishift + 1][0]; + _result &= Math::ChangeInPct(_indi1[_ishift + 1][0], _indi1[_ishift][0], true) < _level; if (_result && _method != 0) { - if (METHOD(_method, 0)) _result &= _indi1[_ishift1][0] > _indi1[_ishift1 + 3][0]; - if (METHOD(_method, 1)) _result &= _indi2[_ishift2][0] > _indi2[_ishift2 + 3][0]; + if (METHOD(_method, 0)) _result &= _indi1[_ishift][0] > _indi1[_ishift + 3][0]; + if (METHOD(_method, 1)) _result &= _indi2[_ishift][0] > _indi2[_ishift + 3][0]; if (METHOD(_method, 2)) - _result &= fmin4(_indi1[_ishift1][0], _indi1[_ishift1 + 1][0], _indi1[_ishift1 + 2][0], - _indi1[_ishift1 + 3][0]) == _indi1[_ishift1][0]; + _result &= fmin4(_indi1[_ishift][0], _indi1[_ishift + 1][0], _indi1[_ishift + 2][0], + _indi1[_ishift + 3][0]) == _indi1[_ishift][0]; if (METHOD(_method, 3)) - _result &= fmin4(_indi2[_ishift2][0], _indi2[_ishift2 + 1][0], _indi2[_ishift2 + 2][0], - _indi2[_ishift2 + 3][0]) == _indi2[_ishift2][0]; + _result &= fmin4(_indi2[_ishift][0], _indi2[_ishift + 1][0], _indi2[_ishift + 2][0], + _indi2[_ishift + 3][0]) == _indi2[_ishift][0]; } break; } From 73d070aeb1c54b2357fcbda37aa280bb1f2815db Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 24 Oct 2023 01:38:45 +0100 Subject: [PATCH 4/4] Sets TRIX as default strategy --- Stg_Oscillator_Cross_Timeframe.mqh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stg_Oscillator_Cross_Timeframe.mqh b/Stg_Oscillator_Cross_Timeframe.mqh index bf6c372..7b7ddcf 100644 --- a/Stg_Oscillator_Cross_Timeframe.mqh +++ b/Stg_Oscillator_Cross_Timeframe.mqh @@ -40,7 +40,7 @@ enum ENUM_STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE { // User input params. INPUT_GROUP("Oscillator Cross Timeframe strategy: main strategy params"); INPUT ENUM_STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE Oscillator_Cross_Timeframe_Type = - STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_AD; // Oscillator type + STG_OSCILLATOR_CROSS_TIMEFRAME_TYPE_TRIX; // Oscillator type INPUT ENUM_TIMEFRAMES Oscillator_Cross_Timeframe_Tf = PERIOD_H6; // Oscillator timeframe to cross INPUT_GROUP("Oscillator Cross Timeframe strategy: strategy params"); INPUT float Oscillator_Cross_Timeframe_LotSize = 0; // Lot size