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;
}
}
}