Buy at open sell at close

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #61026 quote
    Alberto Lucchese
    Participant
    Average

    Hello everyone,

    I’m new to probuilde and would like to understand the very basic concepts of the language.

    I’d like to try two very simple strategies:

    1. buy at open and sell at close the same day

    2. buy at open of today and sell at the open of tomorrow

    In both cases, the buy i think can be something like:

    IF NOT LongOnMarket THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF

    However for closing the position i’m not really sure how to make it. Can someone please help me with this?

     

    Thanks in advance

    #61028 quote
    robertogozzi
    Moderator
    Master

    IF LongOnMarket THEN
    Sell AT MARKET
    ENDIF

    That’s all you need to close a trade the next bar after opening.

    #61031 quote
    GraHal
    Participant
    Master
    #61086 quote
    Alberto Lucchese
    Participant
    Average

    Thank you!

    Any idea on how to sell the same day at close (of course this should be before close as after close the market is supposed to be closed also)?

    #61088 quote
    robertogozzi
    Moderator
    Master

    Strategies, until the new version is released (hopefully by the end of this year), are executed when a candle closes. No way to work it around!

    Alberto Lucchese thanked this post
    #103014 quote
    ck2016
    Participant
    New

    Hi guys, is it now possible to enter or exit a trade at the close of day with the new version 11.1?

    #103018 quote
    robertogozzi
    Moderator
    Master

    You ALWAYS have been able to enter when a candle closes.

    No need for v11.

    #103023 quote
    Vonasi
    Moderator
    Master

    You ALWAYS have been able to enter when a candle closes.

    Not strictly true Roberto. You have always been able to decide to enter a trade at the close of a candle but the actual opening always takes place at the open of the next candle.

    Now with MTF we can now decide to enter a trade 1 second before the close of a higher time frame candle.

    #103024 quote
    robertogozzi
    Moderator
    Master

    Yes, but it can already be done. MTF is not tied to v11.

    #103027 quote
    Vonasi
    Moderator
    Master

    An example of MTF being used to open 1 second before the close of the 1 hour candle. This can be used to avoid gaps between close and open.

    timeframe(1 hour)
    c1 = (your entry conditions)
    
    timeframe(1 second)
    if minute = 59 and currentsecond = 59 and c1 then
    buy 1 contract at market
    endif
    #103029 quote
    robertogozzi
    Moderator
    Master

    ck2016 was asking to enter when a daily candle closes, not 1 second earlier!

    #103030 quote
    Vonasi
    Moderator
    Master

    MTF is not tied to v11.

    Sorry Roberto – I missed the important point that you were commenting about v11!

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

Buy at open sell at close


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 11 replies,
has 5 voices, and was last updated by Vonasi
6 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/30/2018
Status: Active
Attachments: No files
Logo Logo
Loading...