Buy order comes minutes

Forums ProRealTime English forum ProOrder support Buy order comes minutes

  • This topic has 1 reply, 2 voices, and was last updated 1 week ago by avatarIván.
Viewing 2 posts - 1 through 2 (of 2 total)
  • #238311

    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?

    #238358

    Hello, It depends on the asset you are trading. If it is not very liquid, there will be minutes when it is not traded. I give you an example in the attached image.

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login