Фьючерс РТС. Стратегия N3
C#
RTS Фьючерс. Timeframe 10 min. 2016-2021.
Дополнительный фильтр(условие) к Стратегии Фьючерс РТС. Стратегия N1
only long / without commission
Код
using System;
using System.Drawing;
using OpenQuant.API;
using OpenQuant.API.Indicators;
public class MyStrategy : Strategy
{
[Parameter("Order quantity (number of contracts to trade)")]
double Qty = 1;
double A =0;
;
BarSeries series
public override void OnStrategyStart()
{
= GetBars(BarType.Time,86400) ;
BarSeries series
}
public override void OnBarSlice(long size)
{
if (Bars.Count > 1)
= ((Bar.Close-Bars.Last.Open)/Bars.Last.Open)*100;
A
{
if (!HasPosition)
{
//Rules
if ( A<=3 & Clock.Now.Hour == 17
& Bar.DateTime.DayOfWeek!=DayOfWeek.Thursday
& Bar.DateTime.DayOfWeek!=DayOfWeek.Tuesday
& Bar.DateTime.Year>=2016)
{
Buy(Qty);
}
}
else
{
if
(
.Now.Hour==23 & Clock.Now.Minute==30 )
Clock{
Sell(Qty);
}
}
}
}
}