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

Error

 Previous Topic Next Topic
 kkrishna79 #1 Posted : Wednesday, February 12, 2020 11:09:00 AM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 1/31/2009(UTC)Posts: 10Location: MumbaiThanks: 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 allKrishna
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 MS Support #2 Posted : Thursday, February 13, 2020 9:28:55 PM(UTC) Rank: Advanced MemberGroups: Moderators, Registered, Registered Users, SubscribersJoined: 10/8/2010(UTC)Posts: 1,609Thanks: 51 timesWas thanked: 130 time(s) in 126 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 allKrishna 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. kkrishna79 on 2/14/2020(UTC)
 kkrishna79 #3 Posted : Monday, February 17, 2020 6:19:03 AM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 1/31/2009(UTC)Posts: 10Location: MumbaiThanks: 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) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 1/31/2009(UTC)Posts: 10Location: MumbaiThanks: 2 times DATE         CLOSE        AVERAGE24/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.