Hello Everyone.
I am starting learning ProRealCode. I went through the tutorial, and now I understand the idea of it.
While trying to test a simple code that buys the same amount of shares at the start of each month. The buy order goes always minutes after the market opens.
Here is the code.
// The screen is applied to the current year
IF YEAR = 2023 THEN
// Check if this is the start of the month
IF DAY < DAY[1] and hour < hour[1] and MINUTE < MINUTE[1] THEN
// Update the variable
BUY 1 SHARES AT MARKET
ENDIF
ENDIF
// Check if it is the start of the next year
IF YEAR = 2024 and MONTH = 1 and DAY < DAY[1] and hour < hour[1] and MINUTE < MINUTE[1] THEN
// Sell the stock
SELL AT MARKET
ENDIF
When I run my screen, it buys at 09:07, 09:08… (French market time).
Any explanation please?