R - lütfen deneyimlerinizi paylaşın - sayfa 5

 
R ile sorun, test cihazı ile birlikte çalıştırılamamasıdır ve kâse raporları çizemez . =)
 
wise :
R ile sorun, test cihazı ile birlikte çalıştırılamamasıdır ve kâse raporları çizemez. =)
Seni ne durduruyor?
 
bilmiyorum. Sadece forexfactory'de bunun hakkında konuşan insanlar gördüm. Belki bir şeyi yanlış anladım. =)
 
hm. Ya da belki bilmiyorum. Henüz ciddi olarak kullanmadım.
 
wise :
R ile sorun, test cihazı ile birlikte çalıştırılamamasıdır ve kâse raporları çizemez. =)


Bu bir R sorunu değil, bir rapor çekmecesi sorunudur.

Araştırma için, beş dakika içinde kendiniz basit bir test cihazı yazmanız yeterlidir.

library(TTR)

library(zoo)

# get some data

num.points <- ...

midprices <- ...

spreads <- ...

bids <- midprices - 0.5 * spreads

asks <- midprices + 0.5 * spreads

# length(midprices) == num.points; length(spreads) == num.points

ma.fast <- EMA(midprices, 15)

ma.slow <- EMA(midprices, 50)

# compute entry/exit signals

open.long.position <- (ma.fast > ma.slow) & (ma.slow > midprices)

close.long.position <- (ma.fast < midprices)

open.short.position <- (ma.fast < ma.slow) & (ma.slow < midprices)

close.short.position <- (ma.fast > midprices)

signals.to.position <- function (num.points, signal.open, signal.close) {

pos <- rep(NA, num.points)

pos[signal.open] <- 1

pos[signal.close] <- 0

pos <- na.locf(pos, na.rm = F)

pos[is.na(pos)] <- 0

pos

}

# compute strategy positions

pos.long <- signals.to.position(num.points, open.long.position, close.long.position)

pos.short <- signals.to.position(num.points, open.short.position, close.short.position)

pos.total <- pos.long - pos.short

# compute equity

commission <- 1

trade.size <- c(0, pos.total[2 : num.points] - pos.total[1 : (num.points - 1)])

fees <- abs(trade.size) * (commission + 0.5 * spreads)

equity <- midprices * pos.total + cumsum(-midprices * trade.size - fees)

# compute balance

balance <- rep(NA, num.points)

balance[trade.size != 0] <- equity[trade.size != 0]

balance <- na.locf(balance, na.rm = F)

balance[is.na(balance)] <- 0

# display results

par(mfrow = c(2, 1))

plot(midprices, t = 'l', col = 'gray', lty = 'dashed')

lines(bids, col = 'blue')

lines(asks, col = 'red')

points(which(trade.size > 0, arr.ind = T), asks[trade.size > 0], col = 'blue')

points(which(trade.size < 0, arr.ind = T), bids[trade.size < 0], col = 'red')

plot(equity, t = 'l')

lines(balance, col = 'gray', lty = 'dashed')

 
Birisi MT5 + R'yi çalıştırmayı başardı mı?
 
anonymous :


Bu bir R sorunu değil, bir rapor çekmecesi sorunudur.

Araştırma için, beş dakika içinde kendiniz basit bir test cihazı yazmanız yeterlidir.

library(TTR)

library(zoo)

# get some data

num.points <- ...

midprices <- ...

spreads <- ...

bids <- midprices - 0.5 * spreads

asks <- midprices + 0.5 * spreads

# length(midprices) == num.points; length(spreads) == num.points

ma.fast <- EMA(midprices, 15)

ma.slow <- EMA(midprices, 50)

# compute entry/exit signals

open.long.position <- (ma.fast > ma.slow) & (ma.slow > midprices)

close.long.position <- (ma.fast < midprices)

open.short.position <- (ma.fast < ma.slow) & (ma.slow < midprices)

close.short.position <- (ma.fast > midprices)

signals.to.position <- function (num.points, signal.open, signal.close) {

pos <- rep(NA, num.points)

pos[signal.open] <- 1

pos[signal.close] <- 0

pos <- na.locf(pos, na.rm = F)

pos[is.na(pos)] <- 0

pos

}

# compute strategy positions

pos.long <- signals.to.position(num.points, open.long.position, close.long.position)

pos.short <- signals.to.position(num.points, open.short.position, close.short.position)

pos.total <- pos.long - pos.short

# compute equity

commission <- 1

trade.size <- c(0, pos.total[2 : num.points] - pos.total[1 : (num.points - 1)])

fees <- abs(trade.size) * (commission + 0.5 * spreads)

equity <- midprices * pos.total + cumsum(-midprices * trade.size - fees)

# compute balance

balance <- rep(NA, num.points)

balance[trade.size != 0] <- equity[trade.size != 0]

balance <- na.locf(balance, na.rm = F)

balance[is.na(balance)] <- 0

# display results

par(mfrow = c(2, 1))

plot(midprices, t = 'l', col = 'gray', lty = 'dashed')

lines(bids, col = 'blue')

lines(asks, col = 'red')

points(which(trade.size > 0, arr.ind = T), asks[trade.size > 0], col = 'blue')

points(which(trade.size < 0, arr.ind = T), bids[trade.size < 0], col = 'red')

plot(equity, t = 'l')

lines(balance, col = 'gray', lty = 'dashed')

Her şey olduğu gibi...

Kafesleri deşifre edelim mi?

 
TheXpert :
hm. Ya da belki bilmiyorum. Henüz ciddi olarak kullanmadım.
Eşzamansızlıktan dolayı olabilir mi? R, eşzamansız olarak çalışabilir, ancak bir test cihazı çalıştıramaz. Ancak asenkroni hala egzotik.
 
tara :

Her şey olduğu gibi...

Kafesleri deşifre edelim mi?

Eh.... R, mql değil, bir terminal dili olacaktır.
 

Lütfen yardım edin.

R EURUSD'ye yönlendirildi. Modeli hesapladım ve katsayısını hesapladım. Bir grafik nasıl çizilir ve bir alıntı ile nasıl birleştirilir?

> x.ar<-ar(eur[1:256],method="mle")

> x.ar


aramak:

ar(x = eur[1:256], yöntem = "mle")


katsayılar:

1 ........2 .........3

0,9420 0,1955 -0,1644


Seçilen sipariş 3 sigma^2 tahmini 2.73e-06