1 beğenilme 0 beğenilmeme
501 kez görüntülendi

Merhaba, IQ için SuperSmoothedMACD ile bir explorer yazmaya çalıştım ama başaramadım. kod yazma konusunda tecrübem yok ama diğer explorerlar üzerinden mantık yürüterek bir şeyler yapmaya çalıştım. Explorer ilk etapta çalıştı ama sonuç vermedi. Sonradan yaptığım denemelerde ise hata vermeye başladı. Doğru explorer'ı yazabilir misiniz? ya da bendeki hataları söyleyebilir misiniz? Teşekkürler.

 

bir küçük ekleme de yaparsanız sevinirim. Alış mı? sorusuna cevap verebileyim aynı MOSTIQExp Explorer'ında olduğu gibi.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Matriks.Data.Symbol;
using Matriks.Engines;
using Matriks.Lean.Algotrader.AlgoBase;
using Matriks.Lean.Algotrader.Models;
using Matriks.Indicators;

namespace Matriks.Lean.Algotrader
{
	public class SuperSmoothedMACDExp : Explorer
	{
		[Parameter(8)]
		public int SupersmoothedmacdShortPeriod1;

		[Parameter(13)]
		public int SupersmoothedmacdLongPeriod1;

		[Parameter(5)]
		public int SupersmoothedmacdSmoothPeriod1;

		SuperSmoothedMACD superSmoothedMACD;
		public override void OnInit()
		{
			superSmoothedMACD = SuperSmoothedMACDIndicator(Symbol, SymbolPeriod, OHLCType.Close, 8, 13, 5);

			AddColumns(2);
			SetColumnText(0, "SuperSmootherFr");
			SetColumnText(1, " SuperSmootherFilt");
		}

		public override bool OnExplorer(List<BarDataEventArgs> bardatas)
		{
			var barDataModel = GetBarData();

			var close = bardatas.FirstOrDefault().BarData.Close;


			SetColumn(0, Math.Round(close, 4));
			SetColumn(1, Math.Round(superSmoothedMACD.CurrentValue, 4));

			if (CrossAbove(barDataModel, superSmoothedMACD, OHLCType.Close))

				return true;
			return false;
		}
	}
}

 

Explorer kategorisinde (63 puan) tarafından | 501 kez görüntülendi

1 cevap

3 beğenilme 0 beğenilmeme
En İyi Cevap

Konuyu çözdüm. Şu anda çalışıyor.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Matriks.Data.Symbol;
using Matriks.Engines;
using Matriks.Lean.Algotrader.AlgoBase;
using Matriks.Lean.Algotrader.Models;
using Matriks.Indicators;

namespace Matriks.Lean.Algotrader
{
	public class SuperSmoothedMACDExp : Explorer
	{
		[Parameter(8)]
		public int SupersmoothedmacdShortPeriod1;

		[Parameter(13)]
		public int SupersmoothedmacdLongPeriod1;

		[Parameter(5)]
		public int SupersmoothedmacdSmoothPeriod1;

		[Parameter(true)]
		public bool AlisMI;

		SuperSmoothedMACD superSmoothedMACD;
		public override void OnInit()
		{
			superSmoothedMACD = SuperSmoothedMACDIndicator(Symbol, SymbolPeriod, OHLCType.Close, 8, 13, 5);

			AddColumns(3);
			SetColumnText(0, "SuperSmootherFr");
			SetColumnText(1, " SuperSmootherFilt");
			SetColumnText(2, "Emir Yönü");
		}

		public override bool OnExplorer(List<BarDataEventArgs> bardatas)
		{
			SetColumn(0, Math.Round(superSmoothedMACD.CurrentValue, 4));

			SetColumn(1, Math.Round(superSmoothedMACD.CurrentValue, 4));

			if (CrossAbove(superSmoothedMACD, superSmoothedMACD, 0, 1) && AlisMI)
			{
				SetColumn(2, "Alış");
			}
			else if (CrossBelow(superSmoothedMACD, superSmoothedMACD, 0, 1) && !AlisMI)
			{
				SetColumn(2, "Satış");
			}

			if ((AlisMI && CrossAbove(superSmoothedMACD, superSmoothedMACD, 0, 1)) || (!AlisMI && CrossBelow(superSmoothedMACD, superSmoothedMACD, 0, 1)))

				return true;
			return false;
		}
	}
}

 

(63 puan) tarafından
tarafından seçilmiş
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.



7,459 soru
7,453 cevap
4,384 yorum
7,780 kullanıcı