last ...
This commit is contained in:
@@ -1678,46 +1678,48 @@ struct X121ProviderDescriptor
|
|||||||
//
|
//
|
||||||
bool hasLong =
|
bool hasLong =
|
||||||
//
|
//
|
||||||
cHasLong
|
(cHasLong &&
|
||||||
|
sHasLong)
|
||||||
//
|
//
|
||||||
// ||
|
&&
|
||||||
// //
|
//
|
||||||
// sHasLong
|
(
|
||||||
// //
|
//
|
||||||
// ||
|
mHasLong
|
||||||
// //
|
//
|
||||||
// mHasLong
|
||
|
||||||
// //
|
//
|
||||||
// ||
|
lHasLong
|
||||||
// //
|
//
|
||||||
// lHasLong
|
||
|
||||||
// //
|
//
|
||||||
// ||
|
hHasLong
|
||||||
// //
|
//
|
||||||
// hHasLong
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasShort =
|
bool hasShort =
|
||||||
//
|
//
|
||||||
cHasShort
|
(cHasShort &&
|
||||||
|
sHasShort)
|
||||||
//
|
//
|
||||||
// ||
|
&&
|
||||||
// //
|
//
|
||||||
// sHasShort
|
(
|
||||||
// //
|
//
|
||||||
// ||
|
mHasShort
|
||||||
// //
|
//
|
||||||
// mHasShort
|
||
|
||||||
// //
|
//
|
||||||
// ||
|
lHasShort
|
||||||
// //
|
//
|
||||||
// lHasShort
|
||
|
||||||
// //
|
//
|
||||||
// ||
|
hHasShort
|
||||||
// //
|
//
|
||||||
// hHasShort
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -438,6 +438,9 @@ public:
|
|||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool enable;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected Positions ...
|
// Protected Positions ...
|
||||||
XProtectedPosition protecteds[];
|
XProtectedPosition protecteds[];
|
||||||
@@ -543,6 +546,7 @@ public:
|
|||||||
//
|
//
|
||||||
// Initial Class ...
|
// Initial Class ...
|
||||||
bool Init(
|
bool Init(
|
||||||
|
bool mEnable,
|
||||||
XSCTrade *trader,
|
XSCTrade *trader,
|
||||||
double mMinRequiredProfitPerTrade = 0.5,
|
double mMinRequiredProfitPerTrade = 0.5,
|
||||||
double mMinRequiredProfitPerTradeVolumeFactor = 0.01 //
|
double mMinRequiredProfitPerTradeVolumeFactor = 0.01 //
|
||||||
@@ -551,6 +555,9 @@ public:
|
|||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
this.enable = mEnable;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = trader != NULL;
|
result = trader != NULL;
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -575,6 +582,11 @@ public:
|
|||||||
// we have to call this in our EA Class ...
|
// we have to call this in our EA Class ...
|
||||||
void HandleState(const XOnTradeHandlerState &state)
|
void HandleState(const XOnTradeHandlerState &state)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
if (!enable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
if (
|
if (
|
||||||
!state.hasNewDeal &&
|
!state.hasNewDeal &&
|
||||||
@@ -646,6 +658,11 @@ public:
|
|||||||
// for Handling Zone Recovery ...
|
// for Handling Zone Recovery ...
|
||||||
void Process()
|
void Process()
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
if (!enable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
int protectedsCount = ArraySize(protecteds);
|
int protectedsCount = ArraySize(protecteds);
|
||||||
if (IsValidSize(protectedsCount))
|
if (IsValidSize(protectedsCount))
|
||||||
@@ -735,6 +752,12 @@ public:
|
|||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!enable) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
int protectedIDX = FindProtectedIndex(ticket);
|
int protectedIDX = FindProtectedIndex(ticket);
|
||||||
result = protectedIDX >= 0;
|
result = protectedIDX >= 0;
|
||||||
@@ -1231,7 +1254,7 @@ public:
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
mProtector = new XSCPositionProtector();
|
mProtector = new XSCPositionProtector();
|
||||||
mProtector.Init(mTrader);
|
mProtector.Init(false, mTrader);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ bool InitialEA()
|
|||||||
|
|
||||||
//
|
//
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
ArrayResize(iDescriptor.signallers, 4);
|
ArrayResize(iDescriptor.signallers, 3);
|
||||||
|
|
||||||
//
|
//
|
||||||
iDescriptor.signallers[idx] = x786Signaller;
|
iDescriptor.signallers[idx] = x786Signaller;
|
||||||
@@ -334,8 +334,8 @@ bool InitialEA()
|
|||||||
idx++;
|
idx++;
|
||||||
iDescriptor.signallers[idx] = x110Signaller;
|
iDescriptor.signallers[idx] = x110Signaller;
|
||||||
idx++;
|
idx++;
|
||||||
iDescriptor.signallers[idx] = x92Signaller;
|
// iDescriptor.signallers[idx] = x92Signaller;
|
||||||
idx++;
|
// idx++;
|
||||||
// iDescriptor.signallers[idx] = x128Signaller;
|
// iDescriptor.signallers[idx] = x128Signaller;
|
||||||
// idx++;
|
// idx++;
|
||||||
// iDescriptor.signallers[idx] = xSPSignaller;
|
// iDescriptor.signallers[idx] = xSPSignaller;
|
||||||
|
|||||||
@@ -172,10 +172,24 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] > 0 &&
|
||||||
|
conditions.oscCcis[1] > 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] > 0 &&
|
||||||
|
conditions.oscMacdMains[1] > 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bullishScore > bearishScore * 1.5;
|
bullishScore > bearishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,10 +323,24 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] < 0 &&
|
||||||
|
conditions.oscCcis[1] < 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] < 0 &&
|
||||||
|
conditions.oscMacdMains[1] < 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bearishScore > bullishScore * 1.5;
|
bearishScore > bullishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,10 +106,25 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] > 0 &&
|
||||||
|
conditions.oscCcis[1] > 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] > 0 &&
|
||||||
|
conditions.oscMacdMains[1] > 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bullishScore > bearishScore * 1.5;
|
bullishScore > bearishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,10 +198,24 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] < 0 &&
|
||||||
|
conditions.oscCcis[1] < 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] < 0 &&
|
||||||
|
conditions.oscMacdMains[1] < 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bearishScore > bullishScore * 1.5;
|
bearishScore > bullishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,10 +113,24 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] > 0 &&
|
||||||
|
conditions.oscCcis[1] > 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] > 0 &&
|
||||||
|
conditions.oscMacdMains[1] > 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bullishScore > bearishScore * 1.5;
|
bullishScore > bearishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,10 +204,24 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] < 0 &&
|
||||||
|
conditions.oscCcis[1] < 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] < 0 &&
|
||||||
|
conditions.oscMacdMains[1] < 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bearishScore > bullishScore * 1.5;
|
bearishScore > bullishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,10 +143,24 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] > 0 &&
|
||||||
|
conditions.oscCcis[1] > 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] > 0 &&
|
||||||
|
conditions.oscMacdMains[1] > 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bullishScore > bearishScore * 1.5;
|
bullishScore > bearishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,10 +258,24 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOSCVerified =
|
||||||
|
//
|
||||||
|
(conditions.oscCcis[0] < 0 &&
|
||||||
|
conditions.oscCcis[1] < 0)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.oscMacdMains[0] < 0 &&
|
||||||
|
conditions.oscMacdMains[1] < 0)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
result =
|
result =
|
||||||
|
isOSCVerified &&
|
||||||
bearishScore > bullishScore * 1.5;
|
bearishScore > bullishScore * 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user