24.01.2022
0
2
198
100

TKE indikatörü, Dr Yaşar ERDINC (@yerdinc65 on twitter ) tarafından oluşturulmuştur.


TKE indikatörü 7 indikatörün aritmetik ortalamasından oluşmaktadır.


TKE=(RSI+STOKASTİK+SON OSİLATÖR+MFI+WIILIAMS %R+MOMENTUM+CCI)/7


Al sinyali: TKE 20 değerini yukarı kırması


Aşırı satım bölgesi: 20 değerinin altında

Aşırı alım bölgesi: 80'in üzerinde değer

using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using Matriks.Data.Identifiers;
using Matriks.Data.Symbol;
using Matriks.Engines;
using Matriks.Indicators;
using Matriks.Symbols;
using Matriks.AlgoTrader;
using Matriks.Trader.Core;
using Matriks.Trader.Core.Fields;
using Matriks.Trader.Core.TraderModels;
using Matriks.Lean.Algotrader.AlgoBase;
using Matriks.Lean.Algotrader.Models;
using Matriks.Lean.Algotrader.Trading;
namespace Matriks.Lean.Algotrader
{
	//Ilk parametre indikatörün adı, sınıfın adıyla aynı olmalıdır.
	//Ikinci parametre indikatörün Dataserisinin üzerine mi yeni pencereye mi ekleneceğini belirtir. Yeni pencere için ->IndicatorDrawingArea.NewWindow , Data Serisi için IndicatorDrawingArea.OnDataSeries
	[IndicatorInformationAttribute("TKEKripex", IndicatorDrawingArea.NewWindow)]
	//Indikatörün çizgilerinin isimleri
	[IndicatorLineInformationAttribute(new []
		{
			"TKE"
		})]

	public class TKEKripex : MatriksIndicator
	{

		//Indicator opsiyon panelinde değerleri değiştirebildiğimiz parametreler. Int, Bool, Decimal ve Enum değerleri alabilir.Tüm değişken tiplerini DefaultValue ile tanımlarız. 
		[DefaultValue(14)]
		public int StochasticFastKPeriod
		{
			get; set;
		}

		[DefaultValue(6)]
		public int StochasticFastDPeriod
		{
			get; set;
		}

		[DefaultValue(14)]
		public int RsiPeriod
		{
			get; set;
		}

		[DefaultValue(14)]
		public int CciPeriod
		{
			get; set;
		}

		[DefaultValue(14)]
		public int MfiPeriod
		{
			get; set;
		}

		[DefaultValue(14)]
		public int WillRPeriod
		{
			get; set;
		}

		[DefaultValue(14)]
		public int MomPeriod
		{
			get; set;
		}

		[DefaultValue(7)]
		public int UltKisaPeriod
		{
			get; set;
		}

		[DefaultValue(14)]
		public int UltMediumPeriod
		{
			get; set;
		}

		[DefaultValue(28)]
		public int UltUzunPeriod
		{
			get; set;
		}

		ULT ult;

		MOM mom;

		WILLIAMSR willamsr;

		MFI mfi;

		CCI cci;

		RSI rsi;

		StochasticFast stochasticFast;

		public sealed override void OnInit()
		{
			ult = ULTIndicator(Symbol, SymbolPeriod, OHLCType.Close, UltKisaPeriod, UltMediumPeriod, UltUzunPeriod);

			mom = MOMIndicator(Symbol, SymbolPeriod, OHLCType.Close, MomPeriod);

			willamsr = WILLIAMSRIndicator(Symbol, SymbolPeriod, WillRPeriod);

			mfi = MFIIndicator(Symbol, SymbolPeriod, MfiPeriod);

			cci = CCIIndicator(Symbol, SymbolPeriod, OHLCType.Close, CciPeriod);

			rsi = RSIIndicator(Symbol, SymbolPeriod, OHLCType.Close, RsiPeriod);

			stochasticFast = StochasticFastIndicator(Symbol, SymbolPeriod, OHLCType.Close, StochasticFastKPeriod, StochasticFastDPeriod, MovMethod.Exponential);

			DrawHorizantal(0);
			DrawHorizantal(20);
			DrawHorizantal(80);
		}

		decimal tke;

		public override void OnDataUpdate(int currentBar, decimal inputValue, DateTime barDateTime)
		{
			tke = (stochasticFast.CurrentValue + rsi.CurrentValue + cci.CurrentValue + mfi.CurrentValue + willamsr.CurrentValue + mom.CurrentValue + ult.CurrentValue) / 7;

			if (currentBar < UltUzunPeriod)
			{
				SetLine(0, currentBar, 0);
				return ;
			}

			SetLine(0, currentBar, tke);

		}
	}
}

0 Yorum