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

Notification

Icon
Error

Options
Go to last post Go to first unread
kkrishna79  
#1 Posted : Thursday, January 14, 2021 9:06:07 PM(UTC)
kkrishna79

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/31/2009(UTC)
Posts: 16
Location: Mumbai

Thanks: 2 times

Hello everybody,

I am looking to make a pivot point for the whole year based on following formula

1. DATA should be from 1st Jan 2021 to 14th Jan 2021 / 15 Jan 2021(If i can select the date option)

2. OPEN should be of 1st Jan or 2nd Jan which ever the data is available (i coded below, it work)

3. CLOSE should be of 14th Jan 2021 / 15th jan 2021 (i coded below, it work)

4. HIGH should be Highest High from 1st Jan 2021 to 14th Jan 2021 / 15th JAN 2021 (incase 14 is holiday) {want solution for this}

5.  Low should be Lowest Low from 1st Jan 2021 to 14th Jan 2021 / 15th JAN 2021 (incase 14 is holiday) {want solution for this}

I am able to get the OPEN AND CLOSE as mention below:-

==============================================

Day1:= Input("Day",1,31,1); Month1:= Input("Month",1,12,1); Year1:= Input("Year",1900,2400,2021);

Day2:= Input("DayC",1,31,1); Month2:= Input("MonthC",1,12,1); Year2:= Input("YearC",1900,2400,2021);

OO:=ValueWhen(1,DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1, OPEN); OO;

CC:=ValueWhen(1,DayOfMonth() = Day2 AND Month() = Month2 AND Year() = Year2, CLOSE); CC; ===================================================

The problem is I am not able to design the coding for HIGHEST HIGH & LOWEST LOW from 1st Jan 2021 to 14th Jan / 15th Jan 2021 ( incase 14th is holiday)

the output should be

(OPEN + HIGHEST HIGH + LOWEST LOW+CLOSE)  / 4

(open = 1st trading date of month, close is 14/15th Jan2021)

I want first 14 day of the January data to used for next 6 month {jan to june}, than used first 14 day of July data to used for next 6 month (july to dec)

Hope someone can help me to get this coded out.

Thankyou,

Krishna

kkrishna79  
#2 Posted : Tuesday, January 19, 2021 9:07:29 PM(UTC)
kkrishna79

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/31/2009(UTC)
Posts: 16
Location: Mumbai

Thanks: 2 times
I search in forum and got few solution already solve by experts like wrabbit. thank you sir Day1:= Input("Day",1,31,1); Month1:= Input("Month",1,12,1); Year1:= Input("Year",1900,2400,2021); Day2:= Input("DayC",1,31,14); Month2:= Input("MonthC",1,12,1); Year2:= Input("YearC",1900,2400,2021); startdate:=DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1; enddate:=DayOfMonth() = Day2 AND Month() = Month2 AND Year() = Year2; KKOPEN:=ValueWhen(1,DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1, OPEN); KKHIGH:=ValueWhen(1,enddate,HighestSince(1,startdate,HIGH)); KKLOW:=ValueWhen(1,enddate,LowestSince(1,startdate,LOW)); KKCLOSE:=ValueWhen(1,DayOfMonth() = Day2 AND Month() = Month2 AND Year() = Year2, CLOSE); KKOPEN; KKHIGH; KKLOW; KKCLOSE;
Users browsing this topic
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.