在长时间调试 R 脚本的过程中,发现了一个在输入数据有 NA 的情况下很难捕捉的错误。它根本不会触发信号。在 "e_SAE_init.r "文件中,建议在 new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x) 之前,在 Test(dt,x) 函数中添加一个 NA 清理项;
这似乎是个 "拐杖",但我还没想到更好的办法。
如果不这样做,就会出现隐藏错误:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
在长时间调试 R 脚本的过程中,发现了一个在输入数据有 NA 的情况下很难捕捉的错误。它根本不会触发信号。在 "e_SAE_init.r "文件中,建议在 new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x) 之前,在 Test(dt,x) 函数中添加一个 NA 清理项;
这似乎是个 "拐杖",但我还没想到更好的办法。
如果不这样做,就会出现隐藏错误:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
kimkarus:
在调试 R 脚本的很长一段时间里,我发现了一个在输入数据有 NA 时很难捕捉的错误。它根本不会触发信号。在 "e_SAE_init.r "文件中,建议在 new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x) 之前,在 Test(dt,x) 函数中添加一个 NA 清理项;
这似乎是个 "拐杖",但我还没想到更好的办法。
如果不这样做,就会出现隐藏错误:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
This article is dedicated to a new and perspective direction in machine learning - deep learning or, to be precise, deep neural networks. This is a brief review of second generation neural networks, the architecture of their connections and main types, methods and rules of learning and their main disadvantages followed by the history of the third generation neural network development, their main types, peculiarities and training methods. Conducted are practical experiments on building and training a deep neural network initiated by the weights of a stacked autoencoder with real data. All the stages from selecting input data to metric derivation are discussed in detail. The last part of the article contains a software implementation of a deep neural network in an Expert Advisor with a built-in indicator based on MQL4/R.
pr.OHLC <- function (o, h, l, c)
{
#Unite quote vectors into a matrix having previously expanded them
#Indexing of time series of vectors in R starts with 1.
#Direction of indexing isfrom old to new ones.
price <- cbind(Open = rev(o), High = rev(h), Low = rev(l), Close = rev(c))
Med <- (price[, 2] + price[, 3])/2 #We calculateaverage price(HIgh + Low)/2
CO <- price[, 4] - price[, 1] # We calculatebodycandles (Close - Open)
#add Med and CO to the matrix
price <- cbind(price, Med, CO)#We are putting it all in a matrix
}
弗拉基米尔-佩列文科
在文章中添加有关使用 R Studio 的其他信息
下午好。
我不太理解主机文件。您能提供更多详细信息吗?
祝你好运
弗拉基米尔-佩列文科
在文章中添加有关使用 R Studio 的其他信息
我使用另一种记录形式来检查已安装的软件包:
您应该在使用库的函数描述中加载库。虽然在初始化智能交易系统时也可以这样做。
那么,为什么需要在测试器中运行智能交易系统呢?
祝您好运
在长时间调试 R 脚本的过程中,发现了一个在输入数据有 NA 的情况下很难捕捉的错误。它根本不会触发信号。在 "e_SAE_init.r "文件中,建议在 new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x) 之前,在 Test(dt,x) 函数中添加一个 NA 清理项;
这似乎是个 "拐杖",但我还没想到更好的办法。
如果不这样做,就会出现隐藏错误:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
在长时间调试 R 脚本的过程中,发现了一个在输入数据有 NA 的情况下很难捕捉的错误。它根本不会触发信号。在 "e_SAE_init.r "文件中,建议在 new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x) 之前,在 Test(dt,x) 函数中添加一个 NA 清理项;
这似乎是个 "拐杖",但我还没想到更好的办法。
如果不这样做,就会出现隐藏错误:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
在调试 R 脚本的很长一段时间里,我发现了一个在输入数据有 NA 时很难捕捉的错误。它根本不会触发信号。在 "e_SAE_init.r "文件中,建议在 new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x) 之前,在 Test(dt,x) 函数中添加一个 NA 清理项;
这似乎是个 "拐杖",但我还没想到更好的办法。
如果不这样做,就会出现隐藏错误:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
该语句不正确。
在 Test(dt, x) 函数中,x 是由 In() 函数计算的输入数据。让我们看看 "i_SAE_fun.r "脚本中的数据
In <- function(p = 16){ require(TTR) adx <- ADX(price, n = p) ar <- aroon(price[ ,c('High', 'Low')], n = p)[ ,'oscillator'] cci <- CCI(price[ ,2:4], n = p) chv <- chaikinVolatility(price[ ,2:4], n = p) cmo <- CMO(price[ ,'Med'], n = p) macd <- MACD(price[ ,'Med'], 12, 26, 9)[ ,'macd'] osma <- macd - MACD(price[ ,'Med'],12, 26, 9)[ ,'signal'] rsi <- RSI(price[ ,'Med'], n = p) stoh <- stoch(price[ ,2:4], 14, 3, 3) smi <- SMI(price[ ,2:4],n = p, nFast = 2, nSlow = 25, nSig = 9) vol <- volatility(price[ ,1:4], n = p, calc="yang.zhang", N=96) In <- cbind(adx, ar, cci, chv, cmo, macd, osma, rsi, stoh, smi, vol) return(In) }这是一些指标。让我们在长度为 2000 条的价格[]历史记录上计算它们。
删除未定义的数据。条件:nrow(x) > 500 + max(NA)。即至少在我们的情况下是 533。为了安全起见,nrow(x) = 600-700。
我不明白你是如何在 x 中得到不确定的 NA 的。
祝你好运
你好,弗拉基米尔、
这是来自巴西的
我阅读了您关于使用 R 语言创建神经网络的说明,但我有一个愚蠢的问题(抱歉,我是这方面的新手!)。
在您写的教程 (https://www.mql5.com/zh/articles/1103#ch_3) 中,在"第 3.3.1 节 - 源数据"中,您描述了一个名为 pr.OHLC 的函数,我对此非常了解。
但是,我不太清楚下面的结果需要哪些参数。
> head(price) Open High Low Close Med CO [1,] 1.33848 1.33851 1.33824 1.33844 1.338375 -4e-05 [2,] 1.33843 1.33868 1.33842 1.33851 1.338550 8e-05 [3,] 1.33849 1.33862 1.33846 1.33859 1.338540 1e-04 [4,] 1.33858 1.33861 1.33856 1.33859 1.338585 1e-05 [5,] 1.33862 1.33868 1.33855 1.33855 1.338615 -7e-05您能帮我解决这个问题吗?
最好、
法比奥
你好,弗拉基米尔、
这是来自巴西的
我阅读了您关于使用 R 语言创建神经网络的说明,但我有一个愚蠢的问题(抱歉,我是这方面的新手!)。
在您写的教程 (https://www.mql5.com/zh/articles/1103#ch_3) 中,在"第 3.3.1 节 - 源数据"中,您描述了一个名为 pr.OHLC 的函数,我对此非常了解。
但是,我不太清楚下面的结果需要哪些参数。
您能帮我解决这个问题吗?
最好、
法比奥
你好,法比奥、
什么地方不清楚?
pr.OHLC <- function (o, h, l, c) { #Unite quote vectors into a matrix having previously expanded them #Indexing of time series of vectors in R starts with 1. #Direction of indexing is from old to new ones. price <- cbind(Open = rev(o), High = rev(h), Low = rev(l), Close = rev(c)) Med <- (price[, 2] + price[, 3])/2 #We calculate average price (HIgh + Low)/2 CO <- price[, 4] - price[, 1] # We calculate body candles (Close - Open) #add Med and CO to the matrix price <- cbind(price, Med, CO)#We are putting it all in a matrix }你好,弗拉基米尔、
是否有可能获得 MT5 的文件?
请联系
法比奥-利马
你好,弗拉基米尔、
是否有可能获得 MT5 的文件?
请联系
法比奥-利马
你好,法比奥、
很抱歉。
我不会 写 MKL5。
致以最诚挚的问候
弗拉基米尔
有一个问题 .我不太清楚价格矢量的顺序 .
您在这里做了一次反转: price <- cbind(Open = rev(o), High = rev(h), Low = rev(l), Close = rev(c))
o,h,l,c 的原始顺序是什么?
有一个问题 .我不太清楚价格矢量的顺序 .
您在这里做了一次反转: price <- cbind(Open = rev(o), High = rev(h), Low = rev(l), Close = rev(c))
o,h,l,c 的原始顺序是什么?
您好、
MT4 对 条形图的 编号 是从 最近的 到最远的。 而 R 则相反, 从旧到 新, 新条形图 排在最后。