Merhaba,
Yapmak istediğim aşağıdaki indikatördü. Teşekkürler. :)
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
{
[IndicatorInformationAttribute("YC_Simple_Indicator", IndicatorDrawingArea.OnDataSeries)]
[IndicatorLineInformationAttribute(new []
{
"YC"
})]
public class YC_Simple_Indicator : MatriksIndicator
{
[DefaultValue(9)]
public int Periyot
{
get; set;
}
MOV mov;
public sealed override void OnInit()
{
mov = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, Periyot, MovMethod.Variable);
}
decimal _high, _low, _close;
public override void OnDataUpdate(int currentBar, decimal inputValue, DateTime barDateTime)
{
_high = Instrument.SymbolBarData.High[currentBar];
_low = Instrument.SymbolBarData.Low[currentBar];
_close = Instrument.SymbolBarData.Close[currentBar];
mov.Update((_high + _low + 2 * _close) / 4, currentBar, barDateTime);
SetLine(0, currentBar, mov.CurrentValue);
}
}
}