Buy order comes minutes

Forums ProRealTime English forum ProOrder support Buy order comes minutes

Viewing 3 posts - 1 through 3 (of 3 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.
    #238790

    Thank you.
    I will try with very liquid assets to check.

Viewing 3 posts - 1 through 3 (of 3 total)

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