Day Of the Week coding  [SOLVED]

Questions about MultiCharts and user contributed studies.
filippo.milano
Posts: 44
Joined: 02 Jan 2015
Has thanked: 1 time

Day Of the Week coding  [SOLVED]

Postby filippo.milano » 29 Sep 2016

Hi everybody,
someone could help me?
I just want to run a robot on monday...
do you know how to code it?
i tried coding:

Code: Select all

if dayfromdatetime = monday then ...
if dayofweek = monday then...
if dayofweekfromdatetime = monday then...
but there are all not working

thanks a lot in advance

Filippo

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Day Of the Week coding

Postby TJ » 29 Sep 2016

Hi everybody,
someone could help me?
I just want to run a robot on monday...
do you know how to code it?
i tried coding:

Code: Select all

if dayfromdatetime = monday then ...
if dayofweek = monday then...
if dayofweekfromdatetime = monday then...
but there are all not working

thanks a lot in advance

Filippo

Go to wiki,

look under
PowerLanguage Keyword Reference

look under
Date and Time Routines‎ (53)

look up the keyword
DayOfWeek

You will find definitions and usage examples.

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Day Of the Week coding

Postby tony » 29 Sep 2016

Use the following with 1=Monday, 2=Tuesday, etc.

Code: Select all

IF DayOfWeek(Date) = 1 // for Monday


Return to “MultiCharts”