logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
GuadalupeSullivan  
#1 Posted : Friday, March 27, 2020 5:46:15 AM(UTC)
GuadalupeSullivan

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/20/2019(UTC)
Posts: 1
Location: Illinois

I'd like to write a system that buys stock on the business day prior to 12/25 (Christmas).  I know how to use DayofMonth() and Month() functions but I can't figure out how to set it to buy business day before a specific date. Any help would be much appreciated.

MS Support  
#2 Posted : Friday, March 27, 2020 7:10:17 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,621

Thanks: 51 times
Was thanked: 130 time(s) in 126 post(s)
Originally Posted by: GuadalupeSullivan Go to Quoted Post

I'd like to write a system that buys stock on the business day prior to 12/25 (Christmas).  I know how to use DayofMonth() and Month() functions but I can't figure out how to set it to buy business day before a specific date. Any help would be much appreciated.

Hi,

You could try the following formula to see if it helps:

Code:
dom:= DayOfMonth();
dow:= DayOfWeek();
Month() = 12 AND
(dom= 24 OR (dom = 23 AND dow>=4) OR (dom = 22 AND dow=5))

Users browsing this topic
Similar Topics
How to set Buy Date for Day Prior (Formula Assistance)
by scocci357 12/5/2014 9:12:24 PM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.