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 : Wednesday, February 12, 2020 11:09:00 AM(UTC)
kkrishna79

Rank: Member

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

Thanks: 2 times

Hello All,

I am looking for moving average start from a specific date till the current date and moving average should be calculate on the number of bar in this specific date.

For eg MOV(C, 1/02/2020 TILL 12/02/2020,S);  {BUT ONLY THE TRADING DATE)

Kindly help.

Thankyou all

Krishna

MS Support  
#2 Posted : Thursday, February 13, 2020 9:28:55 PM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)
Originally Posted by: kkrishna79 Go to Quoted Post

Hello All,

I am looking for moving average start from a specific date till the current date and moving average should be calculate on the number of bar in this specific date.

For eg MOV(C, 1/02/2020 TILL 12/02/2020,S);  {BUT ONLY THE TRADING DATE)

Kindly help.

Thankyou all

Krishna

Hello,

You could try the following to see if it is what you are looking for. You can edit the Month, DayOfMonth, and Year values to whatever you like but it must be a valid trading date or it will not plot.

Code:
x1:=Month()=11 AND DayOfMonth()=9 AND Year()=2010;
x2:=ValueWhen(1,x1,Cum(1));
y:=LastValue(Cum(1)-x2);

If(Cum(1)>=x2,Mov(C,y,S),0)

thanks 1 user thanked MS Support for this useful post.
kkrishna79 on 2/14/2020(UTC)
kkrishna79  
#3 Posted : Monday, February 17, 2020 6:19:03 AM(UTC)
kkrishna79

Rank: Member

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

Thanks: 2 times

Sir ,

The code given by you is working as per on the date but the average should be like average of close of last 3 days or number of count of day from the start date.

Kindly help;

kkrishna79  
#4 Posted : Monday, February 17, 2020 6:31:26 AM(UTC)
kkrishna79

Rank: Member

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

Thanks: 2 times

DATE         CLOSE        AVERAGE

24/1/20       1316.10                      0          { START DATE}

27/1/20       1271.2           1293.65            {(1316.10 + 1271.2) / 2}

28/01/20     1254.75         1280.68            { (1316.10+1271.2+1254.75) / 3)}

Edited by user Monday, February 17, 2020 6:42:54 AM(UTC)  | Reason: Not specified

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.