1 beğenilme 0 beğenilmeme
437 kez görüntülendi
Merhabalar.

 

 Aşağıda ki kodları destek platformunda örnek verilmiş algoritmalara göre, matriks IQ da yazmaya çalıştım ancak yazdığım algoritmayı backtest yaptığımda da şartlar sağlansa da işlemlerin gecikmeli yapıldığını farkettim ve bir türlü sebebini anlayamıyorum. İlgili C# ta yazdiğım satırları ve metastock dilinde ki formülleri aşağıda yazıyorum. Yardımlarınızı rica ederim. Şimdiden çok teşekkürler.

//AL

if(MOV(c, opt1, VAR) > OTT(C, opt1,7),
MOV(C, opt1, VAR) > OTT(C, opt1, opt2) AND
STOSK(opt3,opt4,111, VAR) > STOSD(opt3,opt4,111,VAR) AND
H> REF(HHV(H,20),-1)),
MOV(C, opt1, VAR) > OTT(C, opt1, opt2) AND
STOSK(opt3,opt4,111, VAR)> STOSD(opt3,opt4,111,VAR) AND
H> REF(HHV(H,20),-1)))

//SAT

if(MOV(c, opt1, VAR) > OTT(C, opt1,7),
MOV(C, opt1, VAR) < OTT(C, opt1, opt2) AND
STOSK(opt3,opt4,111, VAR) < STOSD(opt3,opt4,111,VAR) AND
L< REF(LLV(L,20),-1)),
MOV(C, opt1, VAR) < OTT(C, opt1, opt2) AND
STOSK(opt3,opt4,111, VAR) < STOSD(opt3,opt4,111,VAR) AND
L< REF(LLV(L,20),-1))

C#

public override void OnDataUpdate(BarDataEventArgs barData)

{

var barData1 = GetBarData(Symbol1, SymbolPeriod1);

var ohlcData1 = GetSelectedValueFromBarData(barData1, OHLCType.High);

var ohlcData2 = GetSelectedValueFromBarData(barData1, OHLCType.Low);

 

if (ott.Value[1][ott.CurrentIndex] > ott.Value[0][ott.CurrentIndex])

{

if (ott2.Value[1][ott2.CurrentIndex] > ott2.Value[0][ott.CurrentIndex] && stochasticSlow.Value[0][stochasticSlow.CurrentIndex] > stochasticSlow.Value[1][stochasticSlow.CurrentIndex] && highestHigh.Value[0][highestHigh.CurrentIndex - 1] < ohlcData1)

{

SendMarketOrder(Symbol1, OrderQuantity1, OrderSide.Buy, includeAfterSession:false);

}

}

 

else

{

if (ott.Value[1][ott.CurrentIndex] > ott.Value[0][ott.CurrentIndex] && ott2.Value[1][ott2.CurrentIndex] > ott2.Value[0][ott.CurrentIndex] && stochasticSlow.Value[0][stochasticSlow.CurrentIndex] > stochasticSlow.Value[1][stochasticSlow.CurrentIndex] && highestHigh.Value[0][highestHigh.CurrentIndex - 1] < ohlcData1)

{

SendMarketOrder(Symbol1, OrderQuantity1, OrderSide.Buy, includeAfterSession:false);

}

}

 

if (ott.Value[1][ott.CurrentIndex] > ott.Value[0][ott.CurrentIndex])

{

if (ott2.Value[1][ott2.CurrentIndex] < ott2.Value[0][ott.CurrentIndex] && stochasticSlow.Value[0][stochasticSlow.CurrentIndex] < stochasticSlow.Value[1][stochasticSlow.CurrentIndex] && lowestLow.Value[0][lowestLow.CurrentIndex - 1] > ohlcData2)

{

SendMarketOrder(Symbol1, OrderQuantity2, OrderSide.Sell, includeAfterSession:false);

}

}

 

else

{

if (ott.Value[1][ott.CurrentIndex] > ott.Value[0][ott.CurrentIndex] && ott2.Value[1][ott2.CurrentIndex] < ott2.Value[0][ott.CurrentIndex] && stochasticSlow.Value[0][stochasticSlow.CurrentIndex] < stochasticSlow.Value[1][stochasticSlow.CurrentIndex] && lowestLow.Value[0][lowestLow.CurrentIndex - 1] > ohlcData2)

{

SendMarketOrder(Symbol1, OrderQuantity2, OrderSide.Sell, includeAfterSession:false);

}

}

 

 

 

}

 

 

 

İyi çalışmalar,
Algoritmik Trading kategorisinde (17 puan) tarafından | 437 kez görüntülendi

1 cevap

0 beğenilme 0 beğenilmeme

Merhabalar,

 Şartlar sağlansa da işlemlerin gecikmeli yapıldığını fark ettim.

Bahsettiğiniz gecikmeli olan durumları/koşulları ekran görüntüsü ile paylaşabilirseniz test edelim. 

İyi çalışmalar.

(4,526 puan) tarafından
Hoş geldiniz, Matriks Destek Platformu sizlere sorularınızın hızlıca cevaplanması için bir ortam sağlar. Sorduğunuz ve cevapladığınız soruların ve yorumlarınızın aldığı oylar üzerinden puan kazanırsınız. Puan sistemine bağlı kampanyamızla ücretsiz kullanım avantajlarından faydalanabilirsiniz.



5,704 soru
5,771 cevap
3,679 yorum
4,572 kullanıcı