Determining day of the week

Post Reply
Rio

Determining day of the week

Post by Rio »

What is the way to determine what day of the week it is?

I'm trying to avoid trading on the first Friday of the month (NFP whipsaw stop hits and the like)
I have a TimeCurrent value to play with, and I think there is a command that can suck out the day of the week information from it. I suppose all that's needed after that is if the day is Friday and the date is less or equal to the 7th ;)
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Determining day of the week

Post by milanese »

Rio » Mon May 26, 2014 3:24 am wrote:What is the way to determine what day of the week it is?

I'm trying to avoid trading on the first Friday of the month (NFP whipsaw stop hits and the like)
I have a TimeCurrent value to play with, and I think there is a command that can suck out the day of the week information from it. I suppose all that's needed after that is if the day is Friday and the date is less or equal to the 7th ;)
You need

Code: Select all

if(DayOfWeek()==5 && Day()<=7)
 
{
 
 
}


Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Determining day of the week

Post by dudest »

if ( TimeDayOfWeek( TimeCurrent() ) == 5 ) // Check whether it is Friday
Post Reply

Return to “Coders Hangout”