Merhaba,
Aşağıdaki kodu inceleyip deneyebilirsiniz.
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 TilsonExp : Explorer
{
[Parameter(3)]
public int Period;
[Parameter(0.7)]
public decimal A;
TMOV tmov;
public override void OnInit()
{
tmov = TMOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, Period, A);
AddColumns(2);
SetColumnText(0, "Tmov");
SetColumnText(1, "Close");
}
public override bool OnExplorer(List<BarDataEventArgs> bardatas)
{
var barDataModel = GetBarData();
var bardata = bardatas.FirstOrDefault();
SetColumn(0, Math.Round(tmov.CurrentValue, 4));
SetColumn(1, Math.Round(bardata.BarData.Close, 4));
if (CrossAbove(barDataModel, tmov, OHLCType.Close))
return true;
return false;
}
}
}