NY SESSION Trading Strategy


Hi master traders! I'm a trying to code a strategy with the following rules: (I'm a beginner in coding)

Buy if the opening candle in the NY session is above MA20.

Sell if the opening candle in the NY session is below MA20. 

My problem is that the New York session opening time changes twice a year (in March and November). I want to test it in the strategy tester with five years' worth of historical data. Is there a code that automatically detects the opening time of the New York session?

double ma20;
int ticket;

void OnTick()
  ma20 = iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0);
  if( ma20 > Bid && TimeCurrent()== NEWYORKSESSION)
   { ticket = OrderSend(NULL,OP_BUY,0.1,Bid,20,30,30);
  if (ma20 < Bid && TimeCurrent()== NEWYORKSESSION)
   { ticket = OrderSend(NULL,OP_SELL,0.1,Bid,20,30,30);

What code should I substitute for "NEWYORKSESSION"?