Фьючерс РТС. Стратегия N2
RTS Фьючерс. Timeframe 10min. 2010-2021.
only short / with 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;
public override void OnStrategyStart()
{
}
public override void OnBarSlice(long size)
{
{
if (!HasPosition)
{
//Rules
if ( Clock.Now.Hour==10 & Clock.Now.Minute==10
& Bar.DateTime.Day>=15 )
{
Sell(Qty);
}
}
else
{
if
(
Clock.Now.Hour==17 & Clock.Now.Minute==00 )
{
Buy(Qty);
}
}
}
}
}