last ...
This commit is contained in:
@@ -457,7 +457,7 @@ public:
|
||||
// Make them Configurable ...
|
||||
int levelsOnClose = 6;
|
||||
int requiredAgeForTrail = 0;
|
||||
int requiredDistanceForTrail = 5;
|
||||
int requiredDistanceForTrail = 30;
|
||||
|
||||
//
|
||||
int positionsCount = ArraySize(positions);
|
||||
@@ -531,8 +531,8 @@ public:
|
||||
//
|
||||
double sl =
|
||||
IsLong(iPosition.type)
|
||||
? iPosition.sl + slDiff
|
||||
: iPosition.sl - slDiff;
|
||||
? iPosition.sl + appliedSL
|
||||
: iPosition.sl - appliedSL;
|
||||
|
||||
//
|
||||
// double sl =
|
||||
@@ -717,12 +717,13 @@ public:
|
||||
|
||||
//
|
||||
double tpDiff = PointToPrice(priceDistance, iPosition.symbol);
|
||||
double appliedTP = tpDiff / 2;
|
||||
|
||||
//
|
||||
double tp =
|
||||
IsLong(iPosition.type)
|
||||
? iPosition.tp - tpDiff
|
||||
: iPosition.tp + tpDiff;
|
||||
? iPosition.tp - appliedTP
|
||||
: iPosition.tp + appliedTP;
|
||||
|
||||
//
|
||||
bool isInit = trail.Init(
|
||||
@@ -772,12 +773,13 @@ public:
|
||||
|
||||
//
|
||||
double tpDiff = PointToPrice(priceDistance, iPosition.symbol);
|
||||
double appliedTP = tpDiff / 2;
|
||||
|
||||
//
|
||||
double tp =
|
||||
isLong
|
||||
? iPosition.tp - tpDiff
|
||||
: iPosition.tp + tpDiff;
|
||||
? iPosition.tp - appliedTP
|
||||
: iPosition.tp + appliedTP;
|
||||
|
||||
//
|
||||
// Update Trail Values ...
|
||||
@@ -827,6 +829,10 @@ public:
|
||||
// for Volumes and Benefits ...
|
||||
int HandleSignalManagement(XSignal &signals[]) override
|
||||
{
|
||||
//
|
||||
// TODO: Make this Configurable ...
|
||||
int minDistanceBetweenTwoSameProviderSignal = 7;
|
||||
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
@@ -910,7 +916,20 @@ public:
|
||||
else if (positionsCount < 2)
|
||||
{
|
||||
//
|
||||
// First Signal in a While of Specific Provider ...
|
||||
// Next Signal in a While of Specific Provider ...
|
||||
|
||||
//
|
||||
// Find Longest Position and Check it's Age ...
|
||||
// Compare it by min age for same provider signals ...
|
||||
XPosition youngest;
|
||||
int youngestAge = GetYoungest(
|
||||
youngest,
|
||||
positions //
|
||||
);
|
||||
if (youngestAge == -1 || youngestAge < minDistanceBetweenTwoSameProviderSignal)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
AddRef(
|
||||
|
||||
Reference in New Issue
Block a user