Initial Commit ...
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,184 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SaherElm IT Center MQL5 XEU5 Signal Provider Library Inputs
|
||||
// -----------------------------------------------------------
|
||||
//
|
||||
// Maintainer:
|
||||
// ------------
|
||||
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
||||
//
|
||||
//////////////////////////////////////////////////////
|
||||
//
|
||||
// Global Properties ...
|
||||
#property library
|
||||
#property copyright "Copyright 2023, SaherElm IT Center"
|
||||
#property link "https://www.saherelm.ir"
|
||||
#property version "1.00"
|
||||
#property strict
|
||||
|
||||
//
|
||||
// Include Logger ...
|
||||
#include "../Libraries/x-saherelm.log.lib.mq5";
|
||||
|
||||
//
|
||||
input group "XEU5 Provider";
|
||||
|
||||
//
|
||||
input group "XEU5 Common";
|
||||
input bool xEU5EnableProvider = true; // Enable Provider
|
||||
input bool xEU5EnableAlerts = false; // Enable Events Alert
|
||||
input int xEU5NumberOfItemsPerTick = 30; // Number Of items Readed In Each Tick
|
||||
|
||||
//
|
||||
input group "XEU5 Trader";
|
||||
input int xEU5MagicNumber = 16940561; // Trader MagicNumber
|
||||
input int xEU5Slippage = 10; // Trader Slippage
|
||||
|
||||
//
|
||||
input group "XEU5 Trade Management";
|
||||
input bool xEU5AllowLongTrades = true; // Allow Long Trades
|
||||
input bool xEU5AllowShortTrades = true; // Allow Short Trades
|
||||
|
||||
//
|
||||
input group "XEU5 Risk Management";
|
||||
//
|
||||
// Trade Count ...
|
||||
input int xEU5MaxAllowedTrades = 1; // Max Allowed Trades at Same Time
|
||||
input int xEU5MaxAllowedSupportTrades = 0; // Max Allowed Support Trades at Same Time
|
||||
//
|
||||
// Trades Age ...
|
||||
// 1 Day = 288
|
||||
// 14 Day = 4320
|
||||
input int xEU5MaxInProfitTradeAge = 0; // Max In Profit Trades Age
|
||||
input int xEU5MaxInDrawDownTradeAge = 0; // Max In DrawDown Trades Age
|
||||
//
|
||||
// Trade Volume ...
|
||||
input double xEU5StaticVolume = 0.05; // Static Volume
|
||||
input double xEU5VolumeMultiplier = 3; // Volume Multiplier
|
||||
input double xEU5MaxSupportedVolumePerTradeInLots = 1; // Max Supported Volume Per Trade in Lot
|
||||
//
|
||||
// Trade Profits ...
|
||||
input double xEU5MinRewardInPips = 15; // Minimum Reward Per Trade in Pips
|
||||
input double xEU5RiskFreeStepInPips = 3; // Risk Free Steps in Pips
|
||||
input double xEU5RiskFreeRate = 0.75; // Volume Multiplier for Risk Free
|
||||
//
|
||||
input double xEU5MaxAllowedRiskPerTradesMultiplier = 0; // Max Allowed Drawdown Per Trade Multiplier
|
||||
//
|
||||
// Account ...
|
||||
input double xEU5FreeMarginFactorForOpenTrades = 0.8; // Minimum Free Marging for Open Trades
|
||||
input double xEU5BalanceFactorForOpenTrades = 0.5; // Minimum Balance for Open Trades
|
||||
|
||||
//
|
||||
// Validate Inputs before Initialization ...
|
||||
bool XEU5ValidateInputs()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Implement Other Verifications ...
|
||||
|
||||
//
|
||||
// Check Trading Availability ...
|
||||
bool isTradeAvailable = xEU5AllowLongTrades || xEU5AllowShortTrades;
|
||||
if (!isTradeAvailable)
|
||||
{
|
||||
LogMessage("XEU5 => Warning: Trading disabled ...");
|
||||
}
|
||||
|
||||
//
|
||||
// Chekc Number of reading items per tick ...
|
||||
result = xEU5NumberOfItemsPerTick >= 5;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
LogMessage("XEU5 invalid Number of items Reading Per Tick ...");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Max Allowed Trades Count ...
|
||||
result = isTradeAvailable && xEU5MaxAllowedTrades >= 1;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
LogMessage("XEU5 Number of Trades not valid ...");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Free Margin ...
|
||||
result =
|
||||
isTradeAvailable &&
|
||||
xEU5FreeMarginFactorForOpenTrades > 0 &&
|
||||
xEU5FreeMarginFactorForOpenTrades < 1;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
LogMessage("XEU5 Invalid Free Margin ...");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check min Balance for Open Trades ...
|
||||
result =
|
||||
isTradeAvailable &&
|
||||
xEU5BalanceFactorForOpenTrades > 0 &&
|
||||
xEU5BalanceFactorForOpenTrades < 1;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
LogMessage("XEU5 Invalid Min Balance for Open Trades ...");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Min Reward Per Trade ...
|
||||
result = xEU5MinRewardInPips > 0;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
LogMessage("XEU5 Invalid Min Reward Per Trade ...");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Trades Volume ...
|
||||
result = xEU5StaticVolume > 0;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
LogMessage("XEU5 Invalid Static Volume ...");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Volume Multiplier ...
|
||||
result = xEU5VolumeMultiplier >= 0;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
LogMessage("XEU5 Invalid Volume Multiplier ...");
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = true;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user