Merhaba, bollinger orta bandi, basit hareketli ortalamadir.
Mevcut SMA200 taramasinda asagidaki gibi bir degisiklilk yaparak istediginiz taramayi yaratabilirsiniz.
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 sma200_kopya : Explorer
{
[Parameter(200)]
public int MovPeriod1;
[Parameter(MovMethod.Simple)]
public MovMethod MovMethod;
MOV mov;
public override void OnInit()
{
AddColumns(3);
SetColumnText(0, "Mov1");
SetColumnText(1, "Close");
SetColumnText(2, "MovClose%fark");
mov = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, MovPeriod1, MovMethod.Simple);
}
public override bool OnExplorer(List<BarDataEventArgs> bardatas)
{
var barData = bardatas.FirstOrDefault();
var close = barData.BarData.Close;
var BarData = GetBarData(); //<----eklenen kisim
var pct_diff = 100 * (close - mov.CurrentValue) / mov.CurrentValue;
SetColumn(0, Math.Round(mov.CurrentValue, 2));
SetColumn(1, Math.Round(close, 2));
SetColumn(2, Math.Round(pct_diff, 2));
if (CrossAbove(BarData,mov,OHLCType.Close,0)) //<----degistirilen kisim
return true;
return false;
}
}
}