Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
94.170%
Drawdown
11.200%
Expectancy
0
Net Profit
0%
Sharpe Ratio
2.067
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.457
Beta
0.337
Annual Standard Deviation
0.236
Annual Variance
0.056
Information Ratio
1.659
Tracking Error
0.238
Treynor Ratio
1.447
Total Fees
$0.00
namespace QuantConnect 
{   
    /*
    *   QuantConnect University: FOREX - Using Currency Data
    *
    *   QuantConnect allows you to use currency data for your backtest with a 
    *   simple line of code. See the SecurityType.Forex below.
    */
    public class FOREXBasicTemplateAlgorithm : QCAlgorithm
    {
        public override void Initialize()
        {
            SetStartDate(2017, 1, 1);         
            SetEndDate(DateTime.Now.Date.AddDays(-1)); 
            SetCash(25000);
            AddSecurity(SecurityType.Forex, "EURUSD", Resolution.Minute);
            SetBrokerageModel(Brokerages.BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);
            //SetBrokerageModel(Brokerages.BrokerageName.FxcmBrokerage, AccountType.Margin);
        }

        public void OnData(TradeBars data) 
        {   
            if (!Portfolio.HoldStock) 
            {
                MarketOrder("EURUSD", 100000);
                Debug("Purchased EURUSD on " + Time.ToShortDateString());
            }
        }
    }
}