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
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
@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?