EA: 来自"MQL5算法交易的神经网络"教程的示例 - 页 4 1234 新评论 zjutsunny 2024.11.24 08:33 #31 no “ our_model.net”,what are we going? Odai kahalled fawwaz Qandel 2025.01.13 16:48 #32 اللعبه : MQL5 : المؤلف :MetaQuotes اخرزميات انا عالم التكنولوجيا الجديدة ومطور برامج ومنشء تطبيقات NLO 2025.04.27 13:58 #33 非常感谢作者提供这本书!唯一的遗憾))))- 我的爱丽丝-普罗对我来说失去了 "意识 "的魔力)恕我直言,伊戈尔。 ORTAYA KARIŞIK 2025.06.10 23:06 #34 //+------------------------------------------------------------------+ //|高级 FVG EA.mq5 //+------------------------------------------------------------------+ #property strict input double Lots = 0.1; input int TakeProfit = 200; input int StopLoss = 200; input int MaxLookback = 50; input int Slippage = 5; input int MagicNumber = 123456; input double MaxSpreadPoints = 20.0; // Maksimum izin verilen spread input int MA_Period = 50; // Trend filtresi input int StartHour = 8; // İşlem saat aralığı başlangıç input int EndHour = 20; // İşlem saat aralığı bitiş //+------------------------------------------------------------------+ int OnInit() { Print("高级 FVG EA başlatıldı"。); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ void OnTick() { // Yeni bar kontrolü static datetime lastBarTime = 0; MqlRates candles[3]; if(CopyRates(_Symbol, PERIOD_M5, 0, 3, candles) < 3) return; if(candles[0].time == lastBarTime) return; lastBarTime = candles[0].time; // Zaman filtresi int currentHour = TimeHour(TimeCurrent()); if(currentHour < StartHour || currentHour >= EndHour) return; // 展开控制 double spread = (SymbolInfoDouble(_Symbol, SYMBOL_ASK) - SymbolInfoDouble(_Symbol, SYMBOL_BID)) / _Point; if(spread > MaxSpreadPoints) return; // 控制 if(PositionSelect(_Symbol)) return; // Trend filtresi (MA) double ma = iMA(_Symbol, PERIOD_M5, MA_Period, 0, MODE_SMA, PRICE_CLOSE, 0); double price = SymbolInfoDouble(_Symbol, SYMBOL_BID); // FVG tespiti double fvgHigh = 0; double fvgLow = 0; bool isBullishFVG = false; bool isBearishFVG = false; MqlRates rates[]; if(CopyRates(_Symbol, PERIOD_M5, 2, MaxLookback, rates) < 3) return; for(int i = 0; i < ArraySize(rates)-2; i++) { double high0 = rates[i].high; double low2 = rates[i+2].low; double low0 = rates[i].low; double high2 = rates[i+2].high; // 看涨 FVG(sadece yükselen trendde aç) if(high0 < low2 && price > ma) { isBullishFVG = true; fvgHigh = low2; fvgLow = high0; break; } // 看跌 FVG(sadece düşen trendde aç) else if(low0 > high2 && price < ma) { isBearishFVG = true; fvgHigh = low0; fvgLow = high2; break; } } double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID); double ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK); // İşlem açma if(isBullishFVG && bid <= fvgHigh && bid >= fvgLow) { trade_buy(ask); } else if(isBearishFVG && ask >= fvgLow && ask <= fvgHigh) { trade_sell(bid); } } //+------------------------------------------------------------------+ void trade_buy(double price) { double sl = price - StopLoss * _Point; double tp = price + TakeProfit * _Point; MqlTradeRequest req = {}; MqlTradeResult res = {}; req.action = TRADE_ACTION_DEAL; req.symbol = _Symbol; req.volume = Lots; req.type = ORDER_TYPE_BUY; req.price = price; req.sl = NormalizeDouble(sl, _Digits); req.tp = NormalizeDouble(tp, _Digits); req.deviation = Slippage; req.magic = MagicNumber; req.comment = "FVG Buy"; if(OrderSend(req, res)) Print("买入订单:", res.retcode); else Print("买单 hatası:", res.retcode); } //+------------------------------------------------------------------+ void trade_sell(double price) { double sl = price + StopLoss * _Point; double tp = price - TakeProfit * _Point; MqlTradeRequest req = {}; MqlTradeResult res = {}; req.action = TRADE_ACTION_DEAL; req.symbol = _Symbol; req.volume = Lots; req.type = ORDER_TYPE_SELL; req.price = price; req.sl = NormalizeDouble(sl, _Digits); req.tp = NormalizeDouble(tp, _Digits); req.deviation = Slippage; req.magic = MagicNumber; req.comment = "FVG Sell"; if(OrderSend(req, res)) Print("卖出订单:", res.retcode); else Print("卖出订单 hatası:", res.retcode); } //+------------------------------------------------------------------+ Aws Kyoma 2025.06.26 22:24 #35 当我在运行 "gpt_test_not_norm "脚本后使用 gpt_not_norm.net 时,会出现以下错误 "策略测试器中 的 "前馈错误:0 我确保将 "BarsToLine "输入变量设置为 40,用于收集和训练模型。 如果使用 "attention "脚本,则运行正常 Ahmad Kazbar 2025.07.22 14:04 #36 这是一项伟大且非常有用的工作,但存在一个问题(加载模式 gpt_not_norm.net 的错误:5008),是否有解决方案? 607967 2025.12.06 11:35 #37 大家好。我相信我们很多人都遇到过错误,这让人非常沮丧。老实说,一开始我也很想让专家顾问 发挥作用,结果不出所料,我发现自己错误百出。 如果你有耐心,边看书边一步一步地研究代码,我保证你会发现自己做对了,并得到你想要的结果。你最需要的是尽可能理解 mql5 语言。 幸运的是,我能够让整个代码正常运行,专家顾问也在工作,但我需要一个策略。 还有一件事。每当代码运行并停止时,我都会发现内存中有两个缓冲对象泄漏。我需要帮助找到这个错误。 Ryan L Johnson 2025.12.06 18:49 #38 607967 #:还有一件事。每当代码运行并停止时,都会有两个缓冲对象泄漏内存。我需要帮助找到这个错误。 这通常发生在移除 EA 时未从终端内存中释放指标句柄时。 尝试将 //+------------------------------------------------------------------+ //| 专家去初始化函数| //+------------------------------------------------------------------+ void OnDeinit(const int reason) { if(!!net) delete net; if(!!trade) delete trade; IndicatorRelease(h_RSI); IndicatorRelease(h_MACD); } 改为 //+------------------------------------------------------------------+ //| 专家去初始化函数| //+------------------------------------------------------------------+ void OnDeinit(const int reason) { if(!!net) delete net; if(!!trade) delete trade; if(h_RSI != INVALID_HANDLE || h_MACD != INVALID_HANDLE) { IndicatorRelease(h_RSI); IndicatorRelease(h_MACD); } } // 此代码未经测试。 Wolfgang Bauer 2026.11.18 12:47 #39 大家好,在编译EA时,我遇到了许多类似的错误 'opencl_program.cl' 作为 'const string OCLprogram' 0 参数类型转换 'int[1]' 到 'const uint[] &' 不被允许 buffer.mqh 327 54 参数个数错误,传递了 4 个,但需要 5 个 buffer.mqh 327 21 可能是以下两个函数之一(s) buffer.mqh 327 21 bool COpenCL::Execute(const int,const int,const uint&[],const uint&[]) OpenCL.mqh 82 22 bool COpenCL::Execute(const int,const int,const uint&[],const uint&[],const uint&[]) OpenCL.mqh 83 22 参数个数错误,传入5个,但要求4个 buffer.mqh 428 21 参数类型转换“int[1]”为“const uint[] &' 不被允许 buffer.mqh 428 45 可能是以下 2 个函数之一 buffer.mqh 428 21 bool COpenCL::Execute(const int,const int,const uint&[],const uint&[]) OpenCL.mqh 82 22 bool COpenCL::Execute(const int,const int,const uint&[],const uint&[],const uint&[]) OpenCL.mqh 83 22 有人知道该如何解决这个问题吗 来自德国的问候 沃尔夫冈·鲍尔和保罗·劳雷罗 1234 新评论
MQL5 :
المؤلف :MetaQuotes
"策略测试器中 的 "前馈错误:0
我确保将 "BarsToLine "输入变量设置为 40,用于收集和训练模型。
如果使用 "attention "脚本,则运行正常
大家好。我相信我们很多人都遇到过错误,这让人非常沮丧。老实说,一开始我也很想让专家顾问 发挥作用,结果不出所料,我发现自己错误百出。
如果你有耐心,边看书边一步一步地研究代码,我保证你会发现自己做对了,并得到你想要的结果。你最需要的是尽可能理解 mql5 语言。
幸运的是,我能够让整个代码正常运行,专家顾问也在工作,但我需要一个策略。
还有一件事。每当代码运行并停止时,我都会发现内存中有两个缓冲对象泄漏。我需要帮助找到这个错误。
还有一件事。每当代码运行并停止时,都会有两个缓冲对象泄漏内存。我需要帮助找到这个错误。
这通常发生在移除 EA 时未从终端内存中释放指标句柄时。
尝试将
改为
大家好,在编译EA时,我遇到了许多类似的错误
'opencl_program.cl' 作为 'const string OCLprogram' 0
参数类型转换 'int[1]' 到 'const uint[] &' 不被允许 buffer.mqh 327 54
参数个数错误,传递了 4 个,但需要 5 个 buffer.mqh 327 21
可能是以下两个函数之一(s) buffer.mqh 327 21
bool COpenCL::Execute(const int,const int,const uint&[],const uint&[]) OpenCL.mqh 82 22
bool COpenCL::Execute(const int,const int,const uint&[],const uint&[],const uint&[]) OpenCL.mqh 83 22
参数个数错误,传入5个,但要求4个 buffer.mqh 428 21
参数类型转换“int[1]”为“const uint[] &' 不被允许 buffer.mqh 428 45
可能是以下 2 个函数之一 buffer.mqh 428 21
bool COpenCL::Execute(const int,const int,const uint&[],const uint&[]) OpenCL.mqh 82 22
bool COpenCL::Execute(const int,const int,const uint&[],const uint&[],const uint&[]) OpenCL.mqh 83 22
有人知道该如何解决这个问题吗
来自德国的问候
沃尔夫冈·鲍尔和保罗·劳雷罗