last works ...
This commit is contained in:
Vendored
+35
@@ -44,6 +44,32 @@
|
||||
}
|
||||
],
|
||||
"in-progress": [
|
||||
{
|
||||
"assignedTo": {
|
||||
"name": "Hadi Khazaee Asl"
|
||||
},
|
||||
"creation_time": "2024-06-05T00:10:14.895Z",
|
||||
"details": {
|
||||
"content": "- [] Check Last Time trade for Provider;\n- [] Open Trade only when it's new or Previous in Profit;\n- [] Open Only 2 trade in each Direction at same time;\n- [] Close All Open Trades at Specific Time;\n- [] Enable/Disable Robot time Daily;\n- [] Close Long age Trades;\n- [] Trail or Risk Free Same In Profit Trades when Open New One;",
|
||||
"mime": "text/markdown"
|
||||
},
|
||||
"id": "74",
|
||||
"references": [],
|
||||
"title": "add support for:"
|
||||
},
|
||||
{
|
||||
"assignedTo": {
|
||||
"name": "Hadi Khazaee Asl"
|
||||
},
|
||||
"creation_time": "2024-06-05T00:17:33.324Z",
|
||||
"description": {
|
||||
"content": "from Provider classes and trader class.\nput them into XEA ...\nans Signallers ...",
|
||||
"mime": "text/markdown"
|
||||
},
|
||||
"id": "75",
|
||||
"references": [],
|
||||
"title": "Cleanup all allow long, short, minProfit per trade and drawdown factors variables"
|
||||
},
|
||||
{
|
||||
"assignedTo": {
|
||||
"name": "Hadi Khazaee Asl"
|
||||
@@ -81,6 +107,15 @@
|
||||
"id": "72",
|
||||
"references": [],
|
||||
"title": "R&D about Volume Profiling"
|
||||
},
|
||||
{
|
||||
"assignedTo": {
|
||||
"name": "Hadi Khazaee Asl"
|
||||
},
|
||||
"creation_time": "2024-06-05T00:18:44.371Z",
|
||||
"id": "76",
|
||||
"references": [],
|
||||
"title": "Enable Comment Score and Summary on each Tick ..."
|
||||
}
|
||||
],
|
||||
"testing": [
|
||||
|
||||
@@ -2540,8 +2540,8 @@ public:
|
||||
ENUM_XSIGNAL_PROVIDERS name;
|
||||
|
||||
//
|
||||
bool enableLong;
|
||||
bool enableShort;
|
||||
bool allowLong;
|
||||
bool allowShort;
|
||||
|
||||
//
|
||||
double r2r;
|
||||
@@ -2567,8 +2567,8 @@ public:
|
||||
name = PROVIDER_NONE;
|
||||
|
||||
//
|
||||
enableLong = false;
|
||||
enableShort = false;
|
||||
allowLong = false;
|
||||
allowShort = false;
|
||||
|
||||
//
|
||||
r2r = 0;
|
||||
@@ -2590,10 +2590,10 @@ public:
|
||||
//
|
||||
name != PROVIDER_NONE &&
|
||||
r2r > 0 &&
|
||||
(enableLong
|
||||
(allowLong
|
||||
? staticVolumeLong > 0
|
||||
: true) &&
|
||||
(enableShort
|
||||
(allowShort
|
||||
? staticVolumeShort > 0
|
||||
: true)
|
||||
//
|
||||
@@ -2642,8 +2642,8 @@ public:
|
||||
//
|
||||
// Validate Signal Type ...
|
||||
result = isLong
|
||||
? enableLong && staticVolumeLong > 0
|
||||
: enableShort && staticVolumeShort > 0;
|
||||
? allowLong && staticVolumeLong > 0
|
||||
: allowShort && staticVolumeShort > 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -2703,8 +2703,8 @@ public:
|
||||
//
|
||||
// Validate Signal Type ...
|
||||
result = isLong
|
||||
? enableLong && staticVolumeLong > 0
|
||||
: enableShort && staticVolumeShort > 0;
|
||||
? allowLong && staticVolumeLong > 0
|
||||
: allowShort && staticVolumeShort > 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -4434,14 +4434,14 @@ public:
|
||||
conditions.isTenkanSenCrossedUnderKijunSen = isTenkanSenCrossedUnderKijunSen;
|
||||
|
||||
//
|
||||
conditions.isSenkouSpanAOverB = isSenkouSpanACrossedOverB;
|
||||
conditions.isSenkouSpanAUnderB = isSenkouSpanACrossedUnderB;
|
||||
conditions.isSenkouSpanAOverLast = isSenkouSpanACrossedOverLast;
|
||||
conditions.isSenkouSpanAUnderLast = isSenkouSpanACrossedUnderLast;
|
||||
conditions.isFutureSenkouSpanAOverB = isFutureSenkouSpanACrossedOverB;
|
||||
conditions.isFutureSenkouSpanAUnderB = isFutureSenkouSpanACrossedUnderB;
|
||||
conditions.isFutureSenkouSpanAOverLast = isFutureSenkouSpanACrossedOverLast;
|
||||
conditions.isFutureSenkouSpanAUnderLast = isFutureSenkouSpanACrossedUnderLast;
|
||||
conditions.isSenkouSpanAOverB = isSenkouSpanAOverB;
|
||||
conditions.isSenkouSpanAUnderB = isSenkouSpanAUnderB;
|
||||
conditions.isSenkouSpanAOverLast = isSenkouSpanAOverLast;
|
||||
conditions.isSenkouSpanAUnderLast = isSenkouSpanAUnderLast;
|
||||
conditions.isFutureSenkouSpanAOverB = isFutureSenkouSpanAOverB;
|
||||
conditions.isFutureSenkouSpanAUnderB = isFutureSenkouSpanAUnderB;
|
||||
conditions.isFutureSenkouSpanAOverLast = isFutureSenkouSpanAOverLast;
|
||||
conditions.isFutureSenkouSpanAUnderLast = isFutureSenkouSpanAUnderLast;
|
||||
|
||||
//
|
||||
conditions.isSenkouSpanACrossedOverB = isSenkouSpanACrossedOverB;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+41
-22
@@ -24,6 +24,7 @@
|
||||
|
||||
//
|
||||
#include "../Classes/x-saherelm.x121.xea.class.mq5"
|
||||
#include "../Signallers/x-saherelm.x110.signaller.class.mq5"
|
||||
#include "../Signallers/x-saherelm.x121.signaller.class.mq5"
|
||||
#include "../Signallers/x-saherelm.x786.signaller.class.mq5"
|
||||
|
||||
@@ -234,21 +235,33 @@ bool InitialEA()
|
||||
Clean(iDescriptor.signallers);
|
||||
|
||||
//
|
||||
ArrayResize(iDescriptor.signallers, 2);
|
||||
ArrayResize(iDescriptor.signallers, 3);
|
||||
|
||||
//
|
||||
// X786 Signaller ...
|
||||
X786Signaller *x786Signaller = new X786Signaller();
|
||||
x786Signaller.Default();
|
||||
x786Signaller.allowLong = false; // x121EAAllowLong;
|
||||
x786Signaller.allowShort = false; // x121EAAllowShort;
|
||||
|
||||
//
|
||||
// X121 Signaller ...
|
||||
X121Signaller *x121Signaller = new X121Signaller();
|
||||
x121Signaller.Default();
|
||||
x121Signaller.allowLong = false; // x121EAAllowLong;
|
||||
x121Signaller.allowShort = false; // x121EAAllowShort;
|
||||
|
||||
//
|
||||
// X110 Signaller ...
|
||||
X110Signaller *x110Signaller = new X110Signaller();
|
||||
x110Signaller.Default();
|
||||
x110Signaller.allowLong = x121EAAllowLong;
|
||||
x110Signaller.allowShort = x121EAAllowShort;
|
||||
|
||||
//
|
||||
iDescriptor.signallers[0] = x786Signaller;
|
||||
iDescriptor.signallers[1] = x121Signaller;
|
||||
iDescriptor.signallers[2] = x110Signaller;
|
||||
|
||||
//
|
||||
// Set Inputs to Default ...
|
||||
@@ -988,17 +1001,7 @@ void ApplyPreDefineConfigurations(X121ProviderDescriptor &iDescriptor)
|
||||
//
|
||||
bool isX786 = false;
|
||||
bool isX121 = false;
|
||||
|
||||
|
||||
//
|
||||
// XHULL ...
|
||||
iDescriptor.inputs.hullInputs.showUpZone = false;
|
||||
iDescriptor.inputs.hullInputs.showDownZone = false;
|
||||
|
||||
//
|
||||
// XSSLC ...
|
||||
iDescriptor.inputs.sslcInputs.showUp = false;
|
||||
iDescriptor.inputs.sslcInputs.showDown = false;
|
||||
bool isX110 = false;
|
||||
|
||||
//
|
||||
if (isX786)
|
||||
@@ -1007,22 +1010,38 @@ void ApplyPreDefineConfigurations(X121ProviderDescriptor &iDescriptor)
|
||||
|
||||
//
|
||||
if (isX121)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (isX110)
|
||||
{
|
||||
//
|
||||
iDescriptor.inputs.mrbInputs.showFastMa = isX121;
|
||||
iDescriptor.inputs.mrbInputs.showSlowMa = isX121;
|
||||
iDescriptor.inputs.mrbInputs.showRibbon = isX121;
|
||||
iDescriptor.inputs.strInputs.showTrends = isX110;
|
||||
|
||||
//
|
||||
iDescriptor.inputs.mcInputs.showFastMa = isX121;
|
||||
iDescriptor.inputs.mcInputs.showSlowMa = isX121;
|
||||
iDescriptor.inputs.mcInputs.showVerifierMa = isX121;
|
||||
iDescriptor.inputs.mcInputs.showVerifierMa = isX110;
|
||||
|
||||
//
|
||||
iDescriptor.inputs.cheInputs.showLongExit1Line = isX121;
|
||||
iDescriptor.inputs.cheInputs.showShortExit1Line = isX121;
|
||||
iDescriptor.inputs.cheInputs.showLongExit2Line = isX121;
|
||||
iDescriptor.inputs.cheInputs.showShortExit2Line = isX121;
|
||||
iDescriptor.inputs.ichInputs.showKumo = isX110;
|
||||
iDescriptor.inputs.ichInputs.showKijunSen = isX110;
|
||||
iDescriptor.inputs.ichInputs.showTenkanSen = isX110;
|
||||
iDescriptor.inputs.ichInputs.showSenkouSpanA = isX110;
|
||||
iDescriptor.inputs.ichInputs.showSenkouSpanB = isX110;
|
||||
|
||||
//
|
||||
iDescriptor.inputs.cheInputs.showLongExit1Line = isX110;
|
||||
iDescriptor.inputs.cheInputs.showShortExit1Line = isX110;
|
||||
iDescriptor.inputs.cheInputs.showLongExit2Line = isX110;
|
||||
iDescriptor.inputs.cheInputs.showShortExit2Line = isX110;
|
||||
|
||||
//
|
||||
iDescriptor.inputs.pvInputs.showPeaksAndVales = isX110;
|
||||
iDescriptor.inputs.pvInputs.showFibo1Levels = isX110;
|
||||
iDescriptor.inputs.pvInputs.showFibo2Levels = isX110;
|
||||
iDescriptor.inputs.pvInputs.showFibo3Levels = isX110;
|
||||
iDescriptor.inputs.pvInputs.showFibo4Levels = isX110;
|
||||
iDescriptor.inputs.pvInputs.showFibo5Levels = isX110;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -241,6 +241,8 @@ public:
|
||||
ArraySetAsSeries(chikouSpanBuffer, true);
|
||||
ArraySetAsSeries(senkouSpanABuffer, true);
|
||||
ArraySetAsSeries(senkouSpanBBuffer, true);
|
||||
ArraySetAsSeries(futureSenkouSpanABuffer, true);
|
||||
ArraySetAsSeries(futureSenkouSpanBBuffer, true);
|
||||
|
||||
//
|
||||
mHandler = iCustom(
|
||||
@@ -507,21 +509,6 @@ public:
|
||||
int barIndex // Bar Index
|
||||
)
|
||||
{
|
||||
//
|
||||
barIndex += mInputs.kijunSenLength;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (barIndex > ArraySize(senkouSpanABuffer))
|
||||
{
|
||||
barIndex = ArraySize(senkouSpanABuffer) - 1;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate();
|
||||
|
||||
@@ -545,7 +532,7 @@ public:
|
||||
//
|
||||
// Copy Items ...
|
||||
return Copy(
|
||||
start + mInputs.kijunSenLength,
|
||||
start,
|
||||
count,
|
||||
senkouSpanABuffer,
|
||||
buffer,
|
||||
@@ -580,21 +567,6 @@ public:
|
||||
int barIndex // Bar Index
|
||||
)
|
||||
{
|
||||
//
|
||||
barIndex += mInputs.kijunSenLength;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (barIndex > ArraySize(senkouSpanBBuffer))
|
||||
{
|
||||
barIndex = ArraySize(senkouSpanBBuffer) - 1;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate();
|
||||
|
||||
@@ -618,7 +590,7 @@ public:
|
||||
//
|
||||
// Copy Items ...
|
||||
return Copy(
|
||||
start + mInputs.kijunSenLength,
|
||||
start,
|
||||
count,
|
||||
senkouSpanBBuffer,
|
||||
buffer,
|
||||
@@ -654,10 +626,7 @@ public:
|
||||
)
|
||||
{
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
barIndex -= mInputs.kijunSenLength;
|
||||
|
||||
//
|
||||
Calculate();
|
||||
@@ -682,9 +651,9 @@ public:
|
||||
//
|
||||
// Copy Items ...
|
||||
return Copy(
|
||||
start,
|
||||
start - mInputs.kijunSenLength,
|
||||
count,
|
||||
senkouSpanABuffer,
|
||||
futureSenkouSpanABuffer,
|
||||
buffer,
|
||||
forceClean
|
||||
//
|
||||
@@ -692,7 +661,7 @@ public:
|
||||
}
|
||||
|
||||
//
|
||||
// SenkouSpanB ...
|
||||
// Future SenkouSpanB ...
|
||||
|
||||
//
|
||||
double GetFutureSenkouSpanB(
|
||||
@@ -700,10 +669,7 @@ public:
|
||||
)
|
||||
{
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
barIndex -= mInputs.kijunSenLength;
|
||||
|
||||
//
|
||||
Calculate();
|
||||
@@ -728,9 +694,9 @@ public:
|
||||
//
|
||||
// Copy Items ...
|
||||
return Copy(
|
||||
start,
|
||||
start - mInputs.kijunSenLength,
|
||||
count,
|
||||
senkouSpanBBuffer,
|
||||
futureSenkouSpanBBuffer,
|
||||
buffer,
|
||||
forceClean
|
||||
//
|
||||
@@ -754,6 +720,8 @@ private:
|
||||
double chikouSpanBuffer[];
|
||||
double senkouSpanABuffer[];
|
||||
double senkouSpanBBuffer[];
|
||||
double futureSenkouSpanABuffer[];
|
||||
double futureSenkouSpanBBuffer[];
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
@@ -820,6 +788,28 @@ private:
|
||||
senkouSpanBBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// SenkouSpan A ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
X_ICH_SENKOUSPANA_LINE,
|
||||
0 - mInputs.kijunSenLength,
|
||||
totalBars,
|
||||
futureSenkouSpanABuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// SenkouSpan B ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
X_ICH_SENKOUSPANB_LINE,
|
||||
0 - mInputs.kijunSenLength,
|
||||
totalBars,
|
||||
futureSenkouSpanBBuffer
|
||||
//
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -5780,7 +5780,8 @@ int Copy(
|
||||
int count, // Number of Items for read
|
||||
T &source[], // Source Buffer
|
||||
T &dest[], // Dest Buffer
|
||||
bool forceClean = true // Force To Clean buffer
|
||||
bool forceClean = true, // Force To Clean buffer
|
||||
bool forceStart = true // Force To Clean buffer
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -5793,7 +5794,7 @@ int Copy(
|
||||
}
|
||||
|
||||
//
|
||||
if (start < 0)
|
||||
if (start < 0 && forceStart)
|
||||
{
|
||||
start = 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
///////////////////////////////////////////////////////
|
||||
//
|
||||
// SaherElm IT Center MQL5 Class Library
|
||||
// ----------------------------------------------
|
||||
// Name: X110Signaller
|
||||
// Description: Signalling using X121 rules ...
|
||||
//
|
||||
//
|
||||
// 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 "../Libraries/x-saherelm.xtrade.lib.mq5"
|
||||
#include "../Classes/x-saherelm.x121.xmcycle.class.mq5"
|
||||
|
||||
//
|
||||
// Definitions ...
|
||||
|
||||
//
|
||||
// Class ...
|
||||
class X110Signaller : public XSignallerDescriptor
|
||||
{
|
||||
//
|
||||
// Public ...
|
||||
public:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Constructor(s) ...
|
||||
void X110Signaller()
|
||||
{
|
||||
name = X110;
|
||||
Default();
|
||||
}
|
||||
|
||||
//
|
||||
// Deconstructor ...
|
||||
void ~X110Signaller() {}
|
||||
|
||||
//
|
||||
// Override(s) ...
|
||||
|
||||
//
|
||||
bool HasLongConditions(
|
||||
const X121MCycleConditions &conditions, // Market Conditions
|
||||
double &sl, // Hold SL ...
|
||||
double &tp // Hold TP ...
|
||||
) override
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
sl = 0;
|
||||
tp = 0;
|
||||
|
||||
//
|
||||
result = allowLong;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isCloseOverSenkouSpanA = conditions.bars[1].close > conditions.ichSenkouSpanAs[1];
|
||||
|
||||
//
|
||||
bool isBaseBullish = isCloseOverSenkouSpanA &&
|
||||
conditions.isSenkouSpanAOverB &&
|
||||
conditions.isSenkouSpanAOverLast;
|
||||
|
||||
//
|
||||
bool isKijunSenOverSenkouSpanA = conditions.ichKijunSens[1] > conditions.ichSenkouSpanAs[1];
|
||||
|
||||
//
|
||||
bool isCloseOverTenkanSen = conditions.bars[1].close > conditions.ichTenkanSens[1];
|
||||
|
||||
//
|
||||
bool isPriceCloseCrossedUpTenkanSen = conditions.bars[2].close <= conditions.ichTenkanSens[2] &&
|
||||
conditions.bars[1].close > conditions.ichTenkanSens[1];
|
||||
|
||||
//
|
||||
double cKumoUpper = MathMax(conditions.ichSenkouSpanAs[1], conditions.ichSenkouSpanBs[1]);
|
||||
double pKumoUpper = MathMax(conditions.ichSenkouSpanAs[2], conditions.ichSenkouSpanBs[2]);
|
||||
|
||||
//
|
||||
double cKumoLower = MathMin(conditions.ichSenkouSpanAs[1], conditions.ichSenkouSpanBs[1]);
|
||||
double pKumoLower = MathMin(conditions.ichSenkouSpanAs[2], conditions.ichSenkouSpanBs[2]);
|
||||
|
||||
//
|
||||
bool isTenkanSenOverKumo = conditions.ichTenkanSens[1] > cKumoUpper;
|
||||
bool isTenkanSenOverKumoPrev = conditions.ichTenkanSens[2] > pKumoUpper;
|
||||
|
||||
//
|
||||
bool isTenkanSenUnderKumo = conditions.ichTenkanSens[1] < cKumoLower;
|
||||
bool isTenkanSenUnderKumoPrev = conditions.ichTenkanSens[2] < pKumoLower;
|
||||
|
||||
//
|
||||
bool isTenkanSenCrossedOverKumo = isTenkanSenOverKumo &&
|
||||
!isTenkanSenOverKumoPrev;
|
||||
|
||||
//
|
||||
bool isTenkanSenCrossedUnderKumo = isTenkanSenUnderKumo &&
|
||||
!isTenkanSenUnderKumoPrev;
|
||||
|
||||
//
|
||||
bool condition1 =
|
||||
isBaseBullish &&
|
||||
isCloseOverTenkanSen &&
|
||||
isKijunSenOverSenkouSpanA &&
|
||||
conditions.isTenkanSenCrossedOverKijunSen;
|
||||
|
||||
//
|
||||
bool condition2 =
|
||||
isBaseBullish &&
|
||||
isCloseOverTenkanSen &&
|
||||
isKijunSenOverSenkouSpanA &&
|
||||
conditions.isTenkanSenOverKijunSen &&
|
||||
conditions.isSenkouSpanACrossedOverB;
|
||||
|
||||
//
|
||||
bool condition3 =
|
||||
isBaseBullish &&
|
||||
isKijunSenOverSenkouSpanA &&
|
||||
isPriceCloseCrossedUpTenkanSen &&
|
||||
conditions.isTenkanSenOverKijunSen;
|
||||
|
||||
//
|
||||
bool condition4 =
|
||||
isCloseOverTenkanSen &&
|
||||
isTenkanSenCrossedOverKumo &&
|
||||
conditions.isTenkanSenOverKijunSen &&
|
||||
conditions.isFutureSenkouSpanAOverB &&
|
||||
conditions.isFutureSenkouSpanAOverLast;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
condition1
|
||||
//
|
||||
||
|
||||
//
|
||||
condition2
|
||||
//
|
||||
||
|
||||
//
|
||||
condition3
|
||||
//
|
||||
||
|
||||
//
|
||||
condition4
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
sl = conditions.ichSenkouSpanBs[1];
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool HasShortConditions(
|
||||
const X121MCycleConditions &conditions, // Market Conditions
|
||||
double &sl, // Hold SL ...
|
||||
double &tp // Hold TP ...
|
||||
) override
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
sl = 0;
|
||||
tp = 0;
|
||||
|
||||
//
|
||||
result = allowLong;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isCloseUnderSenkouSpanB = conditions.bars[1].close < conditions.ichSenkouSpanBs[1];
|
||||
|
||||
//
|
||||
bool isBaseBearish = isCloseUnderSenkouSpanB &&
|
||||
conditions.isSenkouSpanAUnderB &&
|
||||
conditions.isSenkouSpanAUnderLast;
|
||||
|
||||
//
|
||||
bool isKijunSenUnderSenkouSpanB = conditions.ichKijunSens[1] < conditions.ichSenkouSpanBs[1];
|
||||
|
||||
//
|
||||
bool isCloseUnderTenkanSen = conditions.bars[1].close < conditions.ichTenkanSens[1];
|
||||
|
||||
//
|
||||
bool isPriceCloseCrossedDownTenkanSen = conditions.bars[2].close >= conditions.ichTenkanSens[2] &&
|
||||
conditions.bars[1].close < conditions.ichTenkanSens[1];
|
||||
|
||||
//
|
||||
double cKumoUpper = MathMax(conditions.ichSenkouSpanAs[1], conditions.ichSenkouSpanBs[1]);
|
||||
double pKumoUpper = MathMax(conditions.ichSenkouSpanAs[2], conditions.ichSenkouSpanBs[2]);
|
||||
|
||||
//
|
||||
double cKumoLower = MathMin(conditions.ichSenkouSpanAs[1], conditions.ichSenkouSpanBs[1]);
|
||||
double pKumoLower = MathMin(conditions.ichSenkouSpanAs[2], conditions.ichSenkouSpanBs[2]);
|
||||
|
||||
//
|
||||
bool isTenkanSenOverKumo = conditions.ichTenkanSens[1] > cKumoUpper;
|
||||
bool isTenkanSenOverKumoPrev = conditions.ichTenkanSens[2] > pKumoUpper;
|
||||
|
||||
//
|
||||
bool isTenkanSenUnderKumo = conditions.ichTenkanSens[1] < cKumoLower;
|
||||
bool isTenkanSenUnderKumoPrev = conditions.ichTenkanSens[2] < pKumoLower;
|
||||
|
||||
//
|
||||
bool isTenkanSenCrossedOverKumo = isTenkanSenOverKumo &&
|
||||
!isTenkanSenOverKumoPrev;
|
||||
|
||||
//
|
||||
bool isTenkanSenCrossedUnderKumo = isTenkanSenUnderKumo &&
|
||||
!isTenkanSenUnderKumoPrev;
|
||||
|
||||
//
|
||||
bool condition1 =
|
||||
isBaseBearish &&
|
||||
isCloseUnderTenkanSen &&
|
||||
isKijunSenUnderSenkouSpanB &&
|
||||
conditions.isTenkanSenCrossedUnderKijunSen;
|
||||
|
||||
//
|
||||
bool condition2 =
|
||||
isBaseBearish &&
|
||||
isCloseUnderTenkanSen &&
|
||||
isKijunSenUnderSenkouSpanB &&
|
||||
conditions.isTenkanSenUnderKijunSen &&
|
||||
conditions.isSenkouSpanACrossedUnderB;
|
||||
|
||||
//
|
||||
bool condition3 =
|
||||
isBaseBearish &&
|
||||
isKijunSenUnderSenkouSpanB &&
|
||||
isPriceCloseCrossedDownTenkanSen &&
|
||||
conditions.isTenkanSenUnderKijunSen;
|
||||
|
||||
//
|
||||
bool condition4 =
|
||||
isCloseUnderTenkanSen &&
|
||||
isTenkanSenCrossedUnderKumo &&
|
||||
conditions.isTenkanSenUnderKijunSen &&
|
||||
conditions.isFutureSenkouSpanAUnderB &&
|
||||
conditions.isFutureSenkouSpanAUnderLast;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
condition1
|
||||
//
|
||||
||
|
||||
//
|
||||
condition2
|
||||
//
|
||||
||
|
||||
//
|
||||
condition3
|
||||
//
|
||||
||
|
||||
//
|
||||
condition4
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
sl = conditions.ichSenkouSpanAs[1];
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
allowLong = true;
|
||||
allowShort = true;
|
||||
|
||||
//
|
||||
r2r = 1;
|
||||
|
||||
//
|
||||
staticVolumeLong = 0.01;
|
||||
staticVolumeShort = 0.01;
|
||||
}
|
||||
};
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
tp = 0;
|
||||
|
||||
//
|
||||
result = enableLong;
|
||||
result = allowLong;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
tp = 0;
|
||||
|
||||
//
|
||||
result = enableShort;
|
||||
result = allowShort;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -175,8 +175,8 @@ public:
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
enableLong = true;
|
||||
enableShort = true;
|
||||
allowLong = true;
|
||||
allowShort = true;
|
||||
|
||||
//
|
||||
r2r = 1;
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
tp = 0;
|
||||
|
||||
//
|
||||
result = enableLong;
|
||||
result = allowLong;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = enableShort;
|
||||
result = allowShort;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -180,8 +180,8 @@ public:
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
enableLong = true;
|
||||
enableShort = true;
|
||||
allowLong = true;
|
||||
allowShort = true;
|
||||
|
||||
//
|
||||
r2r = 1;
|
||||
|
||||
Reference in New Issue
Block a user