mt5-clear-winz25-scalper/WinFutLib/winz25Config.mqh

241 righe
20 KiB
MQL5

2025-12-09 08:50:19 -03:00
<EFBFBD><EFBFBD>//+------------------------------------------------------------------+
//| winz25_config.mqh |
//| Copyright 2025, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link "https://www.mql5.com"
//+------------------------------------------------------------------+
//| defines |
//+------------------------------------------------------------------+
// #define MacrosHello "Hello, world!"
// #define MacrosYear 2010
//+------------------------------------------------------------------+
//| DLL imports |
//+------------------------------------------------------------------+
// #import "user32.dll"
// int SendMessageA(int hWnd,int Msg,int wParam,int lParam);
// #import "my_expert.dll"
// int ExpertRecalculate(int wParam,int lParam);
// #import
//+------------------------------------------------------------------+
//| EX5 imports |
//+------------------------------------------------------------------+
// #import "stdlib.ex5"
// string ErrorDescription(int error_code);
// #import
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| WinQ25_Config.mqh |
//| Copyright 2024, Scalper Trading Bot |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, Scalper Trading Bot"
#property link "https://www.mql5.com"
//+------------------------------------------------------------------+
//| Configura<EFBFBD><EFBFBD>es predefinidas para diferentes perfis de risco |
//+------------------------------------------------------------------+
//--- Perfil CONSERVADOR
class ConfigConservador
{
public:
static double LotePadrao() { return 1.0; }
static double LoteAltaVolatilidade() { return 2.0; }
static int TakeProfitPadrao() { return 30; }
static int TakeProfitAltaVol() { return 80; }
static double RiscoMaximoDiario() { return 1.0; }
static int MaxOperacoesPerdedoras() { return 2; }
static int MaxTradesPorDia() { return 10; }
static double StopLossPercentual() { return 50.0; }
};
//--- Perfil MODERADO
class ConfigModerado
{
public:
static double LotePadrao() { return 1.0; }
static double LoteAltaVolatilidade() { return 3.0; }
static int TakeProfitPadrao() { return 50; }
static int TakeProfitAltaVol() { return 150; }
static double RiscoMaximoDiario() { return 2.0; }
static int MaxOperacoesPerdedoras() { return 3; }
static int MaxTradesPorDia() { return 15; }
static double StopLossPercentual() { return 50.0; }
};
//--- Perfil AGRESSIVO
class ConfigAgressivo
{
public:
static double LotePadrao() { return 2.0; }
static double LoteAltaVolatilidade() { return 5.0; }
static int TakeProfitPadrao() { return 80; }
static int TakeProfitAltaVol() { return 200; }
static double RiscoMaximoDiario() { return 3.0; }
static int MaxOperacoesPerdedoras() { return 4; }
static int MaxTradesPorDia() { return 25; }
static double StopLossPercentual() { return 50.0; }
};
//+------------------------------------------------------------------+
//| Configura<EFBFBD><EFBFBD>es de hor<EFBFBD>rios espec<EFBFBD>ficos do mercado brasileiro |
//+------------------------------------------------------------------+
class HorariosBrasil
{
public:
//--- Hor<EFBFBD>rios em formato HHMM
static int InicioLeilaoAberturaBMF() { return 900; }
static int FimLeilaoAberturaBMF() { return 915; }
static int InicioTradingBMF() { return 915; }
static int InicioLeilaoAberturaBovespa() { return 1000; }
static int FimLeilaoAberturaBovespa() { return 1015; }
static int AberturaEUA() { return 1030; }
static int InicioAlmoco() { return 1200; }
static int FimAlmoco() { return 1400; }
static int InicioLeilaoFechamentoBovespa() { return 1645; }
static int FechamentoBovespa() { return 1700; }
static int FechamentoBMF() { return 1800; }
//--- Verificar se <EFBFBD> hor<EFBFBD>rio de alta volatilidade
static bool IsAltaVolatilidade(int horaMinuto)
{
// 09:15-10:00: Ap<EFBFBD>s leil<EFBFBD>o BMF
if(horaMinuto >= 915 && horaMinuto < 1000) return true;
// 10:00-11:00: Abertura Bovespa + prepara<EFBFBD><EFBFBD>o EUA
if(horaMinuto >= 1000 && horaMinuto < 1100) return true;
// 17:00-18:00: Fechamento
if(horaMinuto >= 1700 && horaMinuto < 1800) return true;
return false;
}
//--- Verificar se <EFBFBD> hor<EFBFBD>rio de trading permitido
static bool IsTradingPermitido(int horaMinuto)
{
// 09:15-10:00: Ap<EFBFBD>s leil<EFBFBD>o abertura BMF
if(horaMinuto >= 915 && horaMinuto < 1000) return true;
// 10:15-12:00: Bovespa + prepara<EFBFBD><EFBFBD>o EUA
if(horaMinuto >= 1015 && horaMinuto < 1200) return true;
// 14:00-16:45: Per<EFBFBD>odo da tarde
if(horaMinuto >= 1400 && horaMinuto < 1645) return true;
// 17:00-18:00: Ap<EFBFBD>s fechamento Bovespa
if(horaMinuto >= 1700 && horaMinuto < 1800) return true;
return false;
}
//--- Verificar se deve evitar trading (hor<EFBFBD>rios de leil<EFBFBD>o)
static bool IsHorarioEvitar(int horaMinuto)
{
// Leil<EFBFBD>o abertura BMF
if(horaMinuto >= 900 && horaMinuto < 915) return true;
// Leil<EFBFBD>o abertura Bovespa
if(horaMinuto >= 1000 && horaMinuto < 1015) return true;
// Hor<EFBFBD>rio de almo<EFBFBD>o
if(horaMinuto >= 1200 && horaMinuto < 1400) return true;
// Leil<EFBFBD>o fechamento Bovespa
if(horaMinuto >= 1645 && horaMinuto < 1700) return true;
return false;
}
};
//+------------------------------------------------------------------+
//| Configura<EFBFBD><EFBFBD>es espec<EFBFBD>ficas do s<EFBFBD>mbolo WinQ25 |
//+------------------------------------------------------------------+
class ConfigWinQ25
{
public:
static string Simbolo() { return "WINQ25"; }
static double PontoMinimo() { return 5.0; } // Tick m<EFBFBD>nimo do WinQ25
static double ValorPonto() { return 0.2; } // Valor de cada ponto em R$
static double MargemRequerida() { return 4000.0; } // Margem aproximada em R$
//--- Calcular valor monet<EFBFBD>rio de pontos
static double PontosParaReais(int pontos)
{
return pontos * ValorPonto();
}
//--- Calcular quantos lotes s<EFBFBD>o seguros baseado no saldo
static double CalcularLoteSeguro(double saldo, double riscoPorcentual)
{
double riscoReais = saldo * (riscoPorcentual / 100.0);
double loteMaximo = MathFloor(saldo / MargemRequerida());
// N<EFBFBD>o usar mais que 50% da margem dispon<EFBFBD>vel
return MathMin(loteMaximo * 0.5, 5.0);
}
};
//+------------------------------------------------------------------+
//| Configura<EFBFBD><EFBFBD>es de indicadores t<EFBFBD>cnicos |
//+------------------------------------------------------------------+
class ConfigIndicadores
{
public:
static int PeriodoMediaRapida() { return 9; }
static int PeriodoMediaLenta() { return 21; }
static int PeriodoRSI() { return 14; }
static int RSISobrecomprado() { return 70; }
static int RSISobrevendido() { return 30; }
static int PeriodoBollingerBands() { return 20; }
static double DesviosBollinger() { return 2.0; }
static int PeriodoADX() { return 14; }
static double ADXTendenciaForte() { return 25.0; }
};
//+------------------------------------------------------------------+
//| Mensagens padr<EFBFBD>o do sistema |
//+------------------------------------------------------------------+
class Mensagens
{
public:
static string InicioOperacao() { return "=== NOVA OPERA<00><00>O WINQ25 ==="; }
static string OperacaoVencedora() { return "=== TRADE VENCEDOR - WINQ25 ==="; }
static string OperacaoPerdedora() { return "=== TRADE PERDEDOR - WINQ25 ==="; }
static string LimiteRiscoAtingido() { return "ATEN<00><00>O: Limite de risco di<00>rio atingido!"; }
static string MaximoTradesAtingido() { return "M<00>ximo de trades por dia atingido"; }
static string HorarioNaoPermitido() { return "Opera<00><00>o fora do hor<00>rio permitido"; }
static string NovoDialogTrading() { return "=== NOVO DIA DE TRADING WINQ25 ==="; }
};
//+------------------------------------------------------------------+
//| Configura<EFBFBD><EFBFBD>es de notifica<EFBFBD><EFBFBD>o |
//+------------------------------------------------------------------+
class ConfigNotificacao
{
public:
static bool EnviarAlertaEntrada() { return true; }
static bool EnviarAlertaSaida() { return true; }
static bool EnviarAlertaRisco() { return true; }
static bool EnviarEmail() { return false; }
static bool EnviarPush() { return true; }
static string FormatarMensagemEntrada(string tipo, double lote, double preco, int tp, int sl)
{
return StringFormat("WinQ25: %s | Lote: %.1f | Pre<00>o: %.0f | TP: %d pts | SL: %d pts",
tipo, lote, preco, tp, sl);
}
static string FormatarMensagemSaida(double resultado, int totalTrades, double winRate)
{
return StringFormat("WinQ25: Resultado: R$ %.2f | Trades: %d | Win Rate: %.1f%%",
resultado, totalTrades, winRate);
}
};