last ...
This commit is contained in:
@@ -889,6 +889,71 @@ class XCPOIDrawer : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Specified Trend Line ...
|
||||
*
|
||||
* @param fromPrice: double, from Price ...
|
||||
* @param fromTime: datetime, from Time ...
|
||||
* @param toPrice: double, to Price ...
|
||||
* @param toTime: datetime, to Time ...
|
||||
* @param name: Object Name ...
|
||||
* @param rayRight: bool, ray to Right ...
|
||||
* @param rayLeft: boo, ray to Left ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool DrawTrendLine(
|
||||
double fromPrice,
|
||||
datetime fromTime,
|
||||
double toPrice,
|
||||
datetime toTime,
|
||||
CChartObjectTrend *&object,
|
||||
string name,
|
||||
bool rayRight = false,
|
||||
bool rayLeft = false //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Prepare ...
|
||||
object = new CChartObjectTrend();
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
result =
|
||||
toPrice > 0 &&
|
||||
fromPrice > 0 &&
|
||||
IsSpecifiedValid(toTime) &&
|
||||
IsSpecifiedValid(fromTime) &&
|
||||
toTime > fromTime;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Create Object ...
|
||||
result = object.Create(
|
||||
ChartIdentification(),
|
||||
name,
|
||||
SubWindowIdentification(),
|
||||
fromTime,
|
||||
fromPrice,
|
||||
toTime,
|
||||
toPrice //
|
||||
);
|
||||
if (result) {
|
||||
//
|
||||
object.RayLeft(rayLeft);
|
||||
object.RayRight(rayRight);
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Trend Line based on Swings Points ...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user