last works ...

This commit is contained in:
2025-09-19 17:46:47 +03:30
parent c24dd6fe2a
commit 6f3639ef0b
2 changed files with 28 additions and 9 deletions
+1
View File
@@ -219,6 +219,7 @@ class XCBaseSignaller : public XCBase
// //
mProcessedTicksCount = 0; mProcessedTicksCount = 0;
ProcessNewBar(barIndex); ProcessNewBar(barIndex);
return;
} }
// //
+27 -9
View File
@@ -53,6 +53,13 @@ input bool eaMailAlerts = false; // Mail Alerts
input bool eaPushAlerts = false; // Push Alerts input bool eaPushAlerts = false; // Push Alerts
input bool eaTerminalAlerts = false; // Terminal Alerts input bool eaTerminalAlerts = false; // Terminal Alerts
//
input group "Configuration";
input bool eaProcessAllTicks = false; // Process All Ticks
input double eaSignallerR2R = 2.0; // Risk To Reward Ratio
input double eaSignallerVolume = 0.01; // Default Volume
input double eaSignallerRiskInPoint = 50; // Default Risk In Point
// //
// Indicator Inputs ... // Indicator Inputs ...
// //
@@ -147,6 +154,7 @@ int eaHandler = INVALID_HANDLE; // Indicator Handler ...
int eaCTHandler = INVALID_HANDLE; // Candle Timer Handler ... int eaCTHandler = INVALID_HANDLE; // Candle Timer Handler ...
// //
bool eaIsNewBar; // Check New Bar ...
ENUM_X_DIRECTION trendDir = X_DIRECTION_NONE; ENUM_X_DIRECTION trendDir = X_DIRECTION_NONE;
// //
@@ -219,11 +227,11 @@ int OnInit()
// //
// Configure Other Requirements ... // Configure Other Requirements ...
eaExpert.volume = 0.01;
eaExpert.riskInPoint = 200;
eaExpert.allowedTPSLStep = 10; eaExpert.allowedTPSLStep = 10;
eaExpert.riskToRewardRatio = 2;
eaExpert.minAllowedRiskInPoint = 20; eaExpert.minAllowedRiskInPoint = 20;
eaExpert.volume = eaSignallerVolume;
eaExpert.riskToRewardRatio = eaSignallerR2R;
eaExpert.riskInPoint = eaSignallerRiskInPoint;
// //
// Try to Initialize eaExpert ... // Try to Initialize eaExpert ...
@@ -291,10 +299,10 @@ int OnInit()
_Symbol, _Symbol,
_Period, _Period,
fimaInputs, fimaInputs,
true, // Process All Ticks ... eaProcessAllTicks, // Process All Ticks ...
2.0, // Signaller Risk to Reward Ratio ... eaSignallerR2R, // Signaller Risk to Reward Ratio ...
50, // Default Risk In Points ... eaSignallerRiskInPoint, // Default Risk In Points ...
0.01 // Defaul Volume ... eaSignallerVolume // Defaul Volume ...
); );
fima1Signaller.AddOnSignalEventHandler(OnSignalTriggered); fima1Signaller.AddOnSignalEventHandler(OnSignalTriggered);
@@ -404,8 +412,19 @@ void OnDeinit(const int reason)
void OnTick() void OnTick()
{ {
// //
eaIsNewBar = eaBarTracker.IsNewBar();
bool canProcess = eaProcessAllTicks
? true
: eaIsNewBar;
//
eaExpert.HandleOnTick(); eaExpert.HandleOnTick();
//
if (!canProcess)
{
return;
}
// //
DetectPatterns(); DetectPatterns();
@@ -714,8 +733,7 @@ void OnTradeStateChanged(const XOnTradeHandlerState &state)
void DetectPatterns() void DetectPatterns()
{ {
// //
bool isNewBar = eaBarTracker.IsNewBar(); if (!eaIsNewBar)
if (!isNewBar)
{ {
return; return;
} }