Display custom info via tooltips placed at bar on bottom of PricePane
Author: streak
Creation Date: 8/27/2011 2:07 AM
profile picture

streak

#1
Having lots of supplementary info on various stocks such as name changes,
splits & reconstructions (these all have dates), I am trying to find a way
to plot this data on charts. Similarly, to help backtest backadjusted
contracts it would be very helpful to see where the rolls occur. My hopes
have been to 'plant' an icon (or something like a windows form control)
that I can attach the info to as a tooltip; depending which icon in the
collection the pointer would be over.

Are there any WealthLab/WealthScript features that would allow this?

I figure the bare essentials would be :-

- x/y coordinates for bar/bottom edge of PricePane.

- availability of a WealthLab 'cosmetic' chart item to hold and or display
the info (or similarly allow a windows forms type control to be
implemented).

I have tried seeing if FundamentalDataItems could in some way be used,
however, I have WLDev and could only download yahoo! data with associated
fundamentals that will plot via one of te demo scripts, but that's about as
much as I can see; no list of items seems available and mostly the
fundamentals toolbar button disappears. So I cannot see or find enough info
on how FundamentalItems works to see if it could be customised to be of any
use.

Any ideas or suggestions would be very welcome.

Thanks
jon
profile picture

Eugene

#2
Forget about icons: there is no native WealthScript 'cosmetic chart' method for displaying interactive tooltips. Chart drawing objects aside, fundamental data items sounds like the ideal way of displaying that supplementary information. For example, this is how one of the providers from Fidelity's fundamental suite displays the details of an insider transaction. You highlight an insider trade and a tooltip shows its details e.g. officer name. (This information is also accessible in WealthScript via GetDetail.) Naturally, this assumes that there's a backing source that returns these fundamental items i.e. a fundamental provider. I can't think of an easier way.

Not knowing the source of your rollovers/etc. but off the top of my head, the following came to mind. Next month there will be a big update on Extensions, including two new fundamental providers. The source code of a fundamental provider, responding to a customer's expressed request for a code sample, will be made open source. So for instance, if you find a way to store your supplementary data items in plain ASCII files, then you might want to review that new solution and replace the code that gets fundamental items from the internet, with a routine that reads them from disk - stored in a file like AAPL.CSV (one file per ticker).
profile picture

streak

#3

Thanks Eugene

This sounds promising. For interest, how is a Fundamental Data Item, such as the 'Insider Transaction' you spoke of, actually displayed on a chart? Would it be possible to see a .gif, please?

Yes, my data is in ascii (at least I have vb.net handling it ok as ascii - I get messed sometimes with unicode).

Only thing so far is that I have a number of logs handling the type of info (whether it be; splits, name changes from, name changes to, deferred data date ranges, etc) rather than a file for each security. Each security is listed alphabetically, only once per file. Considering this do you think it might be possible when using a local ascii file, instead of a remote "backing source", to use my existing ascii 'logs' instead of
QUOTE:
one file per ticker
. This concerns my, as it was an insane amount of work putting together my 'database', one which I hope I don't have to rehash.

Looking forward to seeing the fundamental provider code.
Thanks again.

btw: In QuikRef "GetDetail' I noticed "Splits and Dividends". Is there any more detail than "DPC" ?
profile picture

Cone

#4
QUOTE:
Would it be possible to see a .gif, please?
It's just a rounded rectangle icon with "IS" or "IB" in the middle. All the information is in the tooltip rollover, just like that displayed for prices or dividends. See Y! Splits and Dividends for examples.

Don't get hung up on the specified detailName strings shown for the GetDetail method. They apply only to the Fidelity Fundamental provider.
profile picture

Eugene

#5
QUOTE:
Considering this do you think it might be possible when using a local ascii file,

Yes it should be possible too. On second thought, one file or many files or even a database doesn't matter because it will be entirely up to you how to implement reading from the source.

It goes like this: fundamental provider is querying for a single fundamental item for a symbol, you'll replace the internet download logic with your file/database logic, get the raw text (e.g. a string[]) and pass it on further to the parsing routine, the provider saves the result in FundamentalDataStore (as .WLF files) from where Wealth-Lab is taking it. Of course no promise is being made for a plug-in replacement but it should feasible with some moderate effort.
QUOTE:
They apply only to the Fidelity Fundamental provider.

