Sell on next bar

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #101903 quote
    Dr ManhattanDr Manhattan
    Participant
    Senior

    Hi, how can I sell on the close of this bar or on the opening of the next, preferably on the close.

    #101908 quote
    VonasiVonasi
    Moderator
    Master

    It is impossible to sell at the close of a bar as all orders (except pending ones) are carried out at the next bars open.

    You could use MTF to create a simulated candle so as to trade at a time that is very close to say the 1 hour bars close by trading at the 59 minutes and 58 seconds bar which would mean that your trade opens just 1 second before the 1 hour bar closes. There is not much benefit to this though unless the instrument that you are trading has large gaps in price from close to open.

    Dr Manhattan thanked this post
    #101911 quote
    Dr ManhattanDr Manhattan
    Participant
    Senior

    Thanks, I understand, do you know how to sell at the open of the next bar in code?

    #101914 quote
    VonasiVonasi
    Moderator
    Master

    If you are on the market then any SELL (for long) or EXITSHORT (for short) instruction will close positions at the open of the next bar.

    Dr Manhattan thanked this post
    #101934 quote
    Dr ManhattanDr Manhattan
    Participant
    Senior

    Ok, sorry for asking such fundamental questions. Just double checking, if I issue a SELL or EXITSHORT on the Monday of a weekly bar there will be a SELL/EXITSHORT in 7 days?

    #101943 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You simply cannot sell on a Monday, because you can only place entry/exit orders at market when a bar closes.

    So if you SELL/EXITSHORT when the weekly bar closes, it will be executed when the next one opens.

Viewing 6 posts - 1 through 6 (of 6 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

Sell on next bar


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
7 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/03/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...