Merhaba,
Aşağıdaki kodu kullanabilirsiniz.
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 DiExp : Explorer
{
[Parameter(19)]
public int DiPeriod;
DemandIndex demandIndex;
public override void OnInit()
{
demandIndex = DemandIndexIndicator(Symbol, SymbolPeriod, DiPeriod);
AddColumns(1);
SetColumnText(0, "DI");
}
public override bool OnExplorer(List<BarDataEventArgs> bardatas)
{
SetColumn(0, Math.Round(demandIndex.CurrentValue, 4));
if (demandIndex.CurrentValue>20)
return true;
return false;
}
}
}