This commit is contained in:
2024-06-21 06:45:33 +03:30
parent e9e313fa58
commit a5cb716d0b
7 changed files with 1268 additions and 761 deletions
+731
View File
@@ -2339,3 +2339,734 @@
rEntry = 0;
isSignalPrepared = false;
}
///////////////////////////////////////////////////////////////////////
//
if (canUseCF)
{
//
signal.cf.Draw();
XOHCL cfBULLBar = signal.cf.GetBullishBar();
XOHCL cfBEARBar = signal.cf.GetBearishBar();
//
if (isLong)
{
//
// Supports For Longs ...
//
// CF Bullish ...
//
// HIGH ...
//
condition = entryPrice < cfBULLBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.high;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice > cfBULLBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.high;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
// LOW ...
//
condition = entryPrice > cfBULLBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.low;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice < cfBULLBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.low;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
// CF Bearish ...
//
// HIGH ...
//
condition = entryPrice < cfBEARBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.high;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice > cfBEARBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.high;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
// LOW ...
//
condition = entryPrice > cfBEARBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.low;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice < cfBEARBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.low;
rType = POSITION_TYPE_SELL;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
}
else
{
//
// Supports For Shorts ...
//
// CF Bullish ...
//
// HIGH ...
//
condition = entryPrice < cfBULLBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.high;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice > cfBULLBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.high;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
// LOW ...
//
condition = entryPrice > cfBULLBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.low;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice < cfBULLBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBULLBar.low;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
// CF Bearish ...
//
// HIGH ...
//
condition = entryPrice < cfBEARBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.high;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice > cfBEARBar.high;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.high;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
// LOW ...
//
condition = entryPrice > cfBEARBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.low;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_LIMIT;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
//
condition = entryPrice < cfBEARBar.low;
if (condition)
{
//
// InDirectional ...
rEntry = cfBEARBar.low;
rType = POSITION_TYPE_BUY;
rMode = X_ORDER_MODE_STOP;
rVolume = signal.volume * inDirectionalVolumeMultiplier;
//
isSignalPrepared = rSignal.Prepare(
signal.symbol,
XEQMSupportToken + XINDirectionalToken,
signal.period,
rType,
rMode,
rEntry,
rVolume,
rSL,
rTP //
);
if (isSignalPrepared)
{
//
AddRef(
rSignal,
signal.supports //
);
//
rSignal.Clean();
//
rSL = 0;
rTP = 0;
rEntry = 0;
isSignalPrepared = false;
}
}
}
}
+39
View File
@@ -0,0 +1,39 @@
# Supporting Senarios
first check current Position Direction's
## Short
InDirectional
for short positions we only have Long Supports;
entry price must below the Lines;
and Lines Must below the SL of Positions, if it's Exists;
### Long Orders
after putting orders of InDirectionals;
set EQM Provider;
### Long Orders Supporting
now we have to find out when orders Executed;
after each InDirectional EQM Order Execution, we Have to Prepare a Directional Order
by it's volume on Signal Entry.
## Long
InDirectional
for long positions we only have short Supports;
entry price must above the Lines;
and Lines Must Above the SL of Positions, if it's Exists;
### Short Orders
after putting orders of InDirectionals;
set EQM Provider;
### Short Orders Supporting
now we have to find out when orders Executed;
after each InDirectional EQM Order Execution, we Have to Prepare a Directional Order
by it's volume on Signal Entry.