0 beğenilme 0 beğenilmeme
561 kez görüntülendi
al
if(MOV(C,opt1,VAR)>OTT(C,opt1,opt2),
MOV(C,opt1,VAR)<OTT(C,opt1,opt3)*(1+opt4) AND
STOSK(opt5,opt6,33,VAR)+1000<OTT(STOSK(opt5,opt6,33,VAR)+1000,2,opt7),
MOV(C,opt1,VAR)<OTT(C,opt1,opt3)*(1+opt4) AND
STOSK(opt5,opt6,33,VAR)+1000<OTT(STOSK(opt5,opt6,33,VAR)+1000,2,opt7))

sat
if(MOV(C,opt1,VAR)>OTT(C,opt1,opt2),
MOV(C,opt1,VAR)>OTT(C,opt1,opt3)*(1+opt4) AND
STOSK(opt5,opt6,33,VAR)+1000>OTT(STOSK(opt5,opt6,33,VAR)+1000,2,opt7),
MOV(C,opt1,VAR)>OTT(C,opt1,opt3)*(1+opt4) AND
STOSK(opt5,opt6,33,VAR)+1000>OTT(STOSK(opt5,opt6,33,VAR)+1000,2,opt7))

Emir tipleri bu şekilde yardımcı olabilirseniz çok memnun olurum.
İndikator kategorisinde (14 puan) tarafından | 561 kez görüntülendi

1 cevap

0 beğenilme 0 beğenilmeme

Merhabalar,

Lütfen aşağıdaki stratejiyi test ediniz.

using System;
using System.Collections.Generic;
using System.Linq;
using Matriks.Data.Symbol;
using Matriks.Engines;
using Matriks.Indicators;
using Matriks.Symbols;
using Matriks.Trader.Core;
using Matriks.Trader.Core.Fields;
using Matriks.Lean.Algotrader.AlgoBase;
using Matriks.Lean.Algotrader.Models;
using Matriks.Lean.Algotrader.Trading;
using Matriks.AI;
using Matriks.AI.AiParameters;
using Matriks.AI.Data;
using Matriks.Trader.Core.TraderModels;

