Merhaba,
Aşağıdaki kodu inceleyip kullanabilirsiniz.
explorer adının MostIQExp olmasına dikkat ediniz.
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 MostIQExp : Explorer
{
[Parameter(3)]
public int Period;
[Parameter(2)]
public decimal Yuzde;
[Parameter(MovMethod.Exponential)]
public MovMethod movmethod;
[Parameter(true)]
public bool AlisMI;
MOST most;
public override void OnInit()
{
most = MOSTIndicator(Symbol, SymbolPeriod, OHLCType.Close, Period, Yuzde, movmethod);
AddColumns(3);
SetColumnText(0, "Most");
SetColumnText(1, "Exmov");
SetColumnText(2, "Emir Yönü");
}
public override bool OnExplorer(List<BarDataEventArgs> bardatas)
{
SetColumn(0, Math.Round(most.CurrentValue, 4));
SetColumn(1, Math.Round(most.ExMOV.CurrentValue, 4));
if (CrossAbove(most.ExMOV,most) && AlisMI)
{
SetColumn(2, "Alış");
}else if (CrossBelow(most.ExMOV,most) && !AlisMI)
{
SetColumn(2, "Satış");
}
if ((AlisMI && CrossAbove(most.ExMOV,most)) || (!AlisMI && CrossBelow(most.ExMOV,most)))
return true;
return false;
}
}
}