This commit is contained in:
2025-05-12 07:43:24 +03:30
parent 1910c42462
commit a02bf1ba13
3 changed files with 161 additions and 18 deletions
+59
View File
@@ -5588,6 +5588,65 @@ struct XBoxZone
//
double diffAvg = (upper - lower) / 2;
result = lower + diffAvg;
result = NormalizePrice(result, symbol);
//
return result;
}
/**
* Calculate Box Leg N Price ...
* N default is 2
*
* @param leg: int ...
*
* @return ( double )
*/
double GetLeg(int leg = 2)
{
//
double result = 0;
//
leg = NormalizeInt(leg, 2);
//
if (!IsValid())
{
return result;
}
//
double range = (upper - lower) * leg;
result =
IsBullish()
? upper + range
: lower - range;
result = NormalizePrice(result, symbol);
//
return result;
}
/**
* Calculate Box Range ...
*
* @return ( double )
*/
double GetRange()
{
//
double result = 0;
//
if (!IsValid())
{
return result;
}
//
result = (upper - lower);
result = NormalizePrice(result, symbol);
//
return result;