Buy order comes minutes

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #238311 quote
    bewoke2
    Participant
    Average

    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 quote
    Iván González
    Moderator
    Legend

    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.

    robertogozzi thanked this post
    2024-10-01_16-52.png 2024-10-01_16-52.png
    #238790 quote
    bewoke2
    Participant
    Average

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Buy order comes minutes


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
bewoke2 @bewoke2 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by bewoke2
1 year, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/30/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...