5718 lines
148 KiB
Plaintext
5718 lines
148 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 Helper Class Library
|
|
// ----------------------------------------------
|
|
// Name: XSCXCHICHHelper
|
|
// Description: provides all Indicator
|
|
// Helper requirements ...
|
|
//
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
//
|
|
// Global Properties ...
|
|
#property library
|
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
|
#property link "https://www.saherelm.ir"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//
|
|
// Imports ...
|
|
#include "../Classes/x-saherelm.xhelper.class.mq5"
|
|
|
|
//
|
|
// Ichimoku Lines Calculator Mode ...
|
|
enum ENUM_X_ICHIMOKU_CALCULATION_MODE
|
|
{
|
|
//
|
|
X_XICH_HH_LL_MODE = 1, // Highest High and Lowest Low
|
|
X_XICH_HO_LC_MODE = 2, // Highest Open and Lowest Close
|
|
};
|
|
|
|
//
|
|
enum ENUM_XCHICH_BUFFERS
|
|
{
|
|
//
|
|
// Current ...
|
|
XCHICH_C_TK_LINE = 0,
|
|
XCHICH_C_KJ_LINE = 1,
|
|
XCHICH_C_CH_LINE = 2,
|
|
XCHICH_C_SSA_LINE = 3,
|
|
XCHICH_C_SSB_LINE = 4,
|
|
//
|
|
// Short ...
|
|
XCHICH_S_TK_LINE = 5,
|
|
XCHICH_S_KJ_LINE = 6,
|
|
XCHICH_S_CH_LINE = 7,
|
|
XCHICH_S_SSA_LINE = 8,
|
|
XCHICH_S_SSB_LINE = 9,
|
|
//
|
|
// Medium ...
|
|
XCHICH_M_TK_LINE = 10,
|
|
XCHICH_M_KJ_LINE = 11,
|
|
XCHICH_M_CH_LINE = 12,
|
|
XCHICH_M_SSA_LINE = 13,
|
|
XCHICH_M_SSB_LINE = 14,
|
|
//
|
|
// Long ...
|
|
XCHICH_L_TK_LINE = 15,
|
|
XCHICH_L_KJ_LINE = 16,
|
|
XCHICH_L_CH_LINE = 17,
|
|
XCHICH_L_SSA_LINE = 18,
|
|
XCHICH_L_SSB_LINE = 19,
|
|
//
|
|
// Hind ...
|
|
XCHICH_H_TK_LINE = 20,
|
|
XCHICH_H_KJ_LINE = 21,
|
|
XCHICH_H_CH_LINE = 22,
|
|
XCHICH_H_SSA_LINE = 23,
|
|
XCHICH_H_SSB_LINE = 24,
|
|
};
|
|
|
|
//
|
|
// Input Models ...
|
|
struct XCHICHInputs
|
|
{
|
|
//
|
|
// Props ...
|
|
|
|
//
|
|
// Market ...
|
|
|
|
//
|
|
// TENKANSEN ...
|
|
|
|
//
|
|
// Tenkan Sen ...
|
|
int tenkanSenLength; // Length
|
|
ENUM_X_ICHIMOKU_CALCULATION_MODE tenkanSenMode; // Calculation Mode
|
|
|
|
//
|
|
// KIJUNSEN ...
|
|
|
|
//
|
|
// Kijun Sen ...
|
|
int kijunSenLength; // Length
|
|
ENUM_X_ICHIMOKU_CALCULATION_MODE kijunSenMode; // Calculation Mode
|
|
|
|
//
|
|
// SENKOUSPANB ...
|
|
|
|
//
|
|
// Senkou Span B ...
|
|
int senkouSpanBLength; // Length
|
|
ENUM_X_ICHIMOKU_CALCULATION_MODE senkouSpanBMode; // Calculation Mode
|
|
|
|
//
|
|
// CHIKOUSPAN ...
|
|
|
|
//
|
|
// Chikou Span ...
|
|
ENUM_APPLIED_PRICE chikuoSpanAppliedTo; // Price Type
|
|
|
|
//
|
|
// Cycles ...
|
|
|
|
//
|
|
// Short ...
|
|
ENUM_X_PERIOD_METHOD scMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES scPeriod; // Time Period
|
|
|
|
//
|
|
// Medium ...
|
|
ENUM_X_PERIOD_METHOD mcMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES mcPeriod; // Time Period
|
|
|
|
//
|
|
// Long ...
|
|
ENUM_X_PERIOD_METHOD lcMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES lcPeriod; // Time Period
|
|
|
|
//
|
|
// Hind ...
|
|
ENUM_X_PERIOD_METHOD hcMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES hcPeriod; // Time Period
|
|
|
|
//
|
|
// Presentation ...
|
|
|
|
//
|
|
// Ichimoku ...
|
|
bool showTenkanSen; // Show Tenkan Sen
|
|
bool showKijunSen; // Show Kijun Sen
|
|
bool showChikouSpan; // Show Chikou Span
|
|
bool showSenkouSpanA; // Show Senkou Span A
|
|
bool showSenkouSpanB; // Show Senkou Span B
|
|
bool showKumo; // Show Kumo
|
|
bool shiftKumo; // Shift Kumo to Future
|
|
|
|
//
|
|
bool showCurrent; // Show Current Cycle
|
|
bool showShort; // Show Short Cycle
|
|
bool showMedium; // Show Medium Cycle
|
|
bool showLong; // Show Long Cycle
|
|
bool showHind; // Show Hind Cycle
|
|
|
|
//
|
|
// Constructor(s) ...
|
|
XCHICHInputs()
|
|
{
|
|
//
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
//
|
|
// Clean ...
|
|
void Clean()
|
|
{
|
|
//
|
|
kijunSenLength = 0;
|
|
tenkanSenLength = 0;
|
|
senkouSpanBLength = 0;
|
|
kijunSenMode = X_XICH_HH_LL_MODE;
|
|
tenkanSenMode = X_XICH_HH_LL_MODE;
|
|
chikuoSpanAppliedTo = PRICE_CLOSE;
|
|
senkouSpanBMode = X_XICH_HH_LL_MODE;
|
|
|
|
//
|
|
scMethod = X_PERIOD_AUTO;
|
|
scPeriod = NULL;
|
|
mcMethod = X_PERIOD_AUTO;
|
|
mcPeriod = NULL;
|
|
lcMethod = X_PERIOD_AUTO;
|
|
lcPeriod = NULL;
|
|
hcMethod = X_PERIOD_AUTO;
|
|
hcPeriod = NULL;
|
|
|
|
//
|
|
showTenkanSen = false;
|
|
showKijunSen = false;
|
|
showChikouSpan = false;
|
|
showSenkouSpanA = false;
|
|
showSenkouSpanB = false;
|
|
showKumo = false;
|
|
shiftKumo = true;
|
|
|
|
//
|
|
showCurrent = false;
|
|
showShort = false;
|
|
showMedium = false;
|
|
showLong = false;
|
|
showHind = false;
|
|
}
|
|
|
|
//
|
|
// Default ...
|
|
void Default()
|
|
{
|
|
//
|
|
kijunSenLength = 26;
|
|
tenkanSenLength = 9;
|
|
senkouSpanBLength = 52;
|
|
kijunSenMode = X_XICH_HH_LL_MODE;
|
|
tenkanSenMode = X_XICH_HH_LL_MODE;
|
|
chikuoSpanAppliedTo = PRICE_CLOSE;
|
|
senkouSpanBMode = X_XICH_HH_LL_MODE;
|
|
|
|
//
|
|
scMethod = X_PERIOD_AUTO;
|
|
scPeriod = NULL;
|
|
mcMethod = X_PERIOD_AUTO;
|
|
mcPeriod = NULL;
|
|
lcMethod = X_PERIOD_AUTO;
|
|
lcPeriod = NULL;
|
|
hcMethod = X_PERIOD_AUTO;
|
|
hcPeriod = NULL;
|
|
|
|
//
|
|
showTenkanSen = true;
|
|
showKijunSen = true;
|
|
showChikouSpan = true;
|
|
showSenkouSpanA = true;
|
|
showSenkouSpanB = true;
|
|
showKumo = true;
|
|
shiftKumo = true;
|
|
|
|
//
|
|
showCurrent = true;
|
|
showShort = true;
|
|
showMedium = true;
|
|
showLong = true;
|
|
showHind = true;
|
|
}
|
|
|
|
//
|
|
// Validate ...
|
|
bool IsValid()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
//
|
|
(tenkanSenLength > 2 &&
|
|
kijunSenLength > tenkanSenLength &&
|
|
senkouSpanBLength > kijunSenLength)
|
|
//
|
|
&&
|
|
//
|
|
(IsValid(scMethod, scPeriod) &&
|
|
IsValid(mcMethod, mcPeriod) &&
|
|
IsValid(lcMethod, lcPeriod) &&
|
|
IsValid(hcMethod, hcPeriod))
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Retrieve MAx Length ...
|
|
int Max()
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
result = MathMax(tenkanSenLength, kijunSenLength);
|
|
result = MathMax(result, senkouSpanBLength);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
};
|
|
|
|
//
|
|
// Define Conditions ...
|
|
struct XCHICHConditions
|
|
{
|
|
//
|
|
// Common ...
|
|
string symbol;
|
|
ENUM_TIMEFRAMES period;
|
|
datetime time;
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
// Current ...
|
|
double cTK[];
|
|
double cKJ[];
|
|
double cChik[];
|
|
double cSSA[];
|
|
double cSSB[];
|
|
double cFSSA[];
|
|
double cFSSB[];
|
|
|
|
//
|
|
// Short ...
|
|
double sTK[];
|
|
double sKJ[];
|
|
double sChik[];
|
|
double sSSA[];
|
|
double sSSB[];
|
|
double sFSSA[];
|
|
double sFSSB[];
|
|
|
|
//
|
|
// Medium ...
|
|
double mTK[];
|
|
double mKJ[];
|
|
double mChik[];
|
|
double mSSA[];
|
|
double mSSB[];
|
|
double mFSSA[];
|
|
double mFSSB[];
|
|
|
|
//
|
|
// Long ...
|
|
double lTK[];
|
|
double lKJ[];
|
|
double lChik[];
|
|
double lSSA[];
|
|
double lSSB[];
|
|
double lFSSA[];
|
|
double lFSSB[];
|
|
|
|
//
|
|
// Hind ...
|
|
double hTK[];
|
|
double hKJ[];
|
|
double hChik[];
|
|
double hSSA[];
|
|
double hSSB[];
|
|
double hFSSA[];
|
|
double hFSSB[];
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
// Current ...
|
|
|
|
//
|
|
bool isCClosedOverKijunSen;
|
|
bool isCClosedUnderKijunSen;
|
|
bool isCTenkanSenOverKijunSen;
|
|
bool isCTenkanSenUnderKijunSen;
|
|
bool isCTenkanSenCrossedOverKijunSen;
|
|
bool isCTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
bool isCSenkouSpanAOverB;
|
|
bool isCSenkouSpanAUnderB;
|
|
bool isCSenkouSpanAOverLast;
|
|
bool isCSenkouSpanAUnderLast;
|
|
bool isCFutureSenkouSpanAOverB;
|
|
bool isCFutureSenkouSpanAUnderB;
|
|
bool isCFutureSenkouSpanAOverLast;
|
|
bool isCFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
bool isCSenkouSpanACrossedOverB;
|
|
bool isCSenkouSpanACrossedUnderB;
|
|
bool isCSenkouSpanACrossedOverLast;
|
|
bool isCSenkouSpanACrossedUnderLast;
|
|
bool isCFutureSenkouSpanACrossedOverB;
|
|
bool isCFutureSenkouSpanACrossedUnderB;
|
|
bool isCFutureSenkouSpanACrossedOverLast;
|
|
bool isCFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Short ...
|
|
|
|
//
|
|
bool isSClosedOverKijunSen;
|
|
bool isSClosedUnderKijunSen;
|
|
bool isSTenkanSenOverKijunSen;
|
|
bool isSTenkanSenUnderKijunSen;
|
|
bool isSTenkanSenCrossedOverKijunSen;
|
|
bool isSTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
bool isSSenkouSpanAOverB;
|
|
bool isSSenkouSpanAUnderB;
|
|
bool isSSenkouSpanAOverLast;
|
|
bool isSSenkouSpanAUnderLast;
|
|
bool isSFutureSenkouSpanAOverB;
|
|
bool isSFutureSenkouSpanAUnderB;
|
|
bool isSFutureSenkouSpanAOverLast;
|
|
bool isSFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
bool isSSenkouSpanACrossedOverB;
|
|
bool isSSenkouSpanACrossedUnderB;
|
|
bool isSSenkouSpanACrossedOverLast;
|
|
bool isSSenkouSpanACrossedUnderLast;
|
|
bool isSFutureSenkouSpanACrossedOverB;
|
|
bool isSFutureSenkouSpanACrossedUnderB;
|
|
bool isSFutureSenkouSpanACrossedOverLast;
|
|
bool isSFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Medium ...
|
|
|
|
//
|
|
bool isMClosedOverKijunSen;
|
|
bool isMClosedUnderKijunSen;
|
|
bool isMTenkanSenOverKijunSen;
|
|
bool isMTenkanSenUnderKijunSen;
|
|
bool isMTenkanSenCrossedOverKijunSen;
|
|
bool isMTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
bool isMSenkouSpanAOverB;
|
|
bool isMSenkouSpanAUnderB;
|
|
bool isMSenkouSpanAOverLast;
|
|
bool isMSenkouSpanAUnderLast;
|
|
bool isMFutureSenkouSpanAOverB;
|
|
bool isMFutureSenkouSpanAUnderB;
|
|
bool isMFutureSenkouSpanAOverLast;
|
|
bool isMFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
bool isMSenkouSpanACrossedOverB;
|
|
bool isMSenkouSpanACrossedUnderB;
|
|
bool isMSenkouSpanACrossedOverLast;
|
|
bool isMSenkouSpanACrossedUnderLast;
|
|
bool isMFutureSenkouSpanACrossedOverB;
|
|
bool isMFutureSenkouSpanACrossedUnderB;
|
|
bool isMFutureSenkouSpanACrossedOverLast;
|
|
bool isMFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Long ...
|
|
|
|
//
|
|
bool isLClosedOverKijunSen;
|
|
bool isLClosedUnderKijunSen;
|
|
bool isLTenkanSenOverKijunSen;
|
|
bool isLTenkanSenUnderKijunSen;
|
|
bool isLTenkanSenCrossedOverKijunSen;
|
|
bool isLTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
bool isLSenkouSpanAOverB;
|
|
bool isLSenkouSpanAUnderB;
|
|
bool isLSenkouSpanAOverLast;
|
|
bool isLSenkouSpanAUnderLast;
|
|
bool isLFutureSenkouSpanAOverB;
|
|
bool isLFutureSenkouSpanAUnderB;
|
|
bool isLFutureSenkouSpanAOverLast;
|
|
bool isLFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
bool isLSenkouSpanACrossedOverB;
|
|
bool isLSenkouSpanACrossedUnderB;
|
|
bool isLSenkouSpanACrossedOverLast;
|
|
bool isLSenkouSpanACrossedUnderLast;
|
|
bool isLFutureSenkouSpanACrossedOverB;
|
|
bool isLFutureSenkouSpanACrossedUnderB;
|
|
bool isLFutureSenkouSpanACrossedOverLast;
|
|
bool isLFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Hind ...
|
|
|
|
//
|
|
bool isHClosedOverKijunSen;
|
|
bool isHClosedUnderKijunSen;
|
|
bool isHTenkanSenOverKijunSen;
|
|
bool isHTenkanSenUnderKijunSen;
|
|
bool isHTenkanSenCrossedOverKijunSen;
|
|
bool isHTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
bool isHSenkouSpanAOverB;
|
|
bool isHSenkouSpanAUnderB;
|
|
bool isHSenkouSpanAOverLast;
|
|
bool isHSenkouSpanAUnderLast;
|
|
bool isHFutureSenkouSpanAOverB;
|
|
bool isHFutureSenkouSpanAUnderB;
|
|
bool isHFutureSenkouSpanAOverLast;
|
|
bool isHFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
bool isHSenkouSpanACrossedOverB;
|
|
bool isHSenkouSpanACrossedUnderB;
|
|
bool isHSenkouSpanACrossedOverLast;
|
|
bool isHSenkouSpanACrossedUnderLast;
|
|
bool isHFutureSenkouSpanACrossedOverB;
|
|
bool isHFutureSenkouSpanACrossedUnderB;
|
|
bool isHFutureSenkouSpanACrossedOverLast;
|
|
bool isHFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
void Clean()
|
|
{
|
|
//
|
|
// Buffers ...
|
|
Clean(cTK);
|
|
Clean(cKJ);
|
|
Clean(cChik);
|
|
Clean(cSSA);
|
|
Clean(cSSB);
|
|
Clean(cFSSA);
|
|
Clean(cFSSB);
|
|
Clean(sTK);
|
|
Clean(sKJ);
|
|
Clean(sChik);
|
|
Clean(sSSA);
|
|
Clean(sSSB);
|
|
Clean(sFSSA);
|
|
Clean(sFSSB);
|
|
Clean(mTK);
|
|
Clean(mKJ);
|
|
Clean(mChik);
|
|
Clean(mSSA);
|
|
Clean(mSSB);
|
|
Clean(mFSSA);
|
|
Clean(mFSSB);
|
|
Clean(lTK);
|
|
Clean(lKJ);
|
|
Clean(lChik);
|
|
Clean(lSSA);
|
|
Clean(lSSB);
|
|
Clean(lFSSA);
|
|
Clean(lFSSB);
|
|
Clean(hTK);
|
|
Clean(hKJ);
|
|
Clean(hChik);
|
|
Clean(hSSA);
|
|
Clean(hSSB);
|
|
Clean(hFSSA);
|
|
Clean(hFSSB);
|
|
|
|
//
|
|
ArraySetAsSeries(cTK, true);
|
|
ArraySetAsSeries(cKJ, true);
|
|
ArraySetAsSeries(cChik, true);
|
|
ArraySetAsSeries(cSSA, true);
|
|
ArraySetAsSeries(cSSB, true);
|
|
ArraySetAsSeries(cFSSA, true);
|
|
ArraySetAsSeries(cFSSB, true);
|
|
ArraySetAsSeries(sTK, true);
|
|
ArraySetAsSeries(sKJ, true);
|
|
ArraySetAsSeries(sChik, true);
|
|
ArraySetAsSeries(sSSA, true);
|
|
ArraySetAsSeries(sSSB, true);
|
|
ArraySetAsSeries(sFSSA, true);
|
|
ArraySetAsSeries(sFSSB, true);
|
|
ArraySetAsSeries(mTK, true);
|
|
ArraySetAsSeries(mKJ, true);
|
|
ArraySetAsSeries(mChik, true);
|
|
ArraySetAsSeries(mSSA, true);
|
|
ArraySetAsSeries(mSSB, true);
|
|
ArraySetAsSeries(mFSSA, true);
|
|
ArraySetAsSeries(mFSSB, true);
|
|
ArraySetAsSeries(lTK, true);
|
|
ArraySetAsSeries(lKJ, true);
|
|
ArraySetAsSeries(lChik, true);
|
|
ArraySetAsSeries(lSSA, true);
|
|
ArraySetAsSeries(lSSB, true);
|
|
ArraySetAsSeries(lFSSA, true);
|
|
ArraySetAsSeries(lFSSB, true);
|
|
ArraySetAsSeries(hTK, true);
|
|
ArraySetAsSeries(hKJ, true);
|
|
ArraySetAsSeries(hChik, true);
|
|
ArraySetAsSeries(hSSA, true);
|
|
ArraySetAsSeries(hSSB, true);
|
|
ArraySetAsSeries(hFSSA, true);
|
|
ArraySetAsSeries(hFSSB, true);
|
|
|
|
//
|
|
// Current ...
|
|
|
|
//
|
|
isCClosedOverKijunSen = false;
|
|
isCClosedUnderKijunSen = false;
|
|
isCTenkanSenOverKijunSen = false;
|
|
isCTenkanSenUnderKijunSen = false;
|
|
isCTenkanSenCrossedOverKijunSen = false;
|
|
isCTenkanSenCrossedUnderKijunSen = false;
|
|
isCSenkouSpanAOverB = false;
|
|
isCSenkouSpanAUnderB = false;
|
|
isCSenkouSpanAOverLast = false;
|
|
isCSenkouSpanAUnderLast = false;
|
|
isCFutureSenkouSpanAOverB = false;
|
|
isCFutureSenkouSpanAUnderB = false;
|
|
isCFutureSenkouSpanAOverLast = false;
|
|
isCFutureSenkouSpanAUnderLast = false;
|
|
isCSenkouSpanACrossedOverB = false;
|
|
isCSenkouSpanACrossedUnderB = false;
|
|
isCSenkouSpanACrossedOverLast = false;
|
|
isCSenkouSpanACrossedUnderLast = false;
|
|
isCFutureSenkouSpanACrossedOverB = false;
|
|
isCFutureSenkouSpanACrossedUnderB = false;
|
|
isCFutureSenkouSpanACrossedOverLast = false;
|
|
isCFutureSenkouSpanACrossedUnderLast = false;
|
|
|
|
//
|
|
// Short ...
|
|
|
|
//
|
|
isSClosedOverKijunSen = false;
|
|
isSClosedUnderKijunSen = false;
|
|
isSTenkanSenOverKijunSen = false;
|
|
isSTenkanSenUnderKijunSen = false;
|
|
isSTenkanSenCrossedOverKijunSen = false;
|
|
isSTenkanSenCrossedUnderKijunSen = false;
|
|
isSSenkouSpanAOverB = false;
|
|
isSSenkouSpanAUnderB = false;
|
|
isSSenkouSpanAOverLast = false;
|
|
isSSenkouSpanAUnderLast = false;
|
|
isSFutureSenkouSpanAOverB = false;
|
|
isSFutureSenkouSpanAUnderB = false;
|
|
isSFutureSenkouSpanAOverLast = false;
|
|
isSFutureSenkouSpanAUnderLast = false;
|
|
isSSenkouSpanACrossedOverB = false;
|
|
isSSenkouSpanACrossedUnderB = false;
|
|
isSSenkouSpanACrossedOverLast = false;
|
|
isSSenkouSpanACrossedUnderLast = false;
|
|
isSFutureSenkouSpanACrossedOverB = false;
|
|
isSFutureSenkouSpanACrossedUnderB = false;
|
|
isSFutureSenkouSpanACrossedOverLast = false;
|
|
isSFutureSenkouSpanACrossedUnderLast = false;
|
|
|
|
//
|
|
// Medium ...
|
|
|
|
//
|
|
isMClosedOverKijunSen = false;
|
|
isMClosedUnderKijunSen = false;
|
|
isMTenkanSenOverKijunSen = false;
|
|
isMTenkanSenUnderKijunSen = false;
|
|
isMTenkanSenCrossedOverKijunSen = false;
|
|
isMTenkanSenCrossedUnderKijunSen = false;
|
|
isMSenkouSpanAOverB = false;
|
|
isMSenkouSpanAUnderB = false;
|
|
isMSenkouSpanAOverLast = false;
|
|
isMSenkouSpanAUnderLast = false;
|
|
isMFutureSenkouSpanAOverB = false;
|
|
isMFutureSenkouSpanAUnderB = false;
|
|
isMFutureSenkouSpanAOverLast = false;
|
|
isMFutureSenkouSpanAUnderLast = false;
|
|
isMSenkouSpanACrossedOverB = false;
|
|
isMSenkouSpanACrossedUnderB = false;
|
|
isMSenkouSpanACrossedOverLast = false;
|
|
isMSenkouSpanACrossedUnderLast = false;
|
|
isMFutureSenkouSpanACrossedOverB = false;
|
|
isMFutureSenkouSpanACrossedUnderB = false;
|
|
isMFutureSenkouSpanACrossedOverLast = false;
|
|
isMFutureSenkouSpanACrossedUnderLast = false;
|
|
|
|
//
|
|
// Long ...
|
|
|
|
//
|
|
isLClosedOverKijunSen = false;
|
|
isLClosedUnderKijunSen = false;
|
|
isLTenkanSenOverKijunSen = false;
|
|
isLTenkanSenUnderKijunSen = false;
|
|
isLTenkanSenCrossedOverKijunSen = false;
|
|
isLTenkanSenCrossedUnderKijunSen = false;
|
|
isLSenkouSpanAOverB = false;
|
|
isLSenkouSpanAUnderB = false;
|
|
isLSenkouSpanAOverLast = false;
|
|
isLSenkouSpanAUnderLast = false;
|
|
isLFutureSenkouSpanAOverB = false;
|
|
isLFutureSenkouSpanAUnderB = false;
|
|
isLFutureSenkouSpanAOverLast = false;
|
|
isLFutureSenkouSpanAUnderLast = false;
|
|
isLSenkouSpanACrossedOverB = false;
|
|
isLSenkouSpanACrossedUnderB = false;
|
|
isLSenkouSpanACrossedOverLast = false;
|
|
isLSenkouSpanACrossedUnderLast = false;
|
|
isLFutureSenkouSpanACrossedOverB = false;
|
|
isLFutureSenkouSpanACrossedUnderB = false;
|
|
isLFutureSenkouSpanACrossedOverLast = false;
|
|
isLFutureSenkouSpanACrossedUnderLast = false;
|
|
|
|
//
|
|
// Hind ...
|
|
|
|
//
|
|
isHClosedOverKijunSen = false;
|
|
isHClosedUnderKijunSen = false;
|
|
isHTenkanSenOverKijunSen = false;
|
|
isHTenkanSenUnderKijunSen = false;
|
|
isHTenkanSenCrossedOverKijunSen = false;
|
|
isHTenkanSenCrossedUnderKijunSen = false;
|
|
isHSenkouSpanAOverB = false;
|
|
isHSenkouSpanAUnderB = false;
|
|
isHSenkouSpanAOverLast = false;
|
|
isHSenkouSpanAUnderLast = false;
|
|
isHFutureSenkouSpanAOverB = false;
|
|
isHFutureSenkouSpanAUnderB = false;
|
|
isHFutureSenkouSpanAOverLast = false;
|
|
isHFutureSenkouSpanAUnderLast = false;
|
|
isHSenkouSpanACrossedOverB = false;
|
|
isHSenkouSpanACrossedUnderB = false;
|
|
isHSenkouSpanACrossedOverLast = false;
|
|
isHSenkouSpanACrossedUnderLast = false;
|
|
isHFutureSenkouSpanACrossedOverB = false;
|
|
isHFutureSenkouSpanACrossedUnderB = false;
|
|
isHFutureSenkouSpanACrossedOverLast = false;
|
|
isHFutureSenkouSpanACrossedUnderLast = false;
|
|
}
|
|
|
|
//
|
|
void GenerateScore(
|
|
double &bullishScore,
|
|
double &bearishScore //
|
|
)
|
|
{
|
|
//
|
|
bullishScore = 0;
|
|
bearishScore = 0;
|
|
|
|
//
|
|
// Current ...
|
|
|
|
//
|
|
if (isCClosedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCTenkanSenOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCTenkanSenCrossedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isCClosedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCTenkanSenUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCTenkanSenCrossedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isCFutureSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
|
|
//
|
|
// Short ...
|
|
|
|
//
|
|
if (isSClosedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSTenkanSenOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSTenkanSenCrossedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isSClosedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSTenkanSenUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSTenkanSenCrossedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSFutureSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
|
|
//
|
|
// Medium ...
|
|
|
|
//
|
|
if (isMClosedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMTenkanSenOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMTenkanSenCrossedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isMClosedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMTenkanSenUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMTenkanSenCrossedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMFutureSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
|
|
//
|
|
// Long ...
|
|
|
|
//
|
|
if (isLClosedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLTenkanSenOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLTenkanSenCrossedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isLClosedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLTenkanSenUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLTenkanSenCrossedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLFutureSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
|
|
//
|
|
// Hind ...
|
|
|
|
//
|
|
if (isHClosedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHTenkanSenOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHTenkanSenCrossedOverKijunSen)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanAOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanAOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanACrossedOverB)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanACrossedOverLast)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isHClosedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHTenkanSenUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHTenkanSenCrossedUnderKijunSen)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanAUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanAUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanACrossedUnderB)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHFutureSenkouSpanACrossedUnderLast)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
}
|
|
|
|
//
|
|
string GenerateSummary(
|
|
bool onlyCommons = false,
|
|
bool onlyConditions = false,
|
|
bool includeScores = true,
|
|
bool ignoreFalseConditions = true,
|
|
string separator = "\n" //
|
|
)
|
|
{
|
|
//
|
|
string result = NULL;
|
|
|
|
//
|
|
double bullishScore = 0;
|
|
double bearishScore = 0;
|
|
GenerateScore(
|
|
bullishScore,
|
|
bearishScore //
|
|
);
|
|
|
|
//
|
|
string scoresStr =
|
|
//
|
|
"Scores: " + separator +
|
|
"---------------" + separator +
|
|
"Bullish: " + ToString(bullishScore) + separator +
|
|
"Bearish: " + ToString(bearishScore) + separator +
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
string commonStr = GenerateSpecifiedCommonSummary(
|
|
this,
|
|
separator,
|
|
includeScores //
|
|
);
|
|
|
|
//
|
|
string conditionsStr =
|
|
//
|
|
// Current ...
|
|
ToString("isCClosedOverKijunSen", isCClosedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isCClosedUnderKijunSen", isCClosedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isCTenkanSenOverKijunSen", isCTenkanSenOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isCTenkanSenUnderKijunSen", isCTenkanSenUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isCTenkanSenCrossedOverKijunSen", isCTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isCTenkanSenCrossedUnderKijunSen", isCTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanAOverB", isCSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanAUnderB", isCSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanAOverLast", isCSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanAUnderLast", isCSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanAOverB", isCFutureSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanAUnderB", isCFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanAOverLast", isCFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanAUnderLast", isCFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanACrossedOverB", isCSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanACrossedUnderB", isCSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanACrossedOverLast", isCSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isCSenkouSpanACrossedUnderLast", isCSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanACrossedOverB", isCFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanACrossedUnderB", isCFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanACrossedOverLast", isCFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isCFutureSenkouSpanACrossedUnderLast", isCFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
//
|
|
// Short ...
|
|
ToString("isSClosedOverKijunSen", isSClosedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isSClosedUnderKijunSen", isSClosedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isSTenkanSenOverKijunSen", isSTenkanSenOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isSTenkanSenUnderKijunSen", isSTenkanSenUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isSTenkanSenCrossedOverKijunSen", isSTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isSTenkanSenCrossedUnderKijunSen", isSTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanAOverB", isSSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanAUnderB", isSSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanAOverLast", isSSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanAUnderLast", isSSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanAOverB", isSFutureSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanAUnderB", isSFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanAOverLast", isSFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanAUnderLast", isSFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanACrossedOverB", isSSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanACrossedUnderB", isSSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanACrossedOverLast", isSSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isSSenkouSpanACrossedUnderLast", isSSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanACrossedOverB", isSFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanACrossedUnderB", isSFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanACrossedOverLast", isSFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isSFutureSenkouSpanACrossedUnderLast", isSFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
//
|
|
// Medium ...
|
|
ToString("isMClosedOverKijunSen", isMClosedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isMClosedUnderKijunSen", isMClosedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isMTenkanSenOverKijunSen", isMTenkanSenOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isMTenkanSenUnderKijunSen", isMTenkanSenUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isMTenkanSenCrossedOverKijunSen", isMTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isMTenkanSenCrossedUnderKijunSen", isMTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanAOverB", isMSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanAUnderB", isMSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanAOverLast", isMSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanAUnderLast", isMSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanAOverB", isMFutureSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanAUnderB", isMFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanAOverLast", isMFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanAUnderLast", isMFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanACrossedOverB", isMSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanACrossedUnderB", isMSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanACrossedOverLast", isMSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isMSenkouSpanACrossedUnderLast", isMSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanACrossedOverB", isMFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanACrossedUnderB", isMFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanACrossedOverLast", isMFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isMFutureSenkouSpanACrossedUnderLast", isMFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
//
|
|
// Long ...
|
|
ToString("isLClosedOverKijunSen", isLClosedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isLClosedUnderKijunSen", isLClosedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isLTenkanSenOverKijunSen", isLTenkanSenOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isLTenkanSenUnderKijunSen", isLTenkanSenUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isLTenkanSenCrossedOverKijunSen", isLTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isLTenkanSenCrossedUnderKijunSen", isLTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanAOverB", isLSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanAUnderB", isLSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanAOverLast", isLSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanAUnderLast", isLSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanAOverB", isLFutureSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanAUnderB", isLFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanAOverLast", isLFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanAUnderLast", isLFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanACrossedOverB", isLSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanACrossedUnderB", isLSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanACrossedOverLast", isLSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isLSenkouSpanACrossedUnderLast", isLSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanACrossedOverB", isLFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanACrossedUnderB", isLFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanACrossedOverLast", isLFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isLFutureSenkouSpanACrossedUnderLast", isLFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
//
|
|
// Hind ...
|
|
ToString("isHClosedOverKijunSen", isHClosedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isHClosedUnderKijunSen", isHClosedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isHTenkanSenOverKijunSen", isHTenkanSenOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isHTenkanSenUnderKijunSen", isHTenkanSenUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isHTenkanSenCrossedOverKijunSen", isHTenkanSenCrossedOverKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isHTenkanSenCrossedUnderKijunSen", isHTenkanSenCrossedUnderKijunSen, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanAOverB", isHSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanAUnderB", isHSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanAOverLast", isHSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanAUnderLast", isHSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanAOverB", isHFutureSenkouSpanAOverB, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanAUnderB", isHFutureSenkouSpanAUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanAOverLast", isHFutureSenkouSpanAOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanAUnderLast", isHFutureSenkouSpanAUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanACrossedOverB", isHSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanACrossedUnderB", isHSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanACrossedOverLast", isHSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isHSenkouSpanACrossedUnderLast", isHSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanACrossedOverB", isHFutureSenkouSpanACrossedOverB, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanACrossedUnderB", isHFutureSenkouSpanACrossedUnderB, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanACrossedOverLast", isHFutureSenkouSpanACrossedOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isHFutureSenkouSpanACrossedUnderLast", isHFutureSenkouSpanACrossedUnderLast, ignoreFalseConditions, separator) +
|
|
//
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
result =
|
|
//
|
|
"[" + GetTag() + "]" + separator +
|
|
(onlyConditions
|
|
? ""
|
|
: commonStr) +
|
|
(!includeScores
|
|
? ""
|
|
: scoresStr) +
|
|
" " + separator +
|
|
(onlyCommons
|
|
? ""
|
|
: conditionsStr) +
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
string GetTag()
|
|
{
|
|
return "XCHICH";
|
|
}
|
|
};
|
|
|
|
//
|
|
// Class ...
|
|
class XSCXCHICHHelper : public XSCBaseHelper
|
|
{
|
|
//
|
|
// Public ...
|
|
public:
|
|
//
|
|
// Props ...
|
|
|
|
//
|
|
// Constructors ...
|
|
XSCXCHICHHelper() : XSCBaseHelper(_Symbol, _Period)
|
|
{
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
~XSCXCHICHHelper()
|
|
{
|
|
//
|
|
Clean(cTKBuffer);
|
|
Clean(cKJBuffer);
|
|
Clean(cChikBuffer);
|
|
Clean(cSSABuffer);
|
|
Clean(cSSBBuffer);
|
|
Clean(sTKBuffer);
|
|
Clean(sKJBuffer);
|
|
Clean(sChikBuffer);
|
|
Clean(sSSABuffer);
|
|
Clean(sSSBBuffer);
|
|
Clean(mTKBuffer);
|
|
Clean(mKJBuffer);
|
|
Clean(mChikBuffer);
|
|
Clean(mSSABuffer);
|
|
Clean(mSSBBuffer);
|
|
Clean(lTKBuffer);
|
|
Clean(lKJBuffer);
|
|
Clean(lChikBuffer);
|
|
Clean(lSSABuffer);
|
|
Clean(lSSBBuffer);
|
|
Clean(hTKBuffer);
|
|
Clean(hKJBuffer);
|
|
Clean(hChikBuffer);
|
|
Clean(hSSABuffer);
|
|
Clean(hSSBBuffer);
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
bool Init(
|
|
string symbol, // Trading Symbol
|
|
ENUM_TIMEFRAMES period, // Trading Period
|
|
XCHICHInputs &inputs // Inputs
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
mSymbol = symbol;
|
|
mPeriod = period;
|
|
|
|
//
|
|
result = inputs.IsValid();
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
mInputs = inputs;
|
|
|
|
//
|
|
ArraySetAsSeries(cTKBuffer, true);
|
|
ArraySetAsSeries(cKJBuffer, true);
|
|
ArraySetAsSeries(cChikBuffer, true);
|
|
ArraySetAsSeries(cSSABuffer, true);
|
|
ArraySetAsSeries(cSSBBuffer, true);
|
|
ArraySetAsSeries(sTKBuffer, true);
|
|
ArraySetAsSeries(sKJBuffer, true);
|
|
ArraySetAsSeries(sChikBuffer, true);
|
|
ArraySetAsSeries(sSSABuffer, true);
|
|
ArraySetAsSeries(sSSBBuffer, true);
|
|
ArraySetAsSeries(mTKBuffer, true);
|
|
ArraySetAsSeries(mKJBuffer, true);
|
|
ArraySetAsSeries(mChikBuffer, true);
|
|
ArraySetAsSeries(mSSABuffer, true);
|
|
ArraySetAsSeries(mSSBBuffer, true);
|
|
ArraySetAsSeries(lTKBuffer, true);
|
|
ArraySetAsSeries(lKJBuffer, true);
|
|
ArraySetAsSeries(lChikBuffer, true);
|
|
ArraySetAsSeries(lSSABuffer, true);
|
|
ArraySetAsSeries(lSSBBuffer, true);
|
|
ArraySetAsSeries(hTKBuffer, true);
|
|
ArraySetAsSeries(hKJBuffer, true);
|
|
ArraySetAsSeries(hChikBuffer, true);
|
|
ArraySetAsSeries(hSSABuffer, true);
|
|
ArraySetAsSeries(hSSBBuffer, true);
|
|
|
|
//
|
|
mHandler = iCustom(
|
|
mSymbol,
|
|
mPeriod,
|
|
"x-saherelm.xchich",
|
|
//
|
|
// Inputs ...
|
|
//
|
|
// Market ...
|
|
"",
|
|
//
|
|
// TENKANSEN ...
|
|
"",
|
|
mInputs.tenkanSenLength, // Length
|
|
mInputs.tenkanSenMode, // Calculation Mode
|
|
//
|
|
// KIJUNSEN ...
|
|
"",
|
|
mInputs.kijunSenLength, // Length
|
|
mInputs.kijunSenMode, // Calculation Mode
|
|
//
|
|
// SENKOUSPANB ...
|
|
"",
|
|
mInputs.senkouSpanBLength, // Length
|
|
mInputs.senkouSpanBMode, // Calculation Mode
|
|
//
|
|
// CHIKOUSPAN ...
|
|
"",
|
|
mInputs.chikuoSpanAppliedTo, // Price Type
|
|
//
|
|
// Cycles ...
|
|
"",
|
|
//
|
|
// Short ...
|
|
"",
|
|
mInputs.scMethod,
|
|
mInputs.scPeriod,
|
|
//
|
|
// Medium ...
|
|
"",
|
|
mInputs.mcMethod,
|
|
mInputs.mcPeriod,
|
|
//
|
|
// Long ...
|
|
"",
|
|
mInputs.lcMethod,
|
|
mInputs.lcPeriod,
|
|
//
|
|
// Hind ...
|
|
"",
|
|
mInputs.hcMethod,
|
|
mInputs.hcPeriod,
|
|
//
|
|
// Presentation ...
|
|
"",
|
|
//
|
|
// Ichimoku ...
|
|
mInputs.showTenkanSen, // Show Tenkan Sen
|
|
mInputs.showKijunSen, // Show Kijun Sen
|
|
mInputs.showChikouSpan, // Show Chikou Span
|
|
mInputs.showSenkouSpanA, // Show Senkou Span A
|
|
mInputs.showSenkouSpanB, // Show Senkou Span B
|
|
mInputs.showKumo, // Show Kumo
|
|
mInputs.shiftKumo, // Shift Kumo to Future
|
|
//
|
|
// Cycles ...
|
|
mInputs.showCurrent, // Show Current Cycle
|
|
mInputs.showShort, // Show Short Cycle
|
|
mInputs.showMedium, // Show Medium Cycle
|
|
mInputs.showLong, // Show Long Cycle
|
|
mInputs.showHind // Show Hind Cycle
|
|
//
|
|
);
|
|
result = mHandler != INVALID_HANDLE;
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
// Current ...
|
|
|
|
//
|
|
// TENKANSEN ...
|
|
|
|
//
|
|
double GetCTenkanSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return cTKBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyCTenkanSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
cTKBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// KIJUNSEN ...
|
|
|
|
//
|
|
double GetCKijunSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return cKJBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyCKijunSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
cKJBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// CHIKOUSPAN ...
|
|
|
|
//
|
|
double GetCChikouSpan(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
barIndex -= mInputs.kijunSenLength;
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return cChikBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyCChikouSpan(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - mInputs.kijunSenLength,
|
|
count,
|
|
cChikBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANA ...
|
|
|
|
//
|
|
double GetCSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return cSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyCSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
cSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANB ...
|
|
|
|
//
|
|
double GetCSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return cSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyCSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
cSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANA ...
|
|
|
|
//
|
|
double GetCFutureSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
barIndex -= mInputs.kijunSenLength;
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return cSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyCFutureSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - mInputs.kijunSenLength,
|
|
count,
|
|
cSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANB ...
|
|
|
|
//
|
|
double GetCFutureSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
barIndex -= mInputs.kijunSenLength;
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return cSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyCFutureSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - mInputs.kijunSenLength,
|
|
count,
|
|
cSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Short ...
|
|
|
|
//
|
|
// TENKANSEN ...
|
|
|
|
//
|
|
double GetSTenkanSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return sTKBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopySTenkanSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
sTKBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// KIJUNSEN ...
|
|
|
|
//
|
|
double GetSKijunSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return sKJBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopySKijunSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
sKJBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// CHIKOUSPAN ...
|
|
|
|
//
|
|
double GetSChikouSpan(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_SHORT, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return sChikBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopySChikouSpan(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_SHORT, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
sChikBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANA ...
|
|
|
|
//
|
|
double GetSSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return sSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopySSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
sSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANB ...
|
|
|
|
//
|
|
double GetSSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return sSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopySSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
sSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANA ...
|
|
|
|
//
|
|
double GetSFutureSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_SHORT, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return sSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopySFutureSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_SHORT, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
sSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANB ...
|
|
|
|
//
|
|
double GetSFutureSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_SHORT, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return sSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopySFutureSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_SHORT, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
sSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Medium ...
|
|
|
|
//
|
|
// TENKANSEN ...
|
|
|
|
//
|
|
double GetMTenkanSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return mTKBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyMTenkanSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
mTKBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// KIJUNSEN ...
|
|
|
|
//
|
|
double GetMKijunSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return mKJBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyMKijunSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
mKJBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// CHIKOUSPAN ...
|
|
|
|
//
|
|
double GetMChikouSpan(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_MEDIUM, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return mChikBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyMChikouSpan(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_MEDIUM, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
mChikBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANA ...
|
|
|
|
//
|
|
double GetMSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return mSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyMSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
mSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANB ...
|
|
|
|
//
|
|
double GetMSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return mSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyMSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
mSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANA ...
|
|
|
|
//
|
|
double GetMFutureSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_MEDIUM, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return mSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyMFutureSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_MEDIUM, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
mSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANB ...
|
|
|
|
//
|
|
double GetMFutureSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_MEDIUM, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return mSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyMFutureSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_MEDIUM, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
mSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Long ...
|
|
|
|
//
|
|
// TENKANSEN ...
|
|
|
|
//
|
|
double GetLTenkanSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return lTKBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyLTenkanSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
lTKBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// KIJUNSEN ...
|
|
|
|
//
|
|
double GetLKijunSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return lKJBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyLKijunSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
lKJBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// CHIKOUSPAN ...
|
|
|
|
//
|
|
double GetLChikouSpan(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_LONG, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return lChikBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyLChikouSpan(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_LONG, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
lChikBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANA ...
|
|
|
|
//
|
|
double GetLSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return lSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyLSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
lSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANB ...
|
|
|
|
//
|
|
double GetLSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return lSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyLSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
lSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANA ...
|
|
|
|
//
|
|
double GetLFutureSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_LONG, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return lSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyLFutureSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_LONG, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
lSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANB ...
|
|
|
|
//
|
|
double GetLFutureSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_LONG, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return lSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyLFutureSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_LONG, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
lSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Hind ...
|
|
|
|
//
|
|
// TENKANSEN ...
|
|
|
|
//
|
|
double GetHTenkanSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return hTKBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyHTenkanSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
hTKBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// KIJUNSEN ...
|
|
|
|
//
|
|
double GetHKijunSen(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return hKJBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyHKijunSen(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
hKJBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// CHIKOUSPAN ...
|
|
|
|
//
|
|
double GetHChikouSpan(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_HIND, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return hChikBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyHChikouSpan(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_HIND, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
hChikBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANA ...
|
|
|
|
//
|
|
double GetHSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return hSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyHSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
hSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SENKOUSPANB ...
|
|
|
|
//
|
|
double GetHSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return hSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyHSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
hSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANA ...
|
|
|
|
//
|
|
double GetHFutureSenkouSpanA(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_HIND, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return hSSABuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyHFutureSenkouSpanA(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_HIND, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
hSSABuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FUTURESENKOUSPANB ...
|
|
|
|
//
|
|
double GetHFutureSenkouSpanB(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_HIND, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
barIndex -= (mInputs.kijunSenLength * cycleLength);
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
return hSSBBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Buffer ...
|
|
int CopyHFutureSenkouSpanB(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
int cycleLength = GetCycleLengthOn(
|
|
mPeriod, // Host
|
|
X_MARKET_CYCLE_HIND, // Cycle
|
|
mInputs.scMethod, // Method
|
|
mInputs.scPeriod // Period
|
|
);
|
|
if (cycleLength <= 0)
|
|
{
|
|
cycleLength = 1;
|
|
}
|
|
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start - (mInputs.kijunSenLength * cycleLength),
|
|
count,
|
|
hSSBBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
//
|
|
void GetCycleValues(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES cycle, // Cycle
|
|
//
|
|
double &tenkanSen,
|
|
double &kijunSen,
|
|
double &chikouSpan,
|
|
double &senkouSpanA,
|
|
double &senkouSpanB,
|
|
double &futureSenkouSpanA,
|
|
double &futureSenkouSpanB //
|
|
)
|
|
{
|
|
//
|
|
tenkanSen = 0;
|
|
kijunSen = 0;
|
|
chikouSpan = 0;
|
|
senkouSpanA = 0;
|
|
senkouSpanB = 0;
|
|
futureSenkouSpanA = 0;
|
|
futureSenkouSpanB = 0;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
switch (cycle)
|
|
{
|
|
//
|
|
// Current ...
|
|
case X_MARKET_CYCLE_UNKNOWN:
|
|
//
|
|
tenkanSen = GetCTenkanSen(barIndex);
|
|
kijunSen = GetCKijunSen(barIndex);
|
|
chikouSpan = GetCChikouSpan(barIndex);
|
|
senkouSpanA = GetCSenkouSpanA(barIndex);
|
|
senkouSpanB = GetCSenkouSpanB(barIndex);
|
|
futureSenkouSpanA = GetCFutureSenkouSpanA(barIndex);
|
|
futureSenkouSpanB = GetCFutureSenkouSpanB(barIndex);
|
|
break;
|
|
|
|
//
|
|
// Short ...
|
|
case X_MARKET_CYCLE_SHORT:
|
|
//
|
|
tenkanSen = GetSTenkanSen(barIndex);
|
|
kijunSen = GetSKijunSen(barIndex);
|
|
chikouSpan = GetSChikouSpan(barIndex);
|
|
senkouSpanA = GetSSenkouSpanA(barIndex);
|
|
senkouSpanB = GetSSenkouSpanB(barIndex);
|
|
futureSenkouSpanA = GetSFutureSenkouSpanA(barIndex);
|
|
futureSenkouSpanB = GetSFutureSenkouSpanB(barIndex);
|
|
break;
|
|
|
|
//
|
|
// Medium ...
|
|
case X_MARKET_CYCLE_MEDIUM:
|
|
//
|
|
tenkanSen = GetMTenkanSen(barIndex);
|
|
kijunSen = GetMKijunSen(barIndex);
|
|
chikouSpan = GetMChikouSpan(barIndex);
|
|
senkouSpanA = GetMSenkouSpanA(barIndex);
|
|
senkouSpanB = GetMSenkouSpanB(barIndex);
|
|
futureSenkouSpanA = GetMFutureSenkouSpanA(barIndex);
|
|
futureSenkouSpanB = GetMFutureSenkouSpanB(barIndex);
|
|
break;
|
|
|
|
//
|
|
// Long ...
|
|
case X_MARKET_CYCLE_LONG:
|
|
//
|
|
tenkanSen = GetLTenkanSen(barIndex);
|
|
kijunSen = GetLKijunSen(barIndex);
|
|
chikouSpan = GetLChikouSpan(barIndex);
|
|
senkouSpanA = GetLSenkouSpanA(barIndex);
|
|
senkouSpanB = GetLSenkouSpanB(barIndex);
|
|
futureSenkouSpanA = GetLFutureSenkouSpanA(barIndex);
|
|
futureSenkouSpanB = GetLFutureSenkouSpanB(barIndex);
|
|
break;
|
|
|
|
//
|
|
// Hind ...
|
|
case X_MARKET_CYCLE_HIND:
|
|
//
|
|
tenkanSen = GetHTenkanSen(barIndex);
|
|
kijunSen = GetHKijunSen(barIndex);
|
|
chikouSpan = GetHChikouSpan(barIndex);
|
|
senkouSpanA = GetHSenkouSpanA(barIndex);
|
|
senkouSpanB = GetHSenkouSpanB(barIndex);
|
|
futureSenkouSpanA = GetHFutureSenkouSpanA(barIndex);
|
|
futureSenkouSpanB = GetHFutureSenkouSpanB(barIndex);
|
|
break;
|
|
}
|
|
}
|
|
|
|
//
|
|
int GetTenkanSenOverKijunSenCycles(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
Clean(cycles);
|
|
|
|
//
|
|
ENUM_X_MARKET_CYCLES allCycles[];
|
|
int allCyclesCount = GetAllMarketCycles(allCycles);
|
|
if (!IsValidSize(allCyclesCount))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
for (int i = 0; i < allCyclesCount; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
allCycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
bool isPassed =
|
|
iTenkanSen > iKijunSen;
|
|
if (isPassed)
|
|
{
|
|
//
|
|
Add(
|
|
allCycles[i],
|
|
cycles //
|
|
);
|
|
}
|
|
}
|
|
|
|
//
|
|
result = ArraySize(cycles);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
int GetTenkanSenUnderKijunSenCycles(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
Clean(cycles);
|
|
|
|
//
|
|
ENUM_X_MARKET_CYCLES allCycles[];
|
|
int allCyclesCount = GetAllMarketCycles(allCycles);
|
|
if (!IsValidSize(allCyclesCount))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
for (int i = 0; i < allCyclesCount; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
allCycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
bool isPassed =
|
|
iTenkanSen < iKijunSen;
|
|
if (isPassed)
|
|
{
|
|
//
|
|
Add(
|
|
allCycles[i],
|
|
cycles //
|
|
);
|
|
}
|
|
}
|
|
|
|
//
|
|
result = ArraySize(cycles);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
int GetSenkouSpanAOverBCycles(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
Clean(cycles);
|
|
|
|
//
|
|
ENUM_X_MARKET_CYCLES allCycles[];
|
|
int allCyclesCount = GetAllMarketCycles(allCycles);
|
|
if (!IsValidSize(allCyclesCount))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
for (int i = 0; i < allCyclesCount; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
allCycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
bool isPassed =
|
|
iSenkouSpanA > iSenkouSpanB;
|
|
if (isPassed)
|
|
{
|
|
//
|
|
Add(
|
|
allCycles[i],
|
|
cycles //
|
|
);
|
|
}
|
|
}
|
|
|
|
//
|
|
result = ArraySize(cycles);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
int GetSenkouSpanAUnderBCycles(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
Clean(cycles);
|
|
|
|
//
|
|
ENUM_X_MARKET_CYCLES allCycles[];
|
|
int allCyclesCount = GetAllMarketCycles(allCycles);
|
|
if (!IsValidSize(allCyclesCount))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
for (int i = 0; i < allCyclesCount; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
allCycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
bool isPassed =
|
|
iSenkouSpanA < iSenkouSpanB;
|
|
if (isPassed)
|
|
{
|
|
//
|
|
Add(
|
|
allCycles[i],
|
|
cycles //
|
|
);
|
|
}
|
|
}
|
|
|
|
//
|
|
result = ArraySize(cycles);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
int GetFutureSenkouSpanAOverBCycles(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
Clean(cycles);
|
|
|
|
//
|
|
ENUM_X_MARKET_CYCLES allCycles[];
|
|
int allCyclesCount = GetAllMarketCycles(allCycles);
|
|
if (!IsValidSize(allCyclesCount))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
for (int i = 0; i < allCyclesCount; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
allCycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
bool isPassed =
|
|
iFutureSenkouSpanA > iFutureSenkouSpanB;
|
|
if (isPassed)
|
|
{
|
|
//
|
|
Add(
|
|
allCycles[i],
|
|
cycles //
|
|
);
|
|
}
|
|
}
|
|
|
|
//
|
|
result = ArraySize(cycles);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
int GetFutureSenkouSpanAUnderBCycles(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
Clean(cycles);
|
|
|
|
//
|
|
ENUM_X_MARKET_CYCLES allCycles[];
|
|
int allCyclesCount = GetAllMarketCycles(allCycles);
|
|
if (!IsValidSize(allCyclesCount))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
for (int i = 0; i < allCyclesCount; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
allCycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
bool isPassed =
|
|
iFutureSenkouSpanA < iFutureSenkouSpanB;
|
|
if (isPassed)
|
|
{
|
|
//
|
|
Add(
|
|
allCycles[i],
|
|
cycles //
|
|
);
|
|
}
|
|
}
|
|
|
|
//
|
|
result = ArraySize(cycles);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesTenkanSensMax(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iTenkanSen,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMax(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesTenkanSensMin(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iTenkanSen,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMin(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesKijunSensMax(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iKijunSen,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMax(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesKijunSensMin(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iKijunSen,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMin(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesSenkouSpanAMax(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iSenkouSpanA,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMax(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesSenkouSpanAMin(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iSenkouSpanA,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMin(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesSenkouSpanBMax(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iSenkouSpanB,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMax(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesSenkouSpanBMin(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iSenkouSpanB,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMin(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesFutureSenkouSpanAMax(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iFutureSenkouSpanA,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMax(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesFutureSenkouSpanAMin(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iFutureSenkouSpanA,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMin(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesFutureSenkouSpanBMax(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iFutureSenkouSpanB,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMax(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetCyclesFutureSenkouSpanBMin(
|
|
int barIndex, // Bar Index
|
|
ENUM_X_MARKET_CYCLES &cycles[] // Result
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
int count = ArraySize(cycles);
|
|
if (!IsValidSize(count))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double values[];
|
|
|
|
//
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
//
|
|
double iTenkanSen = 0;
|
|
double iKijunSen = 0;
|
|
double iChikouSpan = 0;
|
|
double iSenkouSpanA = 0;
|
|
double iSenkouSpanB = 0;
|
|
double iFutureSenkouSpanA = 0;
|
|
double iFutureSenkouSpanB = 0;
|
|
GetCycleValues(
|
|
barIndex,
|
|
cycles[i],
|
|
iTenkanSen,
|
|
iKijunSen,
|
|
iChikouSpan,
|
|
iSenkouSpanA,
|
|
iSenkouSpanB,
|
|
iFutureSenkouSpanA,
|
|
iFutureSenkouSpanB //
|
|
);
|
|
|
|
//
|
|
Add(
|
|
iFutureSenkouSpanB,
|
|
values //
|
|
);
|
|
}
|
|
|
|
//
|
|
result = GetSpecifiedMin(values);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
bool GetConditions(
|
|
XCHICHConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = true;
|
|
|
|
//
|
|
if (loopback < 5)
|
|
{
|
|
loopback = 5;
|
|
}
|
|
|
|
//
|
|
conditions.Clean();
|
|
|
|
//
|
|
conditions.symbol = mSymbol;
|
|
conditions.period = mPeriod;
|
|
conditions.time = TimeCurrent();
|
|
|
|
//
|
|
int zIndex = barIndex;
|
|
int cIndex = zIndex + 1;
|
|
int pIndex = cIndex + 1;
|
|
int ppIndex = pIndex + 1;
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
// Current ...
|
|
CopyCTenkanSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cTK //
|
|
);
|
|
CopyCKijunSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cKJ //
|
|
);
|
|
CopyCChikouSpan(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cChik //
|
|
);
|
|
CopyCSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cSSA //
|
|
);
|
|
CopyCSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cSSB //
|
|
);
|
|
CopyCFutureSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cFSSA //
|
|
);
|
|
CopyCFutureSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cFSSB //
|
|
);
|
|
|
|
//
|
|
// Short ...
|
|
CopySTenkanSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sTK //
|
|
);
|
|
CopySKijunSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sKJ //
|
|
);
|
|
CopySChikouSpan(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sChik //
|
|
);
|
|
CopySSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sSSA //
|
|
);
|
|
CopySSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sSSB //
|
|
);
|
|
CopySFutureSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sFSSA //
|
|
);
|
|
CopySFutureSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sFSSB //
|
|
);
|
|
|
|
//
|
|
// Medium ...
|
|
CopyMTenkanSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mTK //
|
|
);
|
|
CopyMKijunSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mKJ //
|
|
);
|
|
CopyMChikouSpan(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mChik //
|
|
);
|
|
CopyMSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mSSA //
|
|
);
|
|
CopyMSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mSSB //
|
|
);
|
|
CopyMFutureSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mFSSA //
|
|
);
|
|
CopyMFutureSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mFSSB //
|
|
);
|
|
|
|
//
|
|
// Long ...
|
|
CopyLTenkanSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lTK //
|
|
);
|
|
CopyLKijunSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lKJ //
|
|
);
|
|
CopyLChikouSpan(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lChik //
|
|
);
|
|
CopyLSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lSSA //
|
|
);
|
|
CopyLSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lSSB //
|
|
);
|
|
CopyLFutureSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lFSSA //
|
|
);
|
|
CopyLFutureSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lFSSB //
|
|
);
|
|
|
|
//
|
|
// Hind ...
|
|
CopyHTenkanSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hTK //
|
|
);
|
|
CopyHKijunSen(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hKJ //
|
|
);
|
|
CopyHChikouSpan(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hChik //
|
|
);
|
|
CopyHSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hSSA //
|
|
);
|
|
CopyHSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hSSB //
|
|
);
|
|
CopyHFutureSenkouSpanA(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hFSSA //
|
|
);
|
|
CopyHFutureSenkouSpanB(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hFSSB //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
XOHCL cBar;
|
|
result = cBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
cIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
XOHCL pBar;
|
|
result = pBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
pIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
// Current ...
|
|
|
|
//
|
|
bool isCClosedOverKijunSen = cBar.low > conditions.cTK[cIndex];
|
|
bool isCClosedUnderKijunSen = cBar.high < conditions.cTK[cIndex];
|
|
|
|
//
|
|
bool isCTenkanSenOverKijunSen = conditions.cTK[cIndex] > conditions.cKJ[cIndex];
|
|
bool isCTenkanSenOverKijunSenPrev = conditions.cTK[pIndex] > conditions.cKJ[pIndex];
|
|
|
|
//
|
|
bool isCTenkanSenUnderKijunSen = conditions.cTK[cIndex] < conditions.cKJ[cIndex];
|
|
bool isCTenkanSenUnderKijunSenPrev = conditions.cTK[pIndex] < conditions.cKJ[pIndex];
|
|
|
|
//
|
|
bool isCTenkanSenCrossedOverKijunSen = isCTenkanSenOverKijunSen &&
|
|
!isCTenkanSenOverKijunSenPrev;
|
|
bool isCTenkanSenCrossedUnderKijunSen = isCTenkanSenUnderKijunSen &&
|
|
!isCTenkanSenUnderKijunSenPrev;
|
|
|
|
//
|
|
bool isCSenkouSpanAOverB = conditions.cSSA[cIndex] > conditions.cSSB[cIndex];
|
|
bool isCSenkouSpanAOverBPrev = conditions.cSSA[pIndex] > conditions.cSSB[pIndex];
|
|
|
|
//
|
|
bool isCSenkouSpanAUnderB = conditions.cSSA[cIndex] < conditions.cSSB[cIndex];
|
|
bool isCSenkouSpanAUnderBPrev = conditions.cSSA[pIndex] < conditions.cSSB[pIndex];
|
|
|
|
//
|
|
bool isCSenkouSpanAOverLast = conditions.cSSA[cIndex] > conditions.cSSA[pIndex];
|
|
bool isCSenkouSpanAOverLastPrev = conditions.cSSA[pIndex] > conditions.cSSA[ppIndex];
|
|
|
|
//
|
|
bool isCSenkouSpanAUnderLast = conditions.cSSA[cIndex] < conditions.cSSA[pIndex];
|
|
bool isCSenkouSpanAUnderLastPrev = conditions.cSSA[pIndex] < conditions.cSSA[ppIndex];
|
|
|
|
//
|
|
bool isCFutureSenkouSpanAOverB = conditions.cFSSA[cIndex] > conditions.cFSSB[cIndex];
|
|
bool isCFutureSenkouSpanAOverBPrev = conditions.cFSSA[pIndex] > conditions.cFSSB[pIndex];
|
|
|
|
//
|
|
bool isCFutureSenkouSpanAUnderB = conditions.cFSSA[cIndex] < conditions.cFSSB[cIndex];
|
|
bool isCFutureSenkouSpanAUnderBPrev = conditions.cFSSA[pIndex] < conditions.cFSSB[pIndex];
|
|
|
|
//
|
|
bool isCFutureSenkouSpanAOverLast = conditions.cFSSA[cIndex] > conditions.cFSSA[pIndex];
|
|
bool isCFutureSenkouSpanAOverLastPrev = conditions.cFSSA[pIndex] > conditions.cFSSA[ppIndex];
|
|
|
|
//
|
|
bool isCFutureSenkouSpanAUnderLast = conditions.cFSSA[cIndex] < conditions.cFSSA[pIndex];
|
|
bool isCFutureSenkouSpanAUnderLastPrev = conditions.cFSSA[pIndex] < conditions.cFSSA[ppIndex];
|
|
|
|
//
|
|
bool isCSenkouSpanACrossedOverB = isCSenkouSpanAOverB &&
|
|
!isCSenkouSpanAOverBPrev;
|
|
bool isCSenkouSpanACrossedUnderB = isCSenkouSpanAUnderB &&
|
|
!isCSenkouSpanAUnderBPrev;
|
|
bool isCSenkouSpanACrossedOverLast = isCSenkouSpanAOverLast &&
|
|
!isCSenkouSpanAOverLastPrev;
|
|
bool isCSenkouSpanACrossedUnderLast = isCSenkouSpanAUnderLast &&
|
|
!isCSenkouSpanAUnderLastPrev;
|
|
bool isCFutureSenkouSpanACrossedOverB = isCFutureSenkouSpanAOverB &&
|
|
!isCFutureSenkouSpanAOverBPrev;
|
|
bool isCFutureSenkouSpanACrossedUnderB = isCFutureSenkouSpanAUnderB &&
|
|
!isCFutureSenkouSpanAUnderBPrev;
|
|
bool isCFutureSenkouSpanACrossedOverLast = isCFutureSenkouSpanAOverLast &&
|
|
!isCFutureSenkouSpanAOverLastPrev;
|
|
bool isCFutureSenkouSpanACrossedUnderLast = isCFutureSenkouSpanAUnderLast &&
|
|
!isCFutureSenkouSpanAUnderLastPrev;
|
|
|
|
//
|
|
conditions.isCClosedOverKijunSen = isCClosedOverKijunSen;
|
|
conditions.isCClosedUnderKijunSen = isCClosedUnderKijunSen;
|
|
conditions.isCTenkanSenOverKijunSen = isCTenkanSenOverKijunSen;
|
|
conditions.isCTenkanSenUnderKijunSen = isCTenkanSenUnderKijunSen;
|
|
conditions.isCTenkanSenCrossedOverKijunSen = isCTenkanSenCrossedOverKijunSen;
|
|
conditions.isCTenkanSenCrossedUnderKijunSen = isCTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
conditions.isCSenkouSpanAOverB = isCSenkouSpanAOverB;
|
|
conditions.isCSenkouSpanAUnderB = isCSenkouSpanAUnderB;
|
|
conditions.isCSenkouSpanAOverLast = isCSenkouSpanAOverLast;
|
|
conditions.isCSenkouSpanAUnderLast = isCSenkouSpanAUnderLast;
|
|
conditions.isCFutureSenkouSpanAOverB = isCFutureSenkouSpanAOverB;
|
|
conditions.isCFutureSenkouSpanAUnderB = isCFutureSenkouSpanAUnderB;
|
|
conditions.isCFutureSenkouSpanAOverLast = isCFutureSenkouSpanAOverLast;
|
|
conditions.isCFutureSenkouSpanAUnderLast = isCFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
conditions.isCSenkouSpanACrossedOverB = isCSenkouSpanACrossedOverB;
|
|
conditions.isCSenkouSpanACrossedUnderB = isCSenkouSpanACrossedUnderB;
|
|
conditions.isCSenkouSpanACrossedOverLast = isCSenkouSpanACrossedOverLast;
|
|
conditions.isCSenkouSpanACrossedUnderLast = isCSenkouSpanACrossedUnderLast;
|
|
conditions.isCFutureSenkouSpanACrossedOverB = isCFutureSenkouSpanACrossedOverB;
|
|
conditions.isCFutureSenkouSpanACrossedUnderB = isCFutureSenkouSpanACrossedUnderB;
|
|
conditions.isCFutureSenkouSpanACrossedOverLast = isCFutureSenkouSpanACrossedOverLast;
|
|
conditions.isCFutureSenkouSpanACrossedUnderLast = isCFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Short ...
|
|
|
|
//
|
|
bool isSClosedOverKijunSen = cBar.low > conditions.sTK[cIndex];
|
|
bool isSClosedUnderKijunSen = cBar.high < conditions.sTK[cIndex];
|
|
|
|
//
|
|
bool isSTenkanSenOverKijunSen = conditions.sTK[cIndex] > conditions.sKJ[cIndex];
|
|
bool isSTenkanSenOverKijunSenPrev = conditions.sTK[pIndex] > conditions.sKJ[pIndex];
|
|
|
|
//
|
|
bool isSTenkanSenUnderKijunSen = conditions.sTK[cIndex] < conditions.sKJ[cIndex];
|
|
bool isSTenkanSenUnderKijunSenPrev = conditions.sTK[pIndex] < conditions.sKJ[pIndex];
|
|
|
|
//
|
|
bool isSTenkanSenCrossedOverKijunSen = isSTenkanSenOverKijunSen &&
|
|
!isSTenkanSenOverKijunSenPrev;
|
|
bool isSTenkanSenCrossedUnderKijunSen = isSTenkanSenUnderKijunSen &&
|
|
!isSTenkanSenUnderKijunSenPrev;
|
|
|
|
//
|
|
bool isSSenkouSpanAOverB = conditions.sSSA[cIndex] > conditions.sSSB[cIndex];
|
|
bool isSSenkouSpanAOverBPrev = conditions.sSSA[pIndex] > conditions.sSSB[pIndex];
|
|
|
|
//
|
|
bool isSSenkouSpanAUnderB = conditions.sSSA[cIndex] < conditions.sSSB[cIndex];
|
|
bool isSSenkouSpanAUnderBPrev = conditions.sSSA[pIndex] < conditions.sSSB[pIndex];
|
|
|
|
//
|
|
bool isSSenkouSpanAOverLast = conditions.sSSA[cIndex] > conditions.sSSA[pIndex];
|
|
bool isSSenkouSpanAOverLastPrev = conditions.sSSA[pIndex] > conditions.sSSA[ppIndex];
|
|
|
|
//
|
|
bool isSSenkouSpanAUnderLast = conditions.sSSA[cIndex] < conditions.sSSA[pIndex];
|
|
bool isSSenkouSpanAUnderLastPrev = conditions.sSSA[pIndex] < conditions.sSSA[ppIndex];
|
|
|
|
//
|
|
bool isSFutureSenkouSpanAOverB = conditions.sFSSA[cIndex] > conditions.sFSSB[cIndex];
|
|
bool isSFutureSenkouSpanAOverBPrev = conditions.sFSSA[pIndex] > conditions.sFSSB[pIndex];
|
|
|
|
//
|
|
bool isSFutureSenkouSpanAUnderB = conditions.sFSSA[cIndex] < conditions.sFSSB[cIndex];
|
|
bool isSFutureSenkouSpanAUnderBPrev = conditions.sFSSA[pIndex] < conditions.sFSSB[pIndex];
|
|
|
|
//
|
|
bool isSFutureSenkouSpanAOverLast = conditions.sFSSA[cIndex] > conditions.sFSSA[pIndex];
|
|
bool isSFutureSenkouSpanAOverLastPrev = conditions.sFSSA[pIndex] > conditions.sFSSA[ppIndex];
|
|
|
|
//
|
|
bool isSFutureSenkouSpanAUnderLast = conditions.sFSSA[cIndex] < conditions.sFSSA[pIndex];
|
|
bool isSFutureSenkouSpanAUnderLastPrev = conditions.sFSSA[pIndex] < conditions.sFSSA[ppIndex];
|
|
|
|
//
|
|
bool isSSenkouSpanACrossedOverB = isSSenkouSpanAOverB &&
|
|
!isSSenkouSpanAOverBPrev;
|
|
bool isSSenkouSpanACrossedUnderB = isSSenkouSpanAUnderB &&
|
|
!isSSenkouSpanAUnderBPrev;
|
|
bool isSSenkouSpanACrossedOverLast = isSSenkouSpanAOverLast &&
|
|
!isSSenkouSpanAOverLastPrev;
|
|
bool isSSenkouSpanACrossedUnderLast = isSSenkouSpanAUnderLast &&
|
|
!isSSenkouSpanAUnderLastPrev;
|
|
bool isSFutureSenkouSpanACrossedOverB = isSFutureSenkouSpanAOverB &&
|
|
!isSFutureSenkouSpanAOverBPrev;
|
|
bool isSFutureSenkouSpanACrossedUnderB = isSFutureSenkouSpanAUnderB &&
|
|
!isSFutureSenkouSpanAUnderBPrev;
|
|
bool isSFutureSenkouSpanACrossedOverLast = isSFutureSenkouSpanAOverLast &&
|
|
!isSFutureSenkouSpanAOverLastPrev;
|
|
bool isSFutureSenkouSpanACrossedUnderLast = isSFutureSenkouSpanAUnderLast &&
|
|
!isSFutureSenkouSpanAUnderLastPrev;
|
|
|
|
//
|
|
conditions.isSClosedOverKijunSen = isSClosedOverKijunSen;
|
|
conditions.isSClosedUnderKijunSen = isSClosedUnderKijunSen;
|
|
conditions.isSTenkanSenOverKijunSen = isSTenkanSenOverKijunSen;
|
|
conditions.isSTenkanSenUnderKijunSen = isSTenkanSenUnderKijunSen;
|
|
conditions.isSTenkanSenCrossedOverKijunSen = isSTenkanSenCrossedOverKijunSen;
|
|
conditions.isSTenkanSenCrossedUnderKijunSen = isSTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
conditions.isSSenkouSpanAOverB = isSSenkouSpanAOverB;
|
|
conditions.isSSenkouSpanAUnderB = isSSenkouSpanAUnderB;
|
|
conditions.isSSenkouSpanAOverLast = isSSenkouSpanAOverLast;
|
|
conditions.isSSenkouSpanAUnderLast = isSSenkouSpanAUnderLast;
|
|
conditions.isSFutureSenkouSpanAOverB = isSFutureSenkouSpanAOverB;
|
|
conditions.isSFutureSenkouSpanAUnderB = isSFutureSenkouSpanAUnderB;
|
|
conditions.isSFutureSenkouSpanAOverLast = isSFutureSenkouSpanAOverLast;
|
|
conditions.isSFutureSenkouSpanAUnderLast = isSFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
conditions.isSSenkouSpanACrossedOverB = isSSenkouSpanACrossedOverB;
|
|
conditions.isSSenkouSpanACrossedUnderB = isSSenkouSpanACrossedUnderB;
|
|
conditions.isSSenkouSpanACrossedOverLast = isSSenkouSpanACrossedOverLast;
|
|
conditions.isSSenkouSpanACrossedUnderLast = isSSenkouSpanACrossedUnderLast;
|
|
conditions.isSFutureSenkouSpanACrossedOverB = isSFutureSenkouSpanACrossedOverB;
|
|
conditions.isSFutureSenkouSpanACrossedUnderB = isSFutureSenkouSpanACrossedUnderB;
|
|
conditions.isSFutureSenkouSpanACrossedOverLast = isSFutureSenkouSpanACrossedOverLast;
|
|
conditions.isSFutureSenkouSpanACrossedUnderLast = isSFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Medium ...
|
|
|
|
//
|
|
bool isMClosedOverKijunSen = cBar.low > conditions.mTK[cIndex];
|
|
bool isMClosedUnderKijunSen = cBar.high < conditions.mTK[cIndex];
|
|
|
|
//
|
|
bool isMTenkanSenOverKijunSen = conditions.mTK[cIndex] > conditions.mKJ[cIndex];
|
|
bool isMTenkanSenOverKijunSenPrev = conditions.mTK[pIndex] > conditions.mKJ[pIndex];
|
|
|
|
//
|
|
bool isMTenkanSenUnderKijunSen = conditions.mTK[cIndex] < conditions.mKJ[cIndex];
|
|
bool isMTenkanSenUnderKijunSenPrev = conditions.mTK[pIndex] < conditions.mKJ[pIndex];
|
|
|
|
//
|
|
bool isMTenkanSenCrossedOverKijunSen = isMTenkanSenOverKijunSen &&
|
|
!isMTenkanSenOverKijunSenPrev;
|
|
bool isMTenkanSenCrossedUnderKijunSen = isMTenkanSenUnderKijunSen &&
|
|
!isMTenkanSenUnderKijunSenPrev;
|
|
|
|
//
|
|
bool isMSenkouSpanAOverB = conditions.mSSA[cIndex] > conditions.mSSB[cIndex];
|
|
bool isMSenkouSpanAOverBPrev = conditions.mSSA[pIndex] > conditions.mSSB[pIndex];
|
|
|
|
//
|
|
bool isMSenkouSpanAUnderB = conditions.mSSA[cIndex] < conditions.mSSB[cIndex];
|
|
bool isMSenkouSpanAUnderBPrev = conditions.mSSA[pIndex] < conditions.mSSB[pIndex];
|
|
|
|
//
|
|
bool isMSenkouSpanAOverLast = conditions.mSSA[cIndex] > conditions.mSSA[pIndex];
|
|
bool isMSenkouSpanAOverLastPrev = conditions.mSSA[pIndex] > conditions.mSSA[ppIndex];
|
|
|
|
//
|
|
bool isMSenkouSpanAUnderLast = conditions.mSSA[cIndex] < conditions.mSSA[pIndex];
|
|
bool isMSenkouSpanAUnderLastPrev = conditions.mSSA[pIndex] < conditions.mSSA[ppIndex];
|
|
|
|
//
|
|
bool isMFutureSenkouSpanAOverB = conditions.mFSSA[cIndex] > conditions.mFSSB[cIndex];
|
|
bool isMFutureSenkouSpanAOverBPrev = conditions.mFSSA[pIndex] > conditions.mFSSB[pIndex];
|
|
|
|
//
|
|
bool isMFutureSenkouSpanAUnderB = conditions.mFSSA[cIndex] < conditions.mFSSB[cIndex];
|
|
bool isMFutureSenkouSpanAUnderBPrev = conditions.mFSSA[pIndex] < conditions.mFSSB[pIndex];
|
|
|
|
//
|
|
bool isMFutureSenkouSpanAOverLast = conditions.mFSSA[cIndex] > conditions.mFSSA[pIndex];
|
|
bool isMFutureSenkouSpanAOverLastPrev = conditions.mFSSA[pIndex] > conditions.mFSSA[ppIndex];
|
|
|
|
//
|
|
bool isMFutureSenkouSpanAUnderLast = conditions.mFSSA[cIndex] < conditions.mFSSA[pIndex];
|
|
bool isMFutureSenkouSpanAUnderLastPrev = conditions.mFSSA[pIndex] < conditions.mFSSA[ppIndex];
|
|
|
|
//
|
|
bool isMSenkouSpanACrossedOverB = isMSenkouSpanAOverB &&
|
|
!isMSenkouSpanAOverBPrev;
|
|
bool isMSenkouSpanACrossedUnderB = isMSenkouSpanAUnderB &&
|
|
!isMSenkouSpanAUnderBPrev;
|
|
bool isMSenkouSpanACrossedOverLast = isMSenkouSpanAOverLast &&
|
|
!isMSenkouSpanAOverLastPrev;
|
|
bool isMSenkouSpanACrossedUnderLast = isMSenkouSpanAUnderLast &&
|
|
!isMSenkouSpanAUnderLastPrev;
|
|
bool isMFutureSenkouSpanACrossedOverB = isMFutureSenkouSpanAOverB &&
|
|
!isMFutureSenkouSpanAOverBPrev;
|
|
bool isMFutureSenkouSpanACrossedUnderB = isMFutureSenkouSpanAUnderB &&
|
|
!isMFutureSenkouSpanAUnderBPrev;
|
|
bool isMFutureSenkouSpanACrossedOverLast = isMFutureSenkouSpanAOverLast &&
|
|
!isMFutureSenkouSpanAOverLastPrev;
|
|
bool isMFutureSenkouSpanACrossedUnderLast = isMFutureSenkouSpanAUnderLast &&
|
|
!isMFutureSenkouSpanAUnderLastPrev;
|
|
|
|
//
|
|
conditions.isMClosedOverKijunSen = isMClosedOverKijunSen;
|
|
conditions.isMClosedUnderKijunSen = isMClosedUnderKijunSen;
|
|
conditions.isMTenkanSenOverKijunSen = isMTenkanSenOverKijunSen;
|
|
conditions.isMTenkanSenUnderKijunSen = isMTenkanSenUnderKijunSen;
|
|
conditions.isMTenkanSenCrossedOverKijunSen = isMTenkanSenCrossedOverKijunSen;
|
|
conditions.isMTenkanSenCrossedUnderKijunSen = isMTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
conditions.isMSenkouSpanAOverB = isMSenkouSpanAOverB;
|
|
conditions.isMSenkouSpanAUnderB = isMSenkouSpanAUnderB;
|
|
conditions.isMSenkouSpanAOverLast = isMSenkouSpanAOverLast;
|
|
conditions.isMSenkouSpanAUnderLast = isMSenkouSpanAUnderLast;
|
|
conditions.isMFutureSenkouSpanAOverB = isMFutureSenkouSpanAOverB;
|
|
conditions.isMFutureSenkouSpanAUnderB = isMFutureSenkouSpanAUnderB;
|
|
conditions.isMFutureSenkouSpanAOverLast = isMFutureSenkouSpanAOverLast;
|
|
conditions.isMFutureSenkouSpanAUnderLast = isMFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
conditions.isMSenkouSpanACrossedOverB = isMSenkouSpanACrossedOverB;
|
|
conditions.isMSenkouSpanACrossedUnderB = isMSenkouSpanACrossedUnderB;
|
|
conditions.isMSenkouSpanACrossedOverLast = isMSenkouSpanACrossedOverLast;
|
|
conditions.isMSenkouSpanACrossedUnderLast = isMSenkouSpanACrossedUnderLast;
|
|
conditions.isMFutureSenkouSpanACrossedOverB = isMFutureSenkouSpanACrossedOverB;
|
|
conditions.isMFutureSenkouSpanACrossedUnderB = isMFutureSenkouSpanACrossedUnderB;
|
|
conditions.isMFutureSenkouSpanACrossedOverLast = isMFutureSenkouSpanACrossedOverLast;
|
|
conditions.isMFutureSenkouSpanACrossedUnderLast = isMFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Long ...
|
|
|
|
//
|
|
bool isLClosedOverKijunSen = cBar.low > conditions.lTK[cIndex];
|
|
bool isLClosedUnderKijunSen = cBar.high < conditions.lTK[cIndex];
|
|
|
|
//
|
|
bool isLTenkanSenOverKijunSen = conditions.lTK[cIndex] > conditions.lKJ[cIndex];
|
|
bool isLTenkanSenOverKijunSenPrev = conditions.lTK[pIndex] > conditions.lKJ[pIndex];
|
|
|
|
//
|
|
bool isLTenkanSenUnderKijunSen = conditions.lTK[cIndex] < conditions.lKJ[cIndex];
|
|
bool isLTenkanSenUnderKijunSenPrev = conditions.lTK[pIndex] < conditions.lKJ[pIndex];
|
|
|
|
//
|
|
bool isLTenkanSenCrossedOverKijunSen = isLTenkanSenOverKijunSen &&
|
|
!isLTenkanSenOverKijunSenPrev;
|
|
bool isLTenkanSenCrossedUnderKijunSen = isLTenkanSenUnderKijunSen &&
|
|
!isLTenkanSenUnderKijunSenPrev;
|
|
|
|
//
|
|
bool isLSenkouSpanAOverB = conditions.lSSA[cIndex] > conditions.lSSB[cIndex];
|
|
bool isLSenkouSpanAOverBPrev = conditions.lSSA[pIndex] > conditions.lSSB[pIndex];
|
|
|
|
//
|
|
bool isLSenkouSpanAUnderB = conditions.lSSA[cIndex] < conditions.lSSB[cIndex];
|
|
bool isLSenkouSpanAUnderBPrev = conditions.lSSA[pIndex] < conditions.lSSB[pIndex];
|
|
|
|
//
|
|
bool isLSenkouSpanAOverLast = conditions.lSSA[cIndex] > conditions.lSSA[pIndex];
|
|
bool isLSenkouSpanAOverLastPrev = conditions.lSSA[pIndex] > conditions.lSSA[ppIndex];
|
|
|
|
//
|
|
bool isLSenkouSpanAUnderLast = conditions.lSSA[cIndex] < conditions.lSSA[pIndex];
|
|
bool isLSenkouSpanAUnderLastPrev = conditions.lSSA[pIndex] < conditions.lSSA[ppIndex];
|
|
|
|
//
|
|
bool isLFutureSenkouSpanAOverB = conditions.lFSSA[cIndex] > conditions.lFSSB[cIndex];
|
|
bool isLFutureSenkouSpanAOverBPrev = conditions.lFSSA[pIndex] > conditions.lFSSB[pIndex];
|
|
|
|
//
|
|
bool isLFutureSenkouSpanAUnderB = conditions.lFSSA[cIndex] < conditions.lFSSB[cIndex];
|
|
bool isLFutureSenkouSpanAUnderBPrev = conditions.lFSSA[pIndex] < conditions.lFSSB[pIndex];
|
|
|
|
//
|
|
bool isLFutureSenkouSpanAOverLast = conditions.lFSSA[cIndex] > conditions.lFSSA[pIndex];
|
|
bool isLFutureSenkouSpanAOverLastPrev = conditions.lFSSA[pIndex] > conditions.lFSSA[ppIndex];
|
|
|
|
//
|
|
bool isLFutureSenkouSpanAUnderLast = conditions.lFSSA[cIndex] < conditions.lFSSA[pIndex];
|
|
bool isLFutureSenkouSpanAUnderLastPrev = conditions.lFSSA[pIndex] < conditions.lFSSA[ppIndex];
|
|
|
|
//
|
|
bool isLSenkouSpanACrossedOverB = isLSenkouSpanAOverB &&
|
|
!isLSenkouSpanAOverBPrev;
|
|
bool isLSenkouSpanACrossedUnderB = isLSenkouSpanAUnderB &&
|
|
!isLSenkouSpanAUnderBPrev;
|
|
bool isLSenkouSpanACrossedOverLast = isLSenkouSpanAOverLast &&
|
|
!isLSenkouSpanAOverLastPrev;
|
|
bool isLSenkouSpanACrossedUnderLast = isLSenkouSpanAUnderLast &&
|
|
!isLSenkouSpanAUnderLastPrev;
|
|
bool isLFutureSenkouSpanACrossedOverB = isLFutureSenkouSpanAOverB &&
|
|
!isLFutureSenkouSpanAOverBPrev;
|
|
bool isLFutureSenkouSpanACrossedUnderB = isLFutureSenkouSpanAUnderB &&
|
|
!isLFutureSenkouSpanAUnderBPrev;
|
|
bool isLFutureSenkouSpanACrossedOverLast = isLFutureSenkouSpanAOverLast &&
|
|
!isLFutureSenkouSpanAOverLastPrev;
|
|
bool isLFutureSenkouSpanACrossedUnderLast = isLFutureSenkouSpanAUnderLast &&
|
|
!isLFutureSenkouSpanAUnderLastPrev;
|
|
|
|
//
|
|
conditions.isLClosedOverKijunSen = isLClosedOverKijunSen;
|
|
conditions.isLClosedUnderKijunSen = isLClosedUnderKijunSen;
|
|
conditions.isLTenkanSenOverKijunSen = isLTenkanSenOverKijunSen;
|
|
conditions.isLTenkanSenUnderKijunSen = isLTenkanSenUnderKijunSen;
|
|
conditions.isLTenkanSenCrossedOverKijunSen = isLTenkanSenCrossedOverKijunSen;
|
|
conditions.isLTenkanSenCrossedUnderKijunSen = isLTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
conditions.isLSenkouSpanAOverB = isLSenkouSpanAOverB;
|
|
conditions.isLSenkouSpanAUnderB = isLSenkouSpanAUnderB;
|
|
conditions.isLSenkouSpanAOverLast = isLSenkouSpanAOverLast;
|
|
conditions.isLSenkouSpanAUnderLast = isLSenkouSpanAUnderLast;
|
|
conditions.isLFutureSenkouSpanAOverB = isLFutureSenkouSpanAOverB;
|
|
conditions.isLFutureSenkouSpanAUnderB = isLFutureSenkouSpanAUnderB;
|
|
conditions.isLFutureSenkouSpanAOverLast = isLFutureSenkouSpanAOverLast;
|
|
conditions.isLFutureSenkouSpanAUnderLast = isLFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
conditions.isLSenkouSpanACrossedOverB = isLSenkouSpanACrossedOverB;
|
|
conditions.isLSenkouSpanACrossedUnderB = isLSenkouSpanACrossedUnderB;
|
|
conditions.isLSenkouSpanACrossedOverLast = isLSenkouSpanACrossedOverLast;
|
|
conditions.isLSenkouSpanACrossedUnderLast = isLSenkouSpanACrossedUnderLast;
|
|
conditions.isLFutureSenkouSpanACrossedOverB = isLFutureSenkouSpanACrossedOverB;
|
|
conditions.isLFutureSenkouSpanACrossedUnderB = isLFutureSenkouSpanACrossedUnderB;
|
|
conditions.isLFutureSenkouSpanACrossedOverLast = isLFutureSenkouSpanACrossedOverLast;
|
|
conditions.isLFutureSenkouSpanACrossedUnderLast = isLFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
// Hind ...
|
|
|
|
//
|
|
bool isHClosedOverKijunSen = cBar.low > conditions.hTK[cIndex];
|
|
bool isHClosedUnderKijunSen = cBar.high < conditions.hTK[cIndex];
|
|
|
|
//
|
|
bool isHTenkanSenOverKijunSen = conditions.hTK[cIndex] > conditions.hKJ[cIndex];
|
|
bool isHTenkanSenOverKijunSenPrev = conditions.hTK[pIndex] > conditions.hKJ[pIndex];
|
|
|
|
//
|
|
bool isHTenkanSenUnderKijunSen = conditions.hTK[cIndex] < conditions.hKJ[cIndex];
|
|
bool isHTenkanSenUnderKijunSenPrev = conditions.hTK[pIndex] < conditions.hKJ[pIndex];
|
|
|
|
//
|
|
bool isHTenkanSenCrossedOverKijunSen = isHTenkanSenOverKijunSen &&
|
|
!isHTenkanSenOverKijunSenPrev;
|
|
bool isHTenkanSenCrossedUnderKijunSen = isHTenkanSenUnderKijunSen &&
|
|
!isHTenkanSenUnderKijunSenPrev;
|
|
|
|
//
|
|
bool isHSenkouSpanAOverB = conditions.hSSA[cIndex] > conditions.hSSB[cIndex];
|
|
bool isHSenkouSpanAOverBPrev = conditions.hSSA[pIndex] > conditions.hSSB[pIndex];
|
|
|
|
//
|
|
bool isHSenkouSpanAUnderB = conditions.hSSA[cIndex] < conditions.hSSB[cIndex];
|
|
bool isHSenkouSpanAUnderBPrev = conditions.hSSA[pIndex] < conditions.hSSB[pIndex];
|
|
|
|
//
|
|
bool isHSenkouSpanAOverLast = conditions.hSSA[cIndex] > conditions.hSSA[pIndex];
|
|
bool isHSenkouSpanAOverLastPrev = conditions.hSSA[pIndex] > conditions.hSSA[ppIndex];
|
|
|
|
//
|
|
bool isHSenkouSpanAUnderLast = conditions.hSSA[cIndex] < conditions.hSSA[pIndex];
|
|
bool isHSenkouSpanAUnderLastPrev = conditions.hSSA[pIndex] < conditions.hSSA[ppIndex];
|
|
|
|
//
|
|
bool isHFutureSenkouSpanAOverB = conditions.hFSSA[cIndex] > conditions.hFSSB[cIndex];
|
|
bool isHFutureSenkouSpanAOverBPrev = conditions.hFSSA[pIndex] > conditions.hFSSB[pIndex];
|
|
|
|
//
|
|
bool isHFutureSenkouSpanAUnderB = conditions.hFSSA[cIndex] < conditions.hFSSB[cIndex];
|
|
bool isHFutureSenkouSpanAUnderBPrev = conditions.hFSSA[pIndex] < conditions.hFSSB[pIndex];
|
|
|
|
//
|
|
bool isHFutureSenkouSpanAOverLast = conditions.hFSSA[cIndex] > conditions.hFSSA[pIndex];
|
|
bool isHFutureSenkouSpanAOverLastPrev = conditions.hFSSA[pIndex] > conditions.hFSSA[ppIndex];
|
|
|
|
//
|
|
bool isHFutureSenkouSpanAUnderLast = conditions.hFSSA[cIndex] < conditions.hFSSA[pIndex];
|
|
bool isHFutureSenkouSpanAUnderLastPrev = conditions.hFSSA[pIndex] < conditions.hFSSA[ppIndex];
|
|
|
|
//
|
|
bool isHSenkouSpanACrossedOverB = isHSenkouSpanAOverB &&
|
|
!isHSenkouSpanAOverBPrev;
|
|
bool isHSenkouSpanACrossedUnderB = isHSenkouSpanAUnderB &&
|
|
!isHSenkouSpanAUnderBPrev;
|
|
bool isHSenkouSpanACrossedOverLast = isHSenkouSpanAOverLast &&
|
|
!isHSenkouSpanAOverLastPrev;
|
|
bool isHSenkouSpanACrossedUnderLast = isHSenkouSpanAUnderLast &&
|
|
!isHSenkouSpanAUnderLastPrev;
|
|
bool isHFutureSenkouSpanACrossedOverB = isHFutureSenkouSpanAOverB &&
|
|
!isHFutureSenkouSpanAOverBPrev;
|
|
bool isHFutureSenkouSpanACrossedUnderB = isHFutureSenkouSpanAUnderB &&
|
|
!isHFutureSenkouSpanAUnderBPrev;
|
|
bool isHFutureSenkouSpanACrossedOverLast = isHFutureSenkouSpanAOverLast &&
|
|
!isHFutureSenkouSpanAOverLastPrev;
|
|
bool isHFutureSenkouSpanACrossedUnderLast = isHFutureSenkouSpanAUnderLast &&
|
|
!isHFutureSenkouSpanAUnderLastPrev;
|
|
|
|
//
|
|
conditions.isHClosedOverKijunSen = isHClosedOverKijunSen;
|
|
conditions.isHClosedUnderKijunSen = isHClosedUnderKijunSen;
|
|
conditions.isHTenkanSenOverKijunSen = isHTenkanSenOverKijunSen;
|
|
conditions.isHTenkanSenUnderKijunSen = isHTenkanSenUnderKijunSen;
|
|
conditions.isHTenkanSenCrossedOverKijunSen = isHTenkanSenCrossedOverKijunSen;
|
|
conditions.isHTenkanSenCrossedUnderKijunSen = isHTenkanSenCrossedUnderKijunSen;
|
|
|
|
//
|
|
conditions.isHSenkouSpanAOverB = isHSenkouSpanAOverB;
|
|
conditions.isHSenkouSpanAUnderB = isHSenkouSpanAUnderB;
|
|
conditions.isHSenkouSpanAOverLast = isHSenkouSpanAOverLast;
|
|
conditions.isHSenkouSpanAUnderLast = isHSenkouSpanAUnderLast;
|
|
conditions.isHFutureSenkouSpanAOverB = isHFutureSenkouSpanAOverB;
|
|
conditions.isHFutureSenkouSpanAUnderB = isHFutureSenkouSpanAUnderB;
|
|
conditions.isHFutureSenkouSpanAOverLast = isHFutureSenkouSpanAOverLast;
|
|
conditions.isHFutureSenkouSpanAUnderLast = isHFutureSenkouSpanAUnderLast;
|
|
|
|
//
|
|
conditions.isHSenkouSpanACrossedOverB = isHSenkouSpanACrossedOverB;
|
|
conditions.isHSenkouSpanACrossedUnderB = isHSenkouSpanACrossedUnderB;
|
|
conditions.isHSenkouSpanACrossedOverLast = isHSenkouSpanACrossedOverLast;
|
|
conditions.isHSenkouSpanACrossedUnderLast = isHSenkouSpanACrossedUnderLast;
|
|
conditions.isHFutureSenkouSpanACrossedOverB = isHFutureSenkouSpanACrossedOverB;
|
|
conditions.isHFutureSenkouSpanACrossedUnderB = isHFutureSenkouSpanACrossedUnderB;
|
|
conditions.isHFutureSenkouSpanACrossedOverLast = isHFutureSenkouSpanACrossedOverLast;
|
|
conditions.isHFutureSenkouSpanACrossedUnderLast = isHFutureSenkouSpanACrossedUnderLast;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Protected ...
|
|
protected:
|
|
//
|
|
// Private ...
|
|
private:
|
|
//
|
|
// Props ...
|
|
XCHICHInputs mInputs; // Inputs ...
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
// Current ...
|
|
double cTKBuffer[];
|
|
double cKJBuffer[];
|
|
double cChikBuffer[];
|
|
double cSSABuffer[];
|
|
double cSSBBuffer[];
|
|
|
|
//
|
|
// Short ...
|
|
double sTKBuffer[];
|
|
double sKJBuffer[];
|
|
double sChikBuffer[];
|
|
double sSSABuffer[];
|
|
double sSSBBuffer[];
|
|
|
|
//
|
|
// Medium ...
|
|
double mTKBuffer[];
|
|
double mKJBuffer[];
|
|
double mChikBuffer[];
|
|
double mSSABuffer[];
|
|
double mSSBBuffer[];
|
|
|
|
//
|
|
// Long ...
|
|
double lTKBuffer[];
|
|
double lKJBuffer[];
|
|
double lChikBuffer[];
|
|
double lSSABuffer[];
|
|
double lSSBBuffer[];
|
|
|
|
//
|
|
// Hind ...
|
|
double hTKBuffer[];
|
|
double hKJBuffer[];
|
|
double hChikBuffer[];
|
|
double hSSABuffer[];
|
|
double hSSBBuffer[];
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
//
|
|
// Calculate Values Until Now ...
|
|
void Calculate()
|
|
{
|
|
//
|
|
int totalBars = CountBars();
|
|
if (totalBars > 1000)
|
|
{
|
|
totalBars = 1000;
|
|
}
|
|
|
|
//
|
|
// Current ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_C_TK_LINE,
|
|
0,
|
|
totalBars,
|
|
cTKBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_C_KJ_LINE,
|
|
0,
|
|
totalBars,
|
|
cKJBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_C_CH_LINE,
|
|
0,
|
|
totalBars,
|
|
cChikBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_C_SSA_LINE,
|
|
0,
|
|
totalBars,
|
|
cSSABuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_C_SSB_LINE,
|
|
0,
|
|
totalBars,
|
|
cSSBBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Short ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_S_TK_LINE,
|
|
0,
|
|
totalBars,
|
|
sTKBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_S_KJ_LINE,
|
|
0,
|
|
totalBars,
|
|
sKJBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_S_CH_LINE,
|
|
0,
|
|
totalBars,
|
|
sChikBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_S_SSA_LINE,
|
|
0,
|
|
totalBars,
|
|
sSSABuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_S_SSB_LINE,
|
|
0,
|
|
totalBars,
|
|
sSSBBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Medium ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_M_TK_LINE,
|
|
0,
|
|
totalBars,
|
|
mTKBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_M_KJ_LINE,
|
|
0,
|
|
totalBars,
|
|
mKJBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_M_CH_LINE,
|
|
0,
|
|
totalBars,
|
|
mChikBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_M_SSA_LINE,
|
|
0,
|
|
totalBars,
|
|
mSSABuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_M_SSB_LINE,
|
|
0,
|
|
totalBars,
|
|
mSSBBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Long ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_L_TK_LINE,
|
|
0,
|
|
totalBars,
|
|
lTKBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_L_KJ_LINE,
|
|
0,
|
|
totalBars,
|
|
lKJBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_L_CH_LINE,
|
|
0,
|
|
totalBars,
|
|
lChikBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_L_SSA_LINE,
|
|
0,
|
|
totalBars,
|
|
lSSABuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_L_SSB_LINE,
|
|
0,
|
|
totalBars,
|
|
lSSBBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Hind ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_H_TK_LINE,
|
|
0,
|
|
totalBars,
|
|
hTKBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_H_KJ_LINE,
|
|
0,
|
|
totalBars,
|
|
hKJBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_H_CH_LINE,
|
|
0,
|
|
totalBars,
|
|
hChikBuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_H_SSA_LINE,
|
|
0,
|
|
totalBars,
|
|
hSSABuffer
|
|
//
|
|
);
|
|
CopyBuffer(
|
|
mHandler,
|
|
XCHICH_H_SSB_LINE,
|
|
0,
|
|
totalBars,
|
|
hSSBBuffer
|
|
//
|
|
);
|
|
};
|
|
};
|
|
|
|
// |