Discussions
»
Product and Service Development
»
Formula Assistance
»
Difference between Today's Open & Yesterday's Close
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/6/2009(UTC) Posts: 36 Location: Los Angeles
Thanks: 4 times
|
I have a formula that finds the difference between today's open and yesterday's close.
What I want to do is sum up the total difference for the whole week. For example, for the week below, the total sum of Mon-Fri's difference (from yesterday's open and today's close) is $0.20. How can I write a formula which will provide this information?
Day
Yesterday's Close
Today's Open
Difference
Mon
1.00
1.10
0.10
Tue
1.05
1.20
0.15
Wed
1.00
0.90
-0.10
Thu
0.85
0.85
0.00
Fri
0.90
0.95
0.05
---
Weekly total
--------->
0.20
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Mark
Is this the sort of thing you're looking for as an indicator?
Day:=DayOfWeek();
WkEnd:=Day<Ref(Day,-1);
Diff:=OPEN-Ref(CLOSE,-1);
Bars:=BarsSince(WkEnd)+1;
DailyResult:=ExtFml("Forum.Sum",Diff,Bars);
WeeklyResult:=ValueWhen(1,Day=5,DailyResult);
DailyResult;
WeeklyResult;
I think this does what you've requested but I might have gotten it wrong.
Roy
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/6/2009(UTC) Posts: 36 Location: Los Angeles
Thanks: 4 times
|
Hi,
I get this error when I try:
This DLL does not exist in the MSX DLL folder.
Note that I looked at this error in the forum. Other people say to download this dll: ForumDll_200 , but I cannot find it anywhere.
Edited by user Thursday, August 11, 2016 3:44:21 PM(UTC)
| Reason: Not specified
|
|
|
|
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)
|
Should hopefully be able to click the link in this post to download: http://forum.metastock.c.../ForumDll-200#post148053
The DLL will need to be placed in the "External Function DLLs" folder. This can be in different locations depending on your version of MetaStock. Edited by user Thursday, August 11, 2016 3:55:37 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Mark
The Forum DLL can also be donloaded from
www.metastocktips.co.nz/Forum.dll
if you can't find it elsewhere. The name for the DLL on this site (MetaStock Online Community) is different from that used in the formula I posted. However It is the same DLL, just with a shorter name. This DLL is 188KB in size and must not be confused with the first version which is smaller, has fewer functions, and has different names for those functions.
Be sure to restart MetaStock once you've copied the DLL to the appropriate folder - the DLL will not be recognised until MetaStock has been restarted
Roy
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/6/2009(UTC) Posts: 36 Location: Los Angeles
Thanks: 4 times
|
I am getting the same error.
I copied the file, "Forum20.dll" to the folder C:\Program Files (x86)\Thomson Reuters\Eikon\Program\External Function DLLs.
I restarted Metastock (I use version 13.0.1701 EOD), and even rebooted my computer (using Windows 10).
But I still get the same error: "This DLL does not exist in the MSX DLL folder".
The dll is still named "Forum20.dll". Does that matter? In the formula you gave me, it's something like Forum.sum.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/6/2009(UTC) Posts: 36 Location: Los Angeles
Thanks: 4 times
|
Thank you. It is working.
While I need Monday through Friday summed up, it is possible to show ONLY the sum? For example, could there be a "Saturday" that shows the sum of the prior Monday through Friday (but without showing every weekday?)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Mark
The indicator I created has two outputs, one being the daily value and the other being the weekly summary value. All you need to do to plot just the weekly summary value is to remove (or comment out) the second to last line (daily difference). If you're not familiar with the term "commenting out" it simply means that you can place braces {} around the unwanted active code and MetaStock will then regard the code inside any pair of braces as being just a comment. If you erase a section of code deliberately there's a good possibility that you'll forget the exact code and therefore not be able to reinstate it. Commenting out with braces is a good way to disable or enable code without later having to try and recreate it from memory or some scrap of paper that cannot be found.
Roy
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Difference between Today's Open & Yesterday's Close
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.