Discussions
»
Product and Service Development
»
Formula Assistance
»
How to "LOAD" Adv & Dec data for a custom formula to use
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 5/6/2009(UTC) Posts: 9
|
I've a custom formula that looks at how many Advances and Declines there were on the NYSE each day. It keeps a cumulative count (a line plot) based on its rules concerning the relationship(s) between the qty of Adv's and Dec's every day.
Q: How does one "load" the Adv and Dec (I have) data in ordcer to create the line chart/plot of the formula? That is, I don't need a chart of Advances or Declines; only the result of the formula.
For ex, if there are two times more Advances on a day than Declines, that might be a plus 1 (+1). And vice versa. This cumulative count of the result of this rule eventually leads to a line being created, plotted.
The question is simply how doe one "access" this Adv, Dec data (which my Downloader has) in order to do this? Do you need to Open a Chart with both "securities" in it? How is that accomplished? Or no??
Any help would be appreciated!
Thanks.
|
|
|
|
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 EFHL
If you already have advance and decline data already stored as separate securities you can use the Security() function to call these values into a custom indicator and then code that indicator to generate the required plot. If you don't have version 8.1 or later (assuming you're using an EOD version) you would need to attack the problem a different way, but it could still be done.
Roy
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 5/6/2009(UTC) Posts: 9
|
Thanks for the reference to "Security()". Now that the indicator is built, I'm at a loss as to how to plot this. I'm referencing TWO securities {EOD, ver 10} and don't know how to load them both into a chart so I may plot the indicator. (Or is that necessary...I'd prefer to simply plot the indicator in a new, empty chart. Anyway...) An ex w/ stocks: this indicator Cumulatively looks at, say IBM and GOOG. "If IBM is > 100 and GOOG is <500, then +1 for today. If the opposite scenario exists, then -1. And if their prices are a blend of this, zero. Again, the indicator is built - thanks to your tip re the security() function. This is merely a hypothetical eg.
My ques is, how do I plot this? I'm not trying to make a composite security. Both IBM and GOOG in this example need to exist, separately, so their values can be looked at by the security() function. But where do I plot this? Plotting in in just IBM or GOOG doesn't yield the correct result... This is probably easy, but I'm lost. Any guidance would be appreciated!
|
|
|
|
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 EFHL
I’m a little lost as to how we moved from Advance and Decline securities to IBM and GOOG so forgive me if my comments or suggestions are totally irrelevant. A concept that maybe you haven’t grasped is that you can use the Security() function to call almost any security OR indicator plotted on that security into a custom indicator, exploration or expert. Here are a few examples of how you can call price arrays from specific securities, but notice that you can also call the results of MetaStock functions or custom formulas (indicators) as generated by those same securities (or completely different securities if that’s what you want).
{<New Indicator>}
S1:=Security("C:\Data\US\NASDAQ\G\GOOG",C);
S2:=Security("C:\Data \US\NYSE\I\IBM",C);
S3:=Security("C:\Data \US\NASDAQ\Advance",C);
S4:=Security("C:\Data \US\NASDAQ\Decline",C);
S5:=Security("C:\Data \US\NASDAQ\G\GOOG",Fml("Multi-Frame D ADX"));
S6:=Security("C:\Data \US\NASDAQ\G\GOOG",Fml("Trade Equity LE"));
S7:=Security("C:\Data \US\NYSE\I\IBM",Mov(MP(),10,E));
S8:=Security("C:\Data \US\NYSE\I\IBM",Fml("Kaufmans AMA"));
S3-S4; {other variables are examples only}
All I’m doing with the above indicator is defining a series of variables. With those definitions in place I can use S1-S8 to put together my own weird custom indicator using any or all of the data already collected. If all you wanted to do was plot a line that returned Advances – Declines the output would be as above, i.e. ….
S3-S4;
Once any data has been called by the Security() function you can treat is as you would any other price or data array. Where does this result get plotted? Again, drop your indicator onto any open chart and it will plot the same result regardless of the chart that’s active. You can also call Fml("<New Indicator>") into an exploration, an expert or another custom indicator (be careful with this last one as it’s easy to make a mistake and have nothing work as intended).
I guess what I’m trying to say is that the Security() function allows you a huge range of choices. Putting the possibilities into effect is not the difficult part – it’s getting your head around the many different ways that the function can be exploited.
Roy
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
How to "LOAD" Adv & Dec data for a custom formula to use
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.