protected override void OnBarUpdate()
{
if (TimeToTrade1)// 9:00am - 12:00pm Strategy 1
{
BackColor = Color.FromArgb(10,255,0,0);
Buy_1();
Buy_1_Profit();
Buy_1_Loss();
Buy_1_Exit();
Sell_1();
Sell_1_Profit();
Sell_1_Loss();
Sell_1_Exit();
}
else if (TimeToTrade2) // 10:00am - 2:00pm Strategy 2
{
BackColor = Color.FromArgb(10,0,0,255);
Buy_2();
Buy_2_Profit();
Buy_2_Loss();
Buy_2_Exit();
Sell_2();
Sell_2_Profit();
Sell_2_Loss();
Sell_2_Exit();
}
else // If not Time To Trade
{
SessionExit(); // Exit all trades...
}
}

Comment