Overall Statistics
Total Trades
10001
Average Win
0.00%
Average Loss
0.00%
Compounding Annual Return
-0.229%
Drawdown
0.200%
Expectancy
-0.046
Net Profit
-0.140%
Sharpe Ratio
-3.411
Probabilistic Sharpe Ratio
0.005%
Loss Rate
50%
Win Rate
50%
Profit-Loss Ratio
0.92
Alpha
-0.002
Beta
0.001
Annual Standard Deviation
0.001
Annual Variance
0
Information Ratio
-2.708
Tracking Error
0.104
Treynor Ratio
-1.725
Total Fees
$0.00
namespace QuantConnect.Algorithm.CSharp
{
     public class RenkoAlgorithm : QCAlgorithm
    {
    	RenkoBar prevDirection=null;
    	int	changes=0;
    	int bricks=1, allBricks=0;
    	int noDelta=0;
    	string pear="EURUSD";
    	int startAmount=1000000;
    	decimal parcent=0.2m;
    	decimal amount=0;
        public override void Initialize() 
        {
            // cash allocation
            SetCash(startAmount);  
            SetStartDate(2013, 01, 01);  
            SetEndDate(2014, 01, 01);
            //var renkoATR = ATR("EURUSD",14, MovingAverageType.Simple, Resolution.Daily);
            AddSecurity(SecurityType.Forex, pear, Resolution.Minute); //Minute, Second or Tick
            Securities[pear].FeeModel = new ConstantFeeModel(0m);

			var renkoClose = new RenkoConsolidator(0.001m);
	
            renkoClose.DataConsolidated += (sender, consolidated) =>
            {
                // call event handler for renko data

                HandleRenkoClose(consolidated);   


                
            };
            SubscriptionManager.AddConsolidator(pear, renkoClose);
            var stockPlot = new Chart("Renko");
            var buyOrders = new Series("Buy", SeriesType.Bar, 0);
            stockPlot.AddSeries(buyOrders);
            AddChart(stockPlot);
   


        }
     

        private void HandleRenkoClose(RenkoBar data)
		{
		Liquidate();
		MarketOrder(pear,5000);

		}
		
		
        
        public override void OnData(Slice data) 
        {
        	
        	// slice has lots of useful information
        	//if (!data.ContainsKey("EURUSD")) return;
        	//Ticks theticks = data.Ticks;
        	//Plot("Renko", "Buy", data["EURUSD"].Price);
        }
        
        public override void  OnEndOfAlgorithm() 
        { 
         
       Liquidate();	

        
        }
        
        
    }



    }