protectedoverridevoid Initialize()
{
// Add a 5 minute Bars object to the strategy
Add("$EURUSD", PeriodType.Minute, 5);
// Add a 15 minute Bars object to the strategy
Add("$GBPUSD", PeriodType.Minute, 5);
}
and then submit and order to buy the EURUSD and sell the GBPUSD this way..........
if (BarsInProgress == 1)
{
// Submits a buy market order for eur/usd
EnterLong();
}
// Checks if OnBarUpdate() is called from an update on GBP/USD
if (BarsInProgress == 2)
{
// Submits a Sell market order for gbp/usd
EnterShort();
}
Comment