172 líneas
15 KiB
MQL5
172 líneas
15 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| winq26_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
|
|
//+------------------------------------------------------------------+
|
|
//+------------------------------------------------------------------+
|
|
//| winq26_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çõ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ções específicas do símbolo WinQ25 |
|
|
//+------------------------------------------------------------------+
|
|
class ConfigWinFUT {
|
|
|
|
public:
|
|
static string Simbolo() { return "WING26"; }
|
|
static double PontoMinimo() { return 5.0; } // Tick mínimo do WINQ26
|
|
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ário de pontos
|
|
static double PontosParaReais(int pontos) {
|
|
return pontos * ValorPonto();
|
|
}
|
|
|
|
//--- Calcular quantos lotes são seguros baseado no saldo
|
|
static double CalcularLoteSeguro(double saldo, double riscoPorcentual) {
|
|
double riscoReais = saldo * (riscoPorcentual / 100.0);
|
|
double loteMaximo = MathFloor(saldo / MargemRequerida());
|
|
|
|
// Não usar mais que 50% da margem disponível
|
|
return MathMin(loteMaximo * 0.5, 5.0);
|
|
}
|
|
};
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Configurações de indicadores té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ão do sistema |
|
|
//+------------------------------------------------------------------+
|
|
class Mensagens {
|
|
|
|
public:
|
|
static string InicioOperacao() { return "=== NOVA OPERAÇÃO WINFUT ==="; }
|
|
static string OperacaoVencedora() { return "=== TRADE VENCEDOR - WINFUT ==="; }
|
|
static string OperacaoPerdedora() { return "=== TRADE PERDEDOR - WINFUT ==="; }
|
|
static string LimiteRiscoAtingido() { return "ATENÇÃO: Limite de risco diário atingido!"; }
|
|
static string MaximoTradesAtingido() { return "Máximo de trades por dia atingido"; }
|
|
static string HorarioNaoPermitido() { return "Operação fora do horário permitido"; }
|
|
static string NovoDialogTrading() { return "=== NOVO DIA DE TRADING WINFUT ==="; }
|
|
};
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Configurações de notificaçã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(
|
|
"WINFUT: %s | Lote: %.1f | Preço: %.0f | TP: %d pts | SL: %d pts",
|
|
tipo,
|
|
lote,
|
|
preco,
|
|
tp, sl
|
|
);
|
|
}
|
|
|
|
static string FormatarMensagemSaida(double resultado, int totalTrades, double winRate) {
|
|
return StringFormat(
|
|
"WINFUT: Resultado: R$ %.2f | Trades: %d | Win Rate: %.1f%%",
|
|
resultado,
|
|
totalTrades,
|
|
winRate
|
|
);
|
|
}
|
|
};
|
|
|