Complete Support and Resistance POI ...

This commit is contained in:
2024-11-12 21:51:07 +03:30
parent 43ee49b32f
commit 797917e30a
5 changed files with 998 additions and 56 deletions
+157 -4
View File
@@ -870,6 +870,7 @@ class XCZoneObject : public XCBaseObject
* @param name: String, Specified Object Identifier on Chart ...
* @param window: Integer, Specified Chart Window ID ...
* @param zone: XCZone instance ...
* @param prefix: String ...
*
* @return ( bool )
*/
@@ -877,7 +878,8 @@ class XCZoneObject : public XCBaseObject
long chart_id,
string name,
int window,
XCZone &zone //
XCZone &zone,
string prefix = NULL //
)
{
//
@@ -897,17 +899,28 @@ class XCZoneObject : public XCBaseObject
}
//
if (IsValid(prefix))
{
name = prefix + "_" + name;
}
//
datetime from = zone.From();
datetime to = NormalizeTime(zone.To());
//
double upper = zone.Upper();
double lower = zone.Lower();
//
result = mRect.Create(
chart_id,
name,
window,
zone.From(),
zone.Upper(),
from,
upper,
to,
zone.Lower() //
lower //
);
//
@@ -973,6 +986,16 @@ class XCZoneObject : public XCBaseObject
mRect.Style(value);
}
/**
* Set Zone Fill ...
*
* @param value: Boolean ...
*/
void ZoneFill(bool value)
{
mRect.Fill(value);
}
//
private:
//
@@ -981,4 +1004,134 @@ class XCZoneObject : public XCBaseObject
//
};
//
// Support Zone ...
class XCSupportZoneObject : public XCZoneObject
{
//
public:
//
/**
* Creator ...
*
* @param chart_id: Long, Specified Chart ID ...
* @param window: Integer, Specified Chart Window ID ...
* @param zone: XCSupportZone instance ...
* @param prefix: String ...
*
* @return ( bool )
*/
bool Create(
long chart_id,
int window,
XCSupportZone &zone,
string prefix = NULL //
)
{
//
bool result = false;
//
result = zone.IsValid();
if (!result)
{
return result;
}
//
string name = zone.GetTag();
//
result = CreateByZone(
chart_id,
name,
window,
zone,
prefix //
);
//
return result;
}
//
// Virtual ...
/**
* Retrieve Object Type ...
*
* @return ( ENUM_XCHARTOBJECTS )
*/
virtual ENUM_XCHARTOBJECTS Type()
{
return X_SUPPORT_ZONE_OBJ;
}
};
//
// Resistance Zone ...
class XCResistanceZoneObject : public XCZoneObject
{
//
public:
//
/**
* Creator ...
*
* @param chart_id: Long, Specified Chart ID ...
* @param window: Integer, Specified Chart Window ID ...
* @param zone: XCResistanceZone instance ...
* @param prefix: String ...
*
* @return ( bool )
*/
bool Create(
long chart_id,
int window,
XCResistanceZone &zone,
string prefix = NULL //
)
{
//
bool result = false;
//
result = zone.IsValid();
if (!result)
{
return result;
}
//
string name = zone.GetTag();
//
result = CreateByZone(
chart_id,
name,
window,
zone,
prefix //
);
//
return result;
}
//
// Virtual ...
/**
* Retrieve Object Type ...
*
* @return ( ENUM_XCHARTOBJECTS )
*/
virtual ENUM_XCHARTOBJECTS Type()
{
return X_RESISTANCE_ZONE_OBJ;
}
};
//