Discussion of article "Third Generation Neural Networks: Deep Networks" - page 12
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Vladimir Perervenko
Add to the article additional information on working with R Studio
Good afternoon.
I don't understand about the hosts file. Can you give more details ?
Good luck
Vladimir Perervenko
Add to the article additional information on working with R Studio
I use another form of record to check installed packages:
You should load libraries in the description of functions that use them. Although you can do it this way when initialising the Expert Advisor.
So why do you need to run the Expert Advisor in the tester?
Good luck
While debugging R scripts for a long time, identified a bug that is hard to catch if the incoming data has NA. It simply will not trigger the signal. In the "e_SAE_init.r" file, it is recommended to add a NA cleanup term to the Test(dt,x) function before new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x);
This seems like a "crutch", but I haven't thought of anything better yet.
Without it, a hidden error will occur:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
While debugging R scripts for a long time, identified a bug that is hard to catch if the incoming data has NA. It simply will not trigger the signal. In the "e_SAE_init.r" file, it is recommended to add a NA cleanup term to the Test(dt,x) function before new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x);
This seems like a "crutch", but I haven't thought of anything better yet.
Without it, a hidden error will occur:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
While debugging R scripts for a long time, I found a bug that is hard to catch if the incoming data has NA. It simply will not trigger the signal. In the "e_SAE_init.r" file, it is recommended to add a NA cleanup term to the Test(dt,x) function before new.data <- predict(prepr, tail(x, 50)): x <- na.omit(x);
This seems like a "crutch", but I haven't thought of anything better yet.
Without it, a hidden error will occur:
Error in if (sqrt(denom) > .Machine$double.eps) x/sqrt(denom) else x * : missing value where TRUE/FALSE needed
This statement is incorrect.
In the Test(dt, x) function, x is the input data calculated by the In() function. Let's look at it in the "i_SAE_fun.r" script
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) }This is a number of indicators. Let's calculate them on the price[] history with the length of 2000 bars.
We cut off the undefined data. Condition : nrow(x) > 500 + max(NA). I.e. at least in our case 533. To be safe, put nrow(x) = 600-700.
I don't see how you got an uncertain NA in x.
Good luck
HI Vladimir,
Here is from Brazil!!!
I read your instructions about the Neural Network using R but I have a dumb question (sorry, I am newbie in this!)
In the tutorial that you wrote ( https://www.mql5.com/en/articles/1103#ch_3), in the "Section 3.3.1 - Source Data" you described a function, called pr.OHLC that I understood very well.
Bu you show some results that it was not clear to me which are the parameters necessary to the results below
> 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-05Could you, please, help me with this?
Best,
Fábio
HI Vladimir,
Here is from Brazil!!!
I read your instructions about the Neural Network using R but I have a dumb question (sorry, I am newbie in this!)
In the tutorial that you wrote ( https://www.mql5.com/en/articles/1103#ch_3), in the "Section 3.3.1 - Source Data" you described a function, called pr.OHLC that I understood very well.
Bu you show some results that it was not clear to me which are the parameters necessary to the results below
Could you, please, help me with this?
Best,
Fábio
Hi Fabio,
What's not clear?
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 }Hi Vladimir,
Is there a possibility to have the files for MT5 ?
Regards
Fabio lima
Hi Vladimir,
Is there a possibility to have the files for MT5 ?
Regards
Fabio lima
Hi Fabio,
I'm sorry.
I do not write on MKL5.
Best regards
Vladimir
One question . I am not clear on the order of the price vector .
You do a reversal here : price <- cbind(Open = rev(o), High = rev(h), Low = rev(l), Close = rev(c))
What is the original order of o,h,l,c ?
One question . I am not clear on the order of the price vector .
You do a reversal here : price <- cbind(Open = rev(o), High = rev(h), Low = rev(l), Close = rev(c))
What is the original order of o,h,l,c ?
Hi,
The MT4 numbering bars from the most recent to oldest. The R on the contrary, from the old to the new, new bar last.