Merhaba,
Aşağıdaki stratejiyi deneyiniz.
***STRATEJİLERİ TEST/DENEME ORTAMINDA SINAMADAN VE SİZİN İSTEDİĞİNİZ ŞEKİLDE ÇALIŞTIĞINA EMİN OLMADAN GERÇEK ORTAMDA HİÇBİR ZAMAN ÇALIŞTIRMAYINIZ ***
using System;
using System.Collections.Generic;
using System.Linq;
using Matriks.Data.Symbol;
using System.Windows.Media;
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
{
	public class OTT_STOCHASTIC_SLOWINDIKATORU: MatriksAlgo
	{
		// Strateji çalıştırılırken kullanacağımız parametreler. Eğer sembolle ilgili bir parametre ise,
		// "SymbolParameter" ile, değilse "Parameter" ile tanımlama yaparız. Parantez içindeki değerler default değerleridir.
		[SymbolParameter("EKGYO")]
		public string Symbol;
		[Parameter(SymbolPeriod.Min15)]
		public SymbolPeriod SymbolPeriod;
		[Parameter(1)]
		public decimal BuyOrderQuantity;
		[Parameter(1)]
		public decimal SellOrderQuantity;
		[Parameter(2)]
		public int Period;
		[Parameter(1)]
		public decimal Percentage;
		[Parameter(500)]
		public int StosPeriodK;
		[Parameter(300)]
		public int StosPeriodD;
		[Parameter(500)]
		public int StosPeriodSlowK;
		OTT ott;
		bool islemde = false;
		StochasticSlow stos;
		int FirstRun = 0;
        int realposition = 0;
		
		[Output]
        public int IlkCalisma;
        [Output]
        public int Pozisyon;
		public override void OnInit()
		{
			stos = StochasticSlowIndicator(Symbol, SymbolPeriod, OHLCType.Close, StosPeriodK, StosPeriodD, StosPeriodSlowK, MovMethod.VAR);
			ott = OTTIndicator(Symbol, SymbolPeriod, OHLCType.Close, Period, Percentage, MovMethod.VAR, true);
			AddSymbol(Symbol, SymbolPeriod);
			// Algoritmanın kalıcı veya geçici sinyal ile çalışıp çalışmayacağını belirleyen fonksiyondur.
			// true geçerseniz algoritma sadece yeni bar açılışlarında çalışır, bu fonksiyonu çağırmazsanız veya false geçerseniz her işlem olduğunda algoritma tetiklenir.
			WorkWithPermanentSignal(true);
			//Eger backtestte emri bir al bir sat seklinde gonderilmesi isteniyor bu true set edilir.
			//Alttaki satırı silerek veya false geçerek emirlerin sirayla gönderilmesini engelleyebilirsiniz.
			SendOrderSequential(true,true);
		}
		/// <summary>
		/// Eklenen sembollerin bardata'ları ve indikatorler güncellendikçe bu fonksiyon tetiklenir.
		/// </summary>
		/// <param name="barData">Bardata ve hesaplanan gerçekleşen işleme ait detaylar</param>
		public override void OnDataUpdate(BarDataCurrentValues barDataCurrentValues)
		{
			bool stosAlSignal = stos.StochasticSlowK.CurrentValue > stos.StochasticSlowD.CurrentValue ? true:false;
			bool buy = (stosAlSignal) ? true:false;
			
			//bool kanalustu =(ottH.ottSupportLine.CurrentValue>ottH.ottLine.CurrentValue && ottL.ottSupportLine.CurrentValue>ottL.ottLine.CurrentValue) ? true: false ;
			if (CrossAbove(ott.ottSupportLine, ott) && buy)
			{
				if (FirstRun == 0)
                {
                    SendMarketOrder(Symbol, BuyOrderQuantity, (OrderSide.Buy));
                    Debug("Alış emri verildi.");
                    FirstRun = 1;
                }
                else
                {
                    SendMarketOrder(Symbol, BuyOrderQuantity * 2, (OrderSide.Buy));
                    Debug("Alış emri verildi.");
                }				
				Debug("OTT_SupportLine:" + ott.ottSupportLine.CurrentValue);
				Debug("OTTLine:" + ott.ottLine.CurrentValue);
				islemde = true;
			}
			if (CrossBelow(ott.ottSupportLine, ott) && !buy)
			{
				if (FirstRun == 0)
                {
                    SendMarketOrder(Symbol, SellOrderQuantity, (OrderSide.Sell));
                    Debug("Satış emri verildi.");
                    FirstRun = 1;
                }
                else
                {
                    SendMarketOrder(Symbol, SellOrderQuantity * 2, (OrderSide.Sell));
                    Debug("Satış emri verildi.");
                }			
				Debug("OTT_SupportLine:" + ott.ottSupportLine.CurrentValue);
				Debug("OTTLine:" + ott.ottLine.CurrentValue);
				islemde = false;
			}
			
			IlkCalisma = FirstRun;
            Pozisyon = realposition;
		}
		
		public override void OnOrderUpdate(IOrder order)
        {
            //Gercek zamanli pozisyon takibi
            if (order.OrdStatus.Obj == OrdStatus.Filled && order.Side.Obj == Side.Buy)
            {
                var positionChange = order.OrderQty;
                realposition += (int)positionChange;
                Debug("[ONORDERUPDATE]: Pozisyon = " + realposition);
            }
            if (order.OrdStatus.Obj == OrdStatus.Filled && order.Side.Obj == Side.Sell)
            {
                var positionChange = order.OrderQty;
                realposition -= (int)positionChange;
                Debug("[ONORDERUPDATE]: Pozisyon = " + realposition);
            }
        }
	}
}
 
 Unblocked Games offering a wide range of experiences: action, puzzle, platform, racing, clicker mechanics, strategy, sports, even horror. 
https://unblocked1games.github.io