last works on XCZone test EA ...
This commit is contained in:
@@ -169,7 +169,8 @@ string ToString(ENUM_X_CHART_IDS value)
|
||||
bool ToSignal(
|
||||
XBoxZone &box,
|
||||
XSignal &signal,
|
||||
double &rewardRatios[] //
|
||||
double &rewardRatios[],
|
||||
double additionalSL = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -188,10 +189,15 @@ bool ToSignal(
|
||||
|
||||
//
|
||||
XOHCL entryBar;
|
||||
int entryIDX = box.ToIndex();
|
||||
if (entryIDX > 0)
|
||||
{
|
||||
entryIDX--;
|
||||
}
|
||||
result = entryBar.Init(
|
||||
box.symbol,
|
||||
box.period,
|
||||
box.ToIndex() - 1 //
|
||||
entryIDX //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
@@ -231,6 +237,14 @@ bool ToSignal(
|
||||
isBullish
|
||||
? box.lower
|
||||
: box.upper;
|
||||
if (additionalSL > 0)
|
||||
{
|
||||
//
|
||||
sl =
|
||||
isBullish
|
||||
? sl - additionalSL
|
||||
: sl + additionalSL;
|
||||
}
|
||||
|
||||
//
|
||||
double risk = MathAbs(entry - sl);
|
||||
|
||||
Reference in New Issue
Block a user