Merhaba,
Aşağıdaki explorer kodunu 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 MovCrossExp : Explorer
{
[Parameter(8)]
public int MovPeriod;
[Parameter(MovMethod.Exponential)]
public MovMethod movMethod;
MOV mov;
public override void OnInit()
{
AddColumns(2);
SetColumnText(0, "Mov");
SetColumnText(1, "Close");
mov = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, MovPeriod, movMethod);
}
public override bool OnExplorer(List<BarDataEventArgs> bardatas)
{
var bardata=GetBarData();
var close=bardatas.FirstOrDefault().BarData.Close;
SetColumn(0, Math.Round(mov.CurrentValue, 4));
SetColumn(1, Math.Round(close, 4));
if (CrossAbove(bardata,mov,OHLCType.Close))
return true;
return false;
}
}
}