STOP SYSTEM

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

    I do not want automated trades to stay open over weekends.

    I know how to quit system with specified time and date, but then I have to adjust it weekly. This is not a problem, but it is then not possible to back test for longer than a week.

     

    Any ideas to stop system specified time on Friday, restart automatically on Monday?

     

    Thank you

    #69010 quote
    Pierre
    Moderator
    Average

    Hi,

    Instead of using a fixed date, you can use the CurrentDayOfWeek.

    //For Monday
    CurrentDayOfWeek = 1
    //For Friday
    CurrentDayOfWeek = 5

    To learn more : https://www.prorealcode.com/documentation/category/dateandtime/

    Regards,

    Pierre

    #69201 quote
    juanj
    Participant
    Master

    @Pierre do you know why we do not have a ‘currentday’ function in PRT?

    But we have a ‘day’ function?

    I have oftentimes needed to use something like:

    If day = currenday Then…

    Instead I now have to try and work around it by using:

    If month = currentmonth and dayofweek = currentdayofweek Then…

    But this is much less ideal than simply having a currentday function.

    We already have currentyear, currentmonth, currentdayofweek, currenthour, currentminute so why not currentday?

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

STOP SYSTEM


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
steynpj @steynpj Participant
Summary

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

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