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?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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"?