last ...
This commit is contained in:
@@ -1678,46 +1678,48 @@ struct X121ProviderDescriptor
|
||||
//
|
||||
bool hasLong =
|
||||
//
|
||||
cHasLong
|
||||
(cHasLong &&
|
||||
sHasLong)
|
||||
//
|
||||
// ||
|
||||
// //
|
||||
// sHasLong
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// mHasLong
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// lHasLong
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// hHasLong
|
||||
&&
|
||||
//
|
||||
(
|
||||
//
|
||||
mHasLong
|
||||
//
|
||||
||
|
||||
//
|
||||
lHasLong
|
||||
//
|
||||
||
|
||||
//
|
||||
hHasLong
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool hasShort =
|
||||
//
|
||||
cHasShort
|
||||
(cHasShort &&
|
||||
sHasShort)
|
||||
//
|
||||
// ||
|
||||
// //
|
||||
// sHasShort
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// mHasShort
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// lHasShort
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// hHasShort
|
||||
&&
|
||||
//
|
||||
(
|
||||
//
|
||||
mHasShort
|
||||
//
|
||||
||
|
||||
//
|
||||
lHasShort
|
||||
//
|
||||
||
|
||||
//
|
||||
hHasShort
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
|
||||
@@ -438,6 +438,9 @@ public:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
bool enable;
|
||||
|
||||
//
|
||||
// Protected Positions ...
|
||||
XProtectedPosition protecteds[];
|
||||
@@ -543,6 +546,7 @@ public:
|
||||
//
|
||||
// Initial Class ...
|
||||
bool Init(
|
||||
bool mEnable,
|
||||
XSCTrade *trader,
|
||||
double mMinRequiredProfitPerTrade = 0.5,
|
||||
double mMinRequiredProfitPerTradeVolumeFactor = 0.01 //
|
||||
@@ -551,6 +555,9 @@ public:
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
this.enable = mEnable;
|
||||
|
||||
//
|
||||
result = trader != NULL;
|
||||
if (!result)
|
||||
@@ -575,6 +582,11 @@ public:
|
||||
// we have to call this in our EA Class ...
|
||||
void HandleState(const XOnTradeHandlerState &state)
|
||||
{
|
||||
//
|
||||
if (!enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
if (
|
||||
!state.hasNewDeal &&
|
||||
@@ -646,6 +658,11 @@ public:
|
||||
// for Handling Zone Recovery ...
|
||||
void Process()
|
||||
{
|
||||
//
|
||||
if (!enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int protectedsCount = ArraySize(protecteds);
|
||||
if (IsValidSize(protectedsCount))
|
||||
@@ -735,6 +752,12 @@ public:
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
if (!enable) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
int protectedIDX = FindProtectedIndex(ticket);
|
||||
result = protectedIDX >= 0;
|
||||
@@ -1231,7 +1254,7 @@ public:
|
||||
{
|
||||
//
|
||||
mProtector = new XSCPositionProtector();
|
||||
mProtector.Init(mTrader);
|
||||
mProtector.Init(false, mTrader);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user