Rank: Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/31/2009(UTC) Posts: 18 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
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: kkrishna79 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)
|
1 user thanked MS Support for this useful post.
|
|
|
Rank: Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/31/2009(UTC) Posts: 18 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;
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/31/2009(UTC) Posts: 18 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 |
Guest (Hidden)
|
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.