//+------------------------------------------------------------------+ // Scalping Robot…
- User
//+------------------------------------------------------------------+ //| Scalping Robot | //+------------------------------------------------------------------+ #property copyright "Copyright 2024, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.01"
#include <Trade/Trade.mqh>
CTrade trade; CPositionInfo pos; COrderInfo ord;
//+------------------------------------------------------------------+ //| Inputs Gerais | //+------------------------------------------------------------------+ input group "*** Trading Inputs ***" input double LotSize = 0.01; // Lot size for trading input int Tppoints = 800; // Take Profit (10 points = 1 pip) input int Slpoints = 800; // Stoploss Points (10 points = 1 pip) input int TslTriggerPoints = 35; // Points in profit before Trailing SL is activated (10 points = 1 pip) input int TslPoints = 10; // Trailing Stoploss (10 points = 1 pip) input ENUM_TIMEFRAMES Timeframe = PERIOD_CURRENT; // Time frame to run input int InpMagic = 891245; // EA identification no input string TradeComment = "Wendel Cassiano"; input int MaxSpread = 100; // Maximum spread allowed (in points) input int Slippage = 50; // Slippage in points input int MaxOrders = 2; // Máximo de ordens permitidas simultaneamente
// Horário de Operação - Enum centralizada enum TradingHour { Hour_Inactive=0, _0100=1, _0200=2, _0300=3, _0400=4, _0500=5, _0600=6, _0700=7, _0800=8, _0900=9, _1000=10, _1100=11, _1200=12, _1300=13, _1400=14, _1500=15, _1600=16, _1700=17, _1800=18, _1900=19, _2000=20, _2100=21, _2200=22, _2300=23 };
input TradingHour SHInput = Hour_Inactive; // Hora de início input TradingHour EHInput = Hour_Inactive; // Hora de término
int SHChoice; int EHChoice;
// Resto do código permanece o mesmo, integrando essa enum.
int BarsN = 5; int ExpirationBars = 100; int OrderDistPoints = 100;
//+------------------------------------------------------------------+ //| Variáveis da Rede Neural | //+------------------------------------------------------------------+
#define NodeCount 10 // Número de entradas double Inputs[NodeCount]; // Entradas normalizadas double Weights[NodeCount]; // Pesos para as entradas double NNOutput = 0; // Saída da Rede Neural input double LearningRate = 0.1; // Taxa de aprendizado const double NormMin = -1; // Limite inferior de normalização const double NormMax = 1; // Limite superior de normalização
//+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { trade.SetExpertMagicNumber(InpMagic); ChartSetInteger(0, CHART_SHOW_GRID, false);
- Assistant