Фьючерс РТС. Стратегия N4

C#
Published

July 9, 2021

RTS Фьючерс. Timeframe 10min. 2015-today.

Еще две стратегии в одной, как отдельные варианты общей закономерности стратегии Фьючерс РТС. Сезонность N1

only long / with commission

Статистика

Код

1


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 &
                Bar.DateTime.DayOfWeek==DayOfWeek.Wednesday
                & Bar.DateTime.Month ==4 
                    
                    
                    )
                    
                
                {
                    Buy(Qty);
                
                }
            
        

            }
            
            else
            
            
            {
                if          
                    (
                Clock.Now.Hour==23 & Clock.Now.Minute==30           )
                {
                    Sell(Qty);
                    
                }
                
            
            
            }
        }
    }

    

}

2


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 &
                Bar.DateTime.DayOfWeek==DayOfWeek.Thursday
                & Bar.DateTime.Month ==4 )
                    
                    
                    
                
                {
                    Buy(Qty);
                
                }
            
        

            }
            
            else
            
            
            {
                if          
                    (
                Clock.Now.Hour==23 & Clock.Now.Minute==30           )
                {
                    Sell(Qty);
                    
                }
                
            
            
            }
        }
    }

    

}