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?
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?
What code should I substitute for "NEWYORKSESSION"?