Like Cone says, each fundamental provider can define its own fundamental item details if required.
profile picture

streak

#6

Thanks Robert, Thanks Eugene

Looks like there will be a solution. I appreciate the insight into how the fundamental items work.

However, am I understanding things correctly in that WLD duplicates the data as it is charted? If so, I'm not too clear on why it would do this, and what the purpose of the duplication would be for ie does a script first draw on local data before looking abroad if not found?

Robert, I'm still trying to see an example of the tooltip. Checked WLD User Guide and found Eugene's script: /Forum/Posts/Display-custom-info-via-tooltips-placed-at-bar-on-bottom-of-PricePane-31983 When I run this with '5d' changed to '10d' and the Yahoo! string 'item' exposed, the log returns (for example); "ADSK has split in the past 5 years (on 21-Dec-04 )", but when I check the chart I cannot find anything to associate a tooltip with. On the Yahoo! tab I have "Perform Split Adjustment" checked with the radio button "Keep..." selected. Sorry, but what am I missing?

Thanks
jon
profile picture

Cone

#7
You choose which items are displayed in the chart in Preferences (F12) > Chart Annotations
profile picture

streak

#8

My apologies, its also mentioned in the User Guide!
profile picture

Eugene

#9
Jon,

Check out this open source fundamental provider:

Analyst Ratings provider from MS123 Extra Fundamental providers

Hope this helps.
profile picture

streak

#10
Hi Eugene

yes, a quasi fundamental provider like this should fulfill what I've envisioned. For my needs the rollover 'marker' (icon symbol or similar) doesn't need to be around the price data - at the bottom of the pane would have been ok. But who am I to argue esp over semantics). The tool tips will help analyse the data visually while writing scripts and the info can be checked in code.

Looking forward to learning more and seeing the "two new fundamental providers" you mentioned.

In the mean time I should learn about IList<> (have only dealt with arrays, some VB collections & sql datasets etc before).

Appreciate your help and follow through.
Thanks
profile picture

Eugene

#11
Hi Jon,
QUOTE:
For my needs the rollover 'marker' (icon symbol or similar) doesn't need to be around the price data - at the bottom of the pane would have been ok.

The marker (fundamental item) is always placed around the price data by Wealth-Lab itself, providing no control to the developer.
QUOTE:
Looking forward to learning more and seeing the "two new fundamental providers" you mentioned.

Both are parts of the new "Extra Fundamental providers library": Analyst Ratings is open source, Insider Transaction is not, and both gets installed in one shot.
profile picture

streak

#12

Hi Eugene

Spent much time studying the Yellow Book, and trying to work out the Analyst Ratings Demo.

Have copied and altered a 'Demo' that will hopefully work!

Before 'building' and attempting to run it would you be able to check my code please? I'm concerned that, if coded incorrectly, I could jeopardize something else in Wealth-Lab, particularly in relation to the [assembly: ] info on the .cs page.

If your able to have a look, is it best I post the code here, or send the whole solution-file via a support ticket or similar?

Also, in the Demo's ParseSingleItem() method, there is a string var "line" which is passed into an exception message but not assigned after it's been initiated (as far as I can tell)?

Thanks
profile picture

Eugene

#13
Sorry Jon but our support policy does not cover supervising and troubleshooting custom coding solutions.

Don't worry, even a malfunctioning data provider won't break Wealth-Lab beyond repair, and our General troubleshooting procedure is always at your service when Wealth-Lab crashes on start.

Re: ParseSingleItem() - the string variable line is used when catching exceptions caused by unexpected data (garbage) and printing the output to a debug window.
profile picture

streak

#14

The 'assembly' info on the demo's .cs page said something like "min version 6.2".

Is there any chance a derived version from the demo would work with WLD version 6.1 ?

If not, what is the likelihood of the current open issue: (26535) GetExternalSymbol Named DataSeries bug getting fixed anytime soon?

