mt5-clear-wing26-scalper/WinFutLib/WinFutEnvs.mqh

58 行
5.7 KiB
MQL5

2026-01-19 09:06:29 -03:00
<EFBFBD><EFBFBD>//+------------------------------------------------------------------+
//| wing26Envs.mq5 |
//| Copyright 2025, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link "https://www.mql5.com"
#property version "1.00"
//--- Objetos globais
CTrade trade;
CPositionInfo position;
CAccountInfo account;
//+------------------------------------------------------------------+
//| Par<EFBFBD>metros de entrada |
//+------------------------------------------------------------------+
input group "=== CONFIGURA<00><00>ES B<00>SICAS ==="
input double LotePadrao = 1.0; // Lote padr<EFBFBD>o para baixa volatilidade
input double LoteAltaVolatilidade = 5.0; // Lote para alta volatilidade
input int TakeProfitPadrao = 50; // Take Profit padr<EFBFBD>o (pontos)
input int TakeProfitAltaVol = 200; // Take Profit alta volatilidade (pontos)
input int MagicNumber = 123456; // N<EFBFBD>mero m<EFBFBD>gico
input string Simbolo = "WING26"; // S<EFBFBD>mbolo a ser operado
input group "=== GEST<00>O DE RISCO ==="
input double RiscoMaximoDiario = 2.0; // Risco m<EFBFBD>ximo di<EFBFBD>rio (% do saldo)
input int MaxOperacoesPerdedoras = 3; // M<EFBFBD>ximo de opera<EFBFBD><EFBFBD>es perdedoras consecutivas
input int MaxTradesPorDia = 20; // M<EFBFBD>ximo de trades por dia
input double StopLossPercentual = 50.0; // Stop Loss como % do Take Profit
input group "=== PRICE ACTION ==="
input int PeriodoMedia = 20; // Per<EFBFBD>odo da m<EFBFBD>dia m<EFBFBD>vel
input double MinimoPontosMovimento = 30.0; // M<EFBFBD>nimo de pontos para considerar movimento
input int VelasAnalise = 3; // N<EFBFBD>mero de velas para an<EFBFBD>lise
input group "=== HOR<00>RIOS DE TRADING ==="
input bool OperarAberturaBMF = true; // Operar abertura BMF (09:15-10:00)
input bool OperarAberturaBovespa = true; // Operar abertura Bovespa (10:15-10:30)
input bool OperarAberturaEUA = true; // Operar abertura EUA (10:30-12:00)
input bool OperarTarde = true; // Operar per<EFBFBD>odo tarde (14:00-16:45)
input bool OperarFechamento = true; // Operar fechamento (17:00-18:00)
//+------------------------------------------------------------------+
//| Vari<EFBFBD>veis globais |
//+------------------------------------------------------------------+
datetime ultimoDia = 0;
int tradesHoje = 0;
int tradesVencedoresHoje = 0;
int tradesPerdedoresConsecutivos = 0;
double saldoInicialDia = 0;
double perdaMaximaDia = 0;
bool tradingPermitido = true;
//--- Handles dos indicadores
int handleMA;