Sistem Çevirisi
- Soruldu
- Kategori
- System Tester-Bağlı Emirler
- Görüntülenme
- 449 görüntülenme
- Durum
- Cevaplandı
{ --- Input Parameters for Long --- } fastLength_L := Input("Fast MA Length (Long)",5); slowLength_L := Input("Slow MA Length (Long)",18); slopeLength_L := Input("Slope Length (Long)",7); slopeThreshold_L := Input("Slope Threshold (Long)", 0.5); atrLength_L := Input("ATR Length (Long)",1); atrThreshold_L := Input("ATR Threshold (Long)",0.03); { --- Input Parameters for Short --- } fastLength_S := Input("Fast MA Length (Short)",6); slowLength_S := Input("Slow MA Length (Short)",20); slopeLength_S := Input("Slope Length (Short)",6); slopeThreshold_S := Input("Slope Threshold (Short)", 0.4); atrLength_S := Input("ATR Length (Short)",7); atrThreshold_S := Input("ATR Threshold (Short)",0.04); { --- Moving Average Calculation --- } fastMA_L := Mov(C, fastLength_L, E); { EMA for fast MA Long } slowMA_L := Mov(C, slowLength_L, S); { SMA for slow MA Long } fastMA_S := Mov(C, fastLength_S, S); { SMA for fast MA Short } slowMA_S := Mov(C, slowLength_S, E); { EMA for slow MA Short } { --- Slope Calculation --- } fastSlope_L := (fastMA_L - Ref(fastMA_L, -slopeLength_L)) / slopeLength_L; slowSlope_L := (slowMA_L - Ref(slowMA_L, -slopeLength_L)) / slopeLength_L; fastSlope_S := (fastMA_S - Ref(fastMA_S, -slopeLength_S)) / slopeLength_S; slowSlope_S := (slowMA_S - Ref(slowMA_S, -slopeLength_S)) / slopeLength_S; { --- ATR Calculation --- } atr_L := ATR(atrLength_L); atr_S := ATR(atrLength_S); { --- Long Conditions --- } isFlat_L := Abs(fastSlope_L) < slopeThreshold_L AND Abs(slowSlope_L) < slopeThreshold_L; lowVolatility_L := atr_L < atrThreshold_L; longCondition := Cross(fastMA_L, slowMA_L) AND NOT isFlat_L AND NOT lowVolatility_L; { --- Short Conditions --- } isFlat_S := Abs(fastSlope_S) < slopeThreshold_S AND Abs(slowSlope_S) < slopeThreshold_S; lowVolatility_S := atr_S < atrThreshold_S; shortCondition := Cross(slowMA_S, fastMA_S) AND NOT isFlat_S AND NOT lowVolatility_S; { --- Trading Signals --- } Buy := longCondition; Sell := shortCondition; { --- Plot Signals --- } Buy; Sell; Bu kodu matriks diline çevirirmisiniz?

