60 dk da hareketli ortalama 5 in 10 'u yukarı kestikten sonra ki barları sayıyor, aşağı keserse sıfır değerini alıyor. ENJSA 60 dk da İndikatör 5 in 10 u yukarı kestiğinde 6 bar sayıyor ama bu intikatörü Explorer da kullandığımda ENJSA 60 dk 5 in 10'u yukarı kestikten sonra ki bar sayısını 6529 gösteriyor.
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using Matriks.Data.Identifiers;
using Matriks.Data.Symbol;
using Matriks.Engines;
using Matriks.Indicators;
using Matriks.Symbols;
using Matriks.AlgoTrader;
using Matriks.Trader.Core;
using Matriks.Trader.Core.Fields;
using Matriks.Trader.Core.TraderModels;
using Matriks.Lean.Algotrader.AlgoBase;
using Matriks.Lean.Algotrader.Models;
using Matriks.Lean.Algotrader.Trading;
namespace Matriks.Lean.Algotrader
{
[IndicatorInformation("TestMovIndicator", IndicatorDrawingArea.OnDataSeries)]
[IndicatorLineInformation(new []
{
"TestMovIndicator (0,1)", "TestMovIndicator 1 (0,1)"
})]
public class TestMovIndicator : MatriksIndicator
{
[DefaultValue(5)]
public int Period5
{
get; set;
}
[DefaultValue(10)]
public int Period10
{
get; set;
}
public int Mov5OnMov10BarCount
{
get; set;
}
MOV mov5;
MOV mov10;
public override void OnInit()
{
mov5 = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, Period5, MovMethod.Exponential);
mov10 = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, Period10, MovMethod.Exponential);
PointTitle.Add(0, new Dictionary<int, IIndicatorIcons>());
Mov5OnMov10BarCount = 0;
}
public override void OnDataUpdate(int currentBar, decimal inputValue, DateTime barDateTime)
{
SetLine(0, currentBar, mov5.CurrentValue);
SetLine(1, currentBar, mov10.CurrentValue);
if (mov5.CurrentValue>mov10.CurrentValue)
{
Mov5OnMov10BarCount++;
SetPointTitle(0, currentBar, Mov5OnMov10BarCount.ToString(), IconLocation.BelowTheChart, inputValue, false, "WHITE");
} else
{
Mov5OnMov10BarCount = 0;
}
}
}
}
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 TestMovExplorer : Explorer
{
TestMovIndicator testInd;
public override void OnInit()
{
testInd = new TestMovIndicator();
testInd.SetIndicatorParameters("Period5", 5);
testInd.SetIndicatorParameters("Period10", 10);
RegisterUserIndicator(testInd, Symbol, SymbolPeriod, OHLCType.Close, 5);
AddColumns(2);
SetColumnText(0, "Mov5");
SetColumnText(1, "BarCount");
}
public override bool OnExplorer(List<BarDataEventArgs> bardatas)
{
SetColumn(0, testInd.CurrentValue);
SetColumn(1, testInd.Mov5OnMov10BarCount);
return true;
}
}
}
.