cleanup workspace ...
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include <Trade/Trade.mqh>
|
||||
#include "../Libraries/x-saherelm.draw.lib.mq5"
|
||||
#include "../Libraries/x-saherelm.common.lib.mq5"
|
||||
#include "../Classes/x-saherelm.xdata-collector.class.mq5"
|
||||
|
||||
//
|
||||
// Definitions ...
|
||||
@@ -2894,190 +2893,6 @@ typedef void (*TOnTradeStateChanged)(const XOnTradeHandlerState &state);
|
||||
//
|
||||
// Classes ...
|
||||
|
||||
//
|
||||
// Create a Signal Specfic Data Collector ...
|
||||
class XSCSignalCollector
|
||||
{
|
||||
//
|
||||
// Public ...
|
||||
public:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
void XSCSignalCollector()
|
||||
{
|
||||
//
|
||||
XSCDataCollector<XSignal> mBase;
|
||||
mBase.Clear();
|
||||
}
|
||||
|
||||
//
|
||||
// Deconstructor ...
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
//
|
||||
// Inheritanced Functions ...
|
||||
|
||||
//
|
||||
// Cleaning Store ...
|
||||
void Clear()
|
||||
{
|
||||
//
|
||||
XSCDataCollector<XSignal> mBase;
|
||||
|
||||
//
|
||||
mBase.Clear();
|
||||
}
|
||||
|
||||
//
|
||||
// Collect All Store ...
|
||||
int Collect(XSignal &result[])
|
||||
{
|
||||
//
|
||||
int mResult = 0;
|
||||
|
||||
//
|
||||
XSCDataCollector<XSignal> mBase;
|
||||
|
||||
//
|
||||
mResult = mBase.Collect(result);
|
||||
|
||||
//
|
||||
return mResult;
|
||||
}
|
||||
|
||||
//
|
||||
// Add Item To Store ...
|
||||
bool Add(XSignal &item)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
XSCDataCollector<XSignal> mBase;
|
||||
|
||||
//
|
||||
result = mBase.Add(item);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Add Item(s) To Store ...
|
||||
int Add(XSignal &items[])
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
XSCDataCollector<XSignal> mBase;
|
||||
|
||||
//
|
||||
result = mBase.Add(items);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Remove an Item from Store ...
|
||||
bool Remove(XSignal &item)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
XSCDataCollector<XSignal> mBase;
|
||||
|
||||
//
|
||||
result = mBase.Remove(item);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Custom Functions ...
|
||||
|
||||
//
|
||||
int CollectSignals(
|
||||
XSignal &result[], // Hold Result
|
||||
string symbol = NULL, // Trading Symbol
|
||||
string provider = NULL, // Signal Provider
|
||||
ENUM_TIMEFRAMES period = NULL, // Trading Timeframe
|
||||
ENUM_POSITION_TYPE type = NULL, // Long (Buy), Short (Sell)
|
||||
ENUM_X_ORDER_MODES mode = NULL // Execution Mode
|
||||
)
|
||||
{
|
||||
//
|
||||
int mResult = 0;
|
||||
|
||||
//
|
||||
XSignal signals[];
|
||||
int signalsCount = Collect(signals);
|
||||
if (signalsCount <= 0)
|
||||
{
|
||||
return mResult;
|
||||
}
|
||||
|
||||
//
|
||||
mResult = ArraySize(result);
|
||||
|
||||
//
|
||||
// Now we Have to Apply Filters ...
|
||||
for (int i = 0; i < signalsCount; i++)
|
||||
{
|
||||
//
|
||||
XSignal iSignal = signals[i];
|
||||
|
||||
//
|
||||
bool isFiltersPassed =
|
||||
iSignal.IsFiltersPassed(
|
||||
symbol,
|
||||
provider,
|
||||
period,
|
||||
type,
|
||||
mode
|
||||
//
|
||||
);
|
||||
if (!isFiltersPassed)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
AddRef(
|
||||
iSignal,
|
||||
result
|
||||
//
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
return mResult;
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
//
|
||||
// Private ...
|
||||
private:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
};
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user