namespace Matriks.Lean.Algotrader
{
	public class PrimeIQTOTT : 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("OTTO")]
			public string Symbol1;


		[Parameter(SymbolPeriod.Day)]
			public SymbolPeriod SymbolPeriod1;


		[Parameter(2)]
			public int OttPeriod1;

		[Parameter(1.4)]
			public decimal OttOpt1;

		[Parameter(MovMethod.VAR)]
			public MovMethod OttMovMethod1;

		[Parameter(true)]
			public bool OttSupportLine1;

		[Parameter(40)]
			public int TottPeriod1;

		[Parameter(1)]
			public decimal TottOpt1;

		[Parameter(0.001)]
			public decimal TottTwinOttCoef1;

		[Parameter(MovMethod.VAR)]
			public MovMethod TottMovMethod1;

		[Parameter(500)]
			public int SottPeriodK1;

		[Parameter(200)]
			public int SottPeriodSlowK1;

		[Parameter(2)]
			public int SottOttPeriod1;

		[Parameter(0.5)]
			public decimal SottOttOpt1;

		[Parameter(MovMethod.VAR)]
			public MovMethod SottOttMethod1;

		[Parameter(MovMethod.VAR)]
			public MovMethod SottStosKMethod1;

		[Parameter(1)]
			public decimal OrderQuantity1;

		[Parameter(1)]
			public decimal OrderQuantity2;

		OTT ott;
		TOTT tott;
		SOTT sott;



		public override void OnInit()
		{

			ott = OTTIndicator(Symbol1, SymbolPeriod1, OHLCType.Close, OttPeriod1, OttOpt1, OttMovMethod1, OttSupportLine1);
			tott = TOTTIndicator(Symbol1, SymbolPeriod1, OHLCType.Close, TottPeriod1, TottOpt1, TottTwinOttCoef1, TottMovMethod1);
			sott = SOTTIndicator(Symbol1, SymbolPeriod1, OHLCType.Close, SottPeriodK1, SottPeriodSlowK1, SottOttPeriod1, SottOttOpt1, SottOttMethod1, SottStosKMethod1);


			SendOrderSequential(true, Side.Buy);
			WorkWithPermanentSignal(true);

			//Alttaki fonksiyon açıldıktan sonra parametre olarak verilen saniyede bir OnTimer fonksiyonu tetiklenir.
			// SetTimerInterval(3600);

			//Alttaki fonksiyon ile tanımlanan sembol ile ilgili haber geldiğinde OnNewsReceived fonksiyonu tetiklenir.
			//AddNewsSymbol(Symbol);

			//Alttaki fonksiyon ile tanımlanan anahtar kelime ile ilgili haber geldiğinde OnNewsReceived fonksiyonu tetiklenir.
			//AddNewsKeyword("KAP");
		}

		/// <summary>
		/// Init islemleri tamamlaninca, bardatalar kullanmaya hazir hale gelince bu fonksiyon tetiklenir. Data uzerinde bir defa yapilacak islemler icin kullanilir
		/// </summary>
		public override void OnInitCompleted()
		{

		}

		/// <summary>
		/// SetTimerInterval fonksiyonu ile belirtilen sürede bir bu fonksiyon tetiklenir.
		/// </summary>
		public override void OnTimer()
		{

		}

		/// <summary>
		/// AddNewsSymbol ve AddNewsKeyword ile haberlere kayit olunmuşsa bu fonksiyon tetiklenir.
		/// </summary>
		/// <param name="newsId">Gelen haberin id'si</param>
		/// <param name="relatedSymbols">Gelen haberin ilişkili sembolleri</param>
		public override void OnNewsReceived(int newsId, List<string> relatedSymbols)
		{

		}

		/// <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(BarDataEventArgs barData)
		{
			if (ott.Value[1][ott.CurrentIndex] > ott.Value[0][ott.CurrentIndex])
			{
				if (tott.Value[0][tott.CurrentIndex] < tott.Value[1][tott.CurrentIndex] && sott.Value[0][sott.CurrentIndex] < sott.Value[1][sott.CurrentIndex])
				{
					SendMarketOrder(Symbol1, OrderQuantity1, OrderSide.Buy, includeAfterSession:false);
				}
			}

			if (ott.Value[1][ott.CurrentIndex] > ott.Value[0][ott.CurrentIndex])
			{
				if (tott.Value[0][tott.CurrentIndex] < tott.Value[2][tott.CurrentIndex] && sott.Value[0][sott.CurrentIndex] < sott.Value[1][sott.CurrentIndex])
				{
					SendMarketOrder(Symbol1, OrderQuantity2, OrderSide.Sell, includeAfterSession:false);
				}
			}

			}

			/// <summary>
			/// Gönderilen emirlerin son durumu değiştikçe bu fonksiyon tetiklenir.
			/// </summary>
			/// <param name="barData">Emrin son durumu</param>
			public override void OnOrderUpdate(IOrder order)
			{
			}

			/// <summary>
			/// Strateji durdurulduğunda bu fonksiyon tetiklenir.
			/// </summary>
			public override void OnStopped()
			{
			}
		}
	}

İyi çalışmalar.

 

(11,069 puan) tarafından
0 0

Maalesef çalıştıramadım. https://www.hizliresim.com/60i6b8s

0 0
Merhabalar,

Stratejinin adını PrimeIQTOTT olarak değiştirdiğinizde hata almayacaksınız.

İyi çalışmalar.
0 0
Hocam iyi çalışmalar ismi değiştirince sorun ortadan kalktı fakat opt ayarlaması yapamadım maalesef. Rica etsem optleri bu şekilde ayarlayabilir misiniz?

OPT1:40
OPT2: 7
OPT3: 1
OPT4:0,0008
OPT5: 600
OPT6: 300
OPT7: 0,9
0 0

Merhabalar,

Opt ayarlarını kendiniz manuel olarak değiştirebilirsiniz.

Aşağıdaki sıralama sizin verdiğiniz sisteme göre giden sıralamadır.

Backtest ekranından bunu dilediğiniz gibi optimize edebilirsiniz.

 

İyi çalışmalar.

7,506 soru
7,510 cevap
4,405 yorum
8,700 kullanıcı