Also like to recommend an enhancement: A non bar/time related info icon (with overrideable text data / tooltip, such as a string of previous Co./symbol changes) that might reside in a fixed place in the chart window (always visible - unaffected by scrolling), and databased the same or similarly to fundamental items providers.

Also another enhancement: Make an option for the existing fundamental icons to be placed at the bottom(or top) of the chart pane, rather than congesting price (again; always visible & unaffected by scrolling).
profile picture

Eugene

#15
QUOTE:
Is there any chance a derived version from the demo would work with WLD version 6.1 ?

Good news: it will work. As dictated by the ExtensionInfo attribute the assembly would not install itself in WL version 6.1 and lower, if being put on our server. The fundamental provider is expected it to work with v6.1 w/ no issues though.

The source of your misconception re: ExtensionInfo was this document...

Preparing an Extension for publishing

...which explains the procedure of integrating an extension with our website (Extensions section) and the Extension Manager.
profile picture

streak

#16

Thanks

Had seen the document, and had recognised that that info was probably being directed toward the Ext Manager. However, I had wondered if there was some other reason in the parent (Fundamental) class.

Is there some place that upgrade suggestions should be placed (have looked, but didn't find any page similar to what was in place for WLD4)?
profile picture

Eugene

#17
Sorry but there's no feature suggestions page for WL6.

We collect them and if some suggestion has enough "bang for the buck", we may look into implementing it as an extension or pass it on to Fidelity depending on circumstances.
profile picture

streak

#18

While having made individual .bmp icons to associate with my various fundamental item values (which plot ok), I have not been able to ascertain exactly where & how WLD is associating to its icons for the main menus :-
- Fundamental Data 'drag & drop' list/tree, and also
- Preferences Chart Annotations Available/Selected Items.

The only association I can guess at (noticed from my coded output) is that these menu item icons are linked to the Fundamental Item base.Value equaling 0. Is this correct? (which seems a strange concept if it is?)

Different though is Data Manager's Update Data list, which seems to be the only caller to :-
'public override System.Drawing.Bitmap Glyph' 's return object. Is this correct?
profile picture

Eugene

#19
Fundamental item bitmaps are stored in the solution's resources. When the provider inherits from the FundamentalItem class, the Glyph property is overridden and here the bitmap associated with the chart plots and Preferences is returned.

The provider's icon in the Data Manager is associated with the FundamentalDataProvider.Glyph property.
profile picture

streak

#20

QUOTE:
... and Preferences is returned.

Does Preferences return the option from a base.Value == 0 selection?

ie this is what appears to be happening from the following property override (capRetu3.bmp is returned to the Fundamental Data 'drag & drop' list/tree, and also Preferences Chart Annotations Available/Selected Items), when from what you have just posted one might expect the err3.bmp to be returned;

CODE:
Please log in to see this code.


this is capRetu3.bmp :-
[IMG]

Uploaded with ImageShack.us[/IMG]
profile picture

Eugene

#21
The fund.item bitmap on the chart whose code you've just shown (FundamentalItem.Glyph) can be context-sensitive. The code above is expected to return the proper icon depending on the fundamental item's value.

The icon on the Fundamentals list and in Data Manager can't change depending on some particular fund.item's value. As told above, it's the FundamentalDataProvider.Glyph property.
profile picture

streak

#22

QUOTE:
The fund.item bitmap on the chart whose code you've just shown (FundamentalItem.Glyph) can be context-sensitive. The code above is expected to return the proper icon depending on the fundamental item's value.

Yes, and thats working on the chart exactly how I've coded.

QUOTE:
As told above, it's the FundamentalDataProvider.Glyph property

The .bmp I have coded in FundamentalDataProvider.Glyph property is asx.bmp which is being displayed in the Update Data tab ..
[IMG]

Uploaded with ImageShack.us[/IMG]

I have searched for capRetu3 and the only 'find' is in the override Glyph property as coded above, yet it is being displayed in the Fundamentals list and in Data Manager?
profile picture

Eugene

#23
Perhaps you might want to perform a better full-text search. Clearly, it's your code.
profile picture

streak

#24

A search through the 'current document' ("full-text"?) reveals capRetu3 in Resources.resx & Resources.Designer.cs

I cannot see what there is to be learned here other than capRetu3 returns a .bmp of the same name.

So, my only option has been to go back to my earlier comment;
QUOTE:
The only association I can guess at (noticed from my coded output) is that these menu item icons are linked to the Fundamental Item base.Value equaling 0.
... and code for FundamentalItems.Value == 0 to return the icon wanted for display in :-
- the Fundamental Data 'drag & drop' list/tree
and in
- the Preferences - Chart Annotations - Available/Selected Items.

And this works (for the right or wrong reason?); The icon .bmp depicting 'err' is referenced from FundamentalItems.Value == 0 as follows;
[IMG]

Here the code (from above);
CODE:
Please log in to see this code.
was changed to
CODE:
Please log in to see this code.

profile picture

Eugene

#25
Well, I stand corrected. Did a couple of quick tests and you're right: the glyph to be displayed on the Fundamentals list is taken from the FundamentalItem.Glyph property and is linked to the base.Value == 0. Thanks.
profile picture

streak

#26

ok Thanks for following through. In hurry to go out. Have another qu latter
profile picture

streak

#27

When extending the updating to another database no items are created although a blank database is created during the update.

The db in qu has the string "u_" prefixed to all symbols. This db contains unsplit data but otherwise is identical to the split db for which the fundamental updating works fine.

Is there an issue with the prefix?
profile picture

Eugene

#28
Use debugger to step through your code to determine what happens inside.
profile picture

streak

#29

Haven't used the VS C# Express debugger while coding these Providers.

Modified the sample code for the ...csproj.user on http://www2.wealth-lab.com/WL5WIKI/kbDebugExpress.ashx with local path. Saved & built project.

But get this on F5

[IMG]

Should this type of project/class debug as per the advice given?
profile picture

Eugene

#30
Overwrite your file with the sample code, adjust as necessary.
profile picture

streak

#31

ok, guess that's what I've just done.
profile picture

Eugene

#32
All open source provider solutions (fundamental included) come pre-configured for hitting F5 and starting WLD6. There really no need to change anything except for WealthLabDev.exe location - if its installation folder is different from the default location.

So, close solution and double check your edits to ...csproj.user aren't gone (if you made them with VS open), reopen the solution, make sure that Debug configuration is selected (so you're not trying to run a Release configuration).
profile picture

streak

#33

Taken me ages to find the configuration manager. After opening the demo provider I realised why; the configuration manager in my project is hidden / or has disappeared.

On the demo's project page, debug tab, at the top 'configuration' is selectable via a dropdown as is 'platform'. This is similarly available from the 'solution' properties.

Neither is available in my solution. I put the original csproj.user code back. But no change! Looked at many setting but cannot see why.
profile picture

Eugene

#34
Jeez, should I claim a check from Microsoft for supporting you with Visual Studio? :)

Step 1. Options > Show all settings
Step 2. Options > Projects and solutions > Show advanced build configurations
profile picture

streak

#35

wow that little checkbox down below aye. And one wonders how it became unchecked etc et..

Anyway, life in the debugging lane (as slow as debugging was going - like resources at 199%) showed, yes, a stupid mistake of mine; filled the dictionary keys without the prefix !!

... for another day.


Thanks Eugene. If I find any spare cheques kicking around....
profile picture

Eugene

#36
QUOTE:
And one wonders how it became unchecked etc et..

I'd say almost everyone wonders. :)

I love simplification but this one leaves a big question why did they decide (was it during VS2008 times?) to hide one of the most accessed settings beyond f****g Egypt. Even though it's a set-and-forget option, it didn't desire to be hidden so deeply.
profile picture

istock888

#37
Hello Eugene,

Do we have open source code for tool tip implementation on a custom item on chart? Like Yahoo fundamental item?
profile picture

Eugene

#38
If you mean exactly what you said (i.e. the implementation of fundamental tooltips), then check out this page: Home - MS123 Providers for demo version of a fundamental provider. Look for:
CODE:
Please log in to see this code.

But don't confuse it with extending Wealth-Lab's tool tip itself that appears when mousing over an indicator value or OHLC. You cannot customize that, and it's closed source.