132 lines
No EOL
5 KiB
MQL5
132 lines
No EOL
5 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Config_FBS_TON.mqh |
|
|
//| Configurações FBS Crypto TON/USD |
|
|
//+------------------------------------------------------------------+
|
|
|
|
#ifndef CONFIG_FBS_TON_MQH
|
|
#define CONFIG_FBS_TON_MQH
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Configurações Específicas da FBS Crypto |
|
|
//+------------------------------------------------------------------+
|
|
|
|
// Configurações da Corretora FBS
|
|
#define FBS_CRYPTO_LEVERAGE 50 // Alavancagem da conta
|
|
#define FBS_MIN_SPREAD 0.7 // Spread mínimo da FBS (pips)
|
|
#define FBS_ACCOUNT_CURRENCY "USDT" // Moeda da conta
|
|
|
|
// Configurações do Par TON/USD
|
|
#define TON_SYMBOL_NAME "TONUSD" // Nome do símbolo (pode variar)
|
|
#define TON_MIN_LOT 0.01 // Lote mínimo para TON
|
|
#define TON_MAX_LOT 100.0 // Lote máximo para TON
|
|
#define TON_LOT_STEP 0.01 // Passo do lote
|
|
|
|
// Configurações de Risco para Crypto
|
|
#define CRYPTO_MAX_RISK 5.0 // Risco máximo por trade (%)
|
|
#define CRYPTO_MAX_DRAWDOWN 20.0 // Drawdown máximo (%)
|
|
#define CRYPTO_MIN_FREE_MARGIN 10.0 // Margem livre mínima (%)
|
|
|
|
// Configurações de Spread para Crypto
|
|
#define CRYPTO_MAX_SPREAD 3.0 // Spread máximo aceitável (pips)
|
|
#define CRYPTO_SLIPPAGE 5 // Slippage máximo
|
|
|
|
// Horários de Trading (UTC)
|
|
#define TRADING_START_HOUR 0 // Início (24h - crypto nunca para)
|
|
#define TRADING_END_HOUR 23 // Fim (24h - crypto nunca para)
|
|
|
|
// Configurações de Indicadores para TON/USD
|
|
#define TON_RSI_PERIOD 14 // Período RSI
|
|
#define TON_RSI_OVERSOLD 25 // Sobrevenda (mais conservador para crypto)
|
|
#define TON_RSI_OVERBOUGHT 75 // Sobrecompra (mais conservador para crypto)
|
|
#define TON_MA_FAST_PERIOD 21 // MA rápida
|
|
#define TON_MA_SLOW_PERIOD 50 // MA lenta
|
|
|
|
// Stop Loss e Take Profit Padrão para TON/USD
|
|
#define TON_DEFAULT_SL 100 // Stop Loss padrão (pips)
|
|
#define TON_DEFAULT_TP 200 // Take Profit padrão (pips)
|
|
#define TON_TRAILING_STOP 50 // Trailing Stop (pips)
|
|
|
|
// Configurações de Volatilidade para Crypto
|
|
#define CRYPTO_HIGH_VOLATILITY_THRESHOLD 5.0 // Limite de alta volatilidade (%)
|
|
#define CRYPTO_LOW_VOLATILITY_THRESHOLD 1.0 // Limite de baixa volatilidade (%)
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Função para Verificar Configurações da Conta |
|
|
//+------------------------------------------------------------------+
|
|
bool ValidateFBSCryptoAccount()
|
|
{
|
|
// Verificar se a alavancagem está correta
|
|
int accountLeverage = (int)AccountLeverage();
|
|
if(accountLeverage != FBS_CRYPTO_LEVERAGE)
|
|
{
|
|
Print("AVISO: Alavancagem esperada: ", FBS_CRYPTO_LEVERAGE, "x, atual: ", accountLeverage, "x");
|
|
}
|
|
|
|
// Verificar moeda da conta
|
|
string accountCurrency = AccountCurrency();
|
|
if(accountCurrency != FBS_ACCOUNT_CURRENCY)
|
|
{
|
|
Print("AVISO: Moeda da conta esperada: ", FBS_ACCOUNT_CURRENCY, ", atual: ", accountCurrency);
|
|
}
|
|
|
|
// Verificar se é conta demo ou real
|
|
if(IsDemo())
|
|
{
|
|
Print("CONTA DEMO detectada - Testando configurações");
|
|
}
|
|
else
|
|
{
|
|
Print("CONTA REAL detectada - Trading ativo");
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Configurações de Gestão de Risco por Horário |
|
|
//+------------------------------------------------------------------+
|
|
double GetRiskByTime()
|
|
{
|
|
int currentHour = Hour();
|
|
|
|
// Reduzir risco durante horários de maior volatilidade (notícias crypto)
|
|
if(currentHour >= 8 && currentHour <= 12) // Horário de notícias crypto
|
|
{
|
|
return CRYPTO_MAX_RISK * 0.5; // 50% do risco normal
|
|
}
|
|
else if(currentHour >= 20 && currentHour <= 23) // Horário de fechamento tradfi
|
|
{
|
|
return CRYPTO_MAX_RISK * 0.7; // 70% do risco normal
|
|
}
|
|
|
|
return CRYPTO_MAX_RISK; // Risco normal
|
|
}
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Verificar Condições de Mercado para TON |
|
|
//+------------------------------------------------------------------+
|
|
bool IsGoodMarketCondition()
|
|
{
|
|
// Verificar spread
|
|
double currentSpread = (Ask - Bid) / Point;
|
|
if(MarketInfo(Symbol(), MODE_DIGITS) == 5 || MarketInfo(Symbol(), MODE_DIGITS) == 3)
|
|
currentSpread = currentSpread / 10;
|
|
|
|
if(currentSpread > CRYPTO_MAX_SPREAD)
|
|
{
|
|
Print("Spread muito alto: ", DoubleToStr(currentSpread, 2), " pips");
|
|
return false;
|
|
}
|
|
|
|
// Verificar liquidez (volume)
|
|
double currentVolume = Volume[0];
|
|
if(currentVolume < 10) // Volume muito baixo
|
|
{
|
|
Print("Volume muito baixo: ", currentVolume);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
#endif // CONFIG_FBS_TON_MQH |