Фьючерс РТС. Стратегия N1
RTS Фьючерс. Timeframe 10min. 2009-2021.
only long / with commission
2015-2021
only long / 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==17 & Clock.Now.Minute==10)
{
Buy(Qty);
}
}
else
{
if
(
Clock.Now.Hour==23 & Clock.Now.Minute==30 )
{
Sell(Qty);
}
}
}
}
}