I am trying to write a strategy that goes long on instrument A and short on instrument B when the price of instrument B has diverged by a certain amount from instrument A. When I try to run the strategy, I get no results and the chart of the instrument won't show.
if(Position.MarketPosition == MarketPosition.Flat && Close[0] > 2*Closes[1][0])
{
EnterShort(0, 1, "ENTRY");
EnterLong(1, 1, "ENTRY");
}
Thank you

Comment