17.05.2024
0
1
0
100

Most On Rsi


Kıvanç Özbilgiç tarafından oluşturulmuştur.


https://x.com/kivancozbilgic/status/1771127298374115701


======== Most On Rsi ========

= Geliştirici: Kıvanç Özbilgiç

= Yazar: Kripex

=============================

period:=input("MOST periyodu",1,500,5);

yuzde:=input("MOST yuzde",0,100,9);

RSIperiod:=input("RSI periyodu",1,500,14);

RSIplus:=input("RSI ekleme",0,1000,0);

RSp:=RSI(C,RSIperiod)+RSIplus;

MOV(RSp,period,VAR);

MOST(RSp,period,yuzde,VAR);

RSp;

30+RSIplus;

70+RSIplus

/*
======== Most On Rsi ========
= Geliştirici: Kıvanç Özbilgiç 
= Yazar: Kripex
=============================
period:=input("MOST periyodu",1,500,5);
yuzde:=input("MOST yuzde",0,100,9);
RSIperiod:=input("RSI periyodu",1,500,14);
RSIplus:=input("RSI ekleme",0,1000,0);
RSp:=RSI(C,RSIperiod)+RSIplus;
MOV(RSp,period,VAR);
MOST(RSp,period,yuzde,VAR);
RSp;
30+RSIplus;
70+RSIplus
*/

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
{
	//Ilk parametre indikatörün adı, sınıfın adıyla aynı olmalıdır.
	//Ikinci parametre indikatörün Dataserisinin üzerine mi yeni pencereye mi ekleneceğini belirtir. Yeni pencere için ->IndicatorDrawingArea.NewWindow , Data Serisi için IndicatorDrawingArea.OnDataSeries
	[IndicatorInformationAttribute("MostOnRsiKripex", IndicatorDrawingArea.NewWindow)]
	//Indikatörün çizgilerinin isimleri
	[IndicatorLineInformationAttribute(new []
		{
			"ExMovRsi (0)", "MostRsi (0,% 1)", "RSp (2)", "AltSeviye", "UstSeviye"
		}, new []
		{
			"#FFFF00", "#e600de", "#00CCFF", "#FFFFFF", "#FFFFFF"
		}, new []
		{
			false, false, false, false, false
		}, new []
		{
			0, 0, 0, 6, 6
		}, new []
		{
			2, 1, 1, 1, 1
		}
	)]
	public class MostOnRsiKripex : MatriksIndicator
	{
		//Indicator opsiyon panelinde değerleri değiştirebildiğimiz parametreler. Int, Bool, Decimal ve Enum değerleri alabilir.Tüm değişken tiplerini DefaultValue ile tanımlarız. 
		[DefaultValue(5)]
		public int MostPeriod
		{
			get; set;
		}

		[DefaultValue(9)]
		public decimal MostYuzde
		{
			get; set;
		}

		[DefaultValue(14)]
		public int RsiPeriod
		{
			get; set;
		}

		[DefaultValue(0)]
		public decimal RSIplus
		{
			get; set;
		}

		RSI rsi;
		MOST mostRsi;

		public sealed override void OnInit()
		{
			rsi = RSIIndicator(Symbol, SymbolPeriod, OHLCType.Close, RsiPeriod);
			mostRsi = new MOST(MostPeriod, MostYuzde, MovMethod.VAR);
			
			Period=Math.Max(MostPeriod,RsiPeriod);
		}

		public override void OnDataUpdate(int currentBar, decimal inputValue, DateTime barDateTime)
		{
			var RSp = rsi.Value[0][rsi.CurrentIndex] + RSIplus;

			mostRsi.Update(RSp, currentBar, barDateTime);

			SetLine(0, currentBar, mostRsi.Value[1][mostRsi.CurrentIndex]);
			SetLine(1, currentBar, mostRsi.Value[0][mostRsi.CurrentIndex]);
			SetLine(2, currentBar, RSp);
			SetLine(3, currentBar, 30 + RSIplus);
			SetLine(4, currentBar, 70 + RSIplus);
		}
	}
}

0 Yorum