26.12.2023
0
0
247
0
LIDER indikatörünün IQ ya uyarlanmış halidir.


       YIGIT:= 1;
	ADAM:= 300;
	TX:= Mov(C, YIGIT, w);
	RX:= C - Mov(C, YIGIT, w);
	DA:= TX + Mov(RX, YIGIT, w);
	ZA:= C - Mov(C, ADAM, w);
	LIDER:= DA - ZA;
	SY:= Mov(C, YIGIT, w);
	LIDER; SY
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
{
	/*
	YIGIT:= 1;
	ADAM:= 300;
	TX:= Mov(C, YIGIT, w);
	RX:= C - Mov(C, YIGIT, w);
	DA:= TX + Mov(RX, YIGIT, w);
	ZA:= C - Mov(C, ADAM, w);
	LIDER:= DA - ZA;
	SY:= Mov(C, YIGIT, w);
	LIDER; SY
	*/

	[IndicatorInformationAttribute("LIDER", IndicatorDrawingArea.NewWindow)]
	[IndicatorLineInformationAttribute(new []
		{
			"LIDER", "SY"
		}, new []
		{
			"#00FFFF", "#FFFFFF"
		}, new []
		{
			false, false
		}, new []
		{
			4, 0
		}, new []
		{
			3, 1
		}



	)]

	public class LIDER : MatriksIndicator
	{
		MOV C;
		MOV TX, TX2, RX, DA, ZA, SY;

		public sealed override void OnInit()
		{
			AddSymbol(Symbol, SymbolPeriod);
			var yigit = 1;
			var adam = 300;
			C = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, 1, MovMethod.Simple);
			TX = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, yigit, MovMethod.Weighted);
			TX2 = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, adam, MovMethod.Weighted);
			RX = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, 1, MovMethod.Simple);
			DA = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, 1, MovMethod.Simple);
			ZA = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, 1, MovMethod.Simple);
			SY = MOVIndicator(Symbol, SymbolPeriod, OHLCType.Close, yigit, MovMethod.Weighted);
		}


		public decimal lider = 0;
		public override void OnDataUpdate(int currentBar, decimal inputValue, DateTime barDateTime)
		{
			var barData = GetBarData();

			RX.Update(C.CurrentValue - TX.CurrentValue, currentBar, barDateTime, null);
			DA.Update(TX.CurrentValue + RX.CurrentValue, currentBar, barDateTime, null);
			ZA.Update(C.CurrentValue - TX2.CurrentValue, currentBar, barDateTime, null);
			lider = DA.CurrentValue - ZA.CurrentValue;

			SetLine(0, currentBar, lider);
			SetLine(1, currentBar, SY.CurrentValue);
		}
	}
}



0 Yorum