Time-based sell order for a specific day

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #197687 quote
    funkytown
    Participant
    New

    I would like to place a sell order for a specific trading day, it should be a time-based sell order at the end of the trade. The background is a simple seasonal strategy.

    The order is to be combined with a stop loss and take profit, i.e. the order will be closed beforehand when the price levels are touched.

    What is the best way to proceed?

    #197695 quote
    robertogozzi
    Moderator
    Master

    You wrote “it should be a time-based sell order at the end of the trade” but you probably meant “it should be a time-based sell order to end the trade“, didn’t you?

    This is the code (as to my interpretation):

    IF OpenDayOfTheWeek = 4 AND Time = 170000 THEN //close at 17:00 on Thursday
       SELL....
       //or SELLSHORT...
    ENDIF

    You may remove the TIME condition if you don’t need or if you are using a Daily TF or any TF whose bar doesn’t close at THAT time.

    0=Sun, 1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri (6=Sat for instruments that can be traded on Saturday).

    #197697 quote
    robertogozzi
    Moderator
    Master
    • Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
      .
    • Post your topic in the correct forum:
      _ ProRealTime Platform Support: only platform related issues.
      _ ProOrder: only strategy topics.
      _ ProBuilder: only indicator topics.
      _ ProScreener: only screener topics
      _ General Discussion: any other topics.
      _ Welcome New Members: for new forum members to introduce themselves.

    The double post I deleted was in a wrong support forum.

    Thank you 🙂

    #197699 quote
    funkytown
    Participant
    New

    You wrote “it should be a time-based sell order at the end of the trade” but you probably meant “it should be a time-based sell order to end the trade“, didn’t you?

    Sorry, no. I meant a market-on-close order.

    #197706 quote
    robertogozzi
    Moderator
    Master

    Actually CFDs do not close, so there’s no closing time.

    If you know the time an instrument closes, then you have to write that time as I did above.

    Another way is to close a trade at the end of the daily candle, but on Fridays the actual exit will be executed when the next week opens.

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

Time-based sell order for a specific day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
funkytown @funkytown Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by robertogozzi
3 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/22/2022
Status: Active
Attachments: No files
Logo Logo
Loading...