This should be a simple question, but my brain has decided to go on vacation without me this week. What would be the way to detect if the user has created any notes for the current symbol? I'd like to store the result as a 1 (has notes) or a 0 (no notes) in the variable "HasNotes" to make an on-screen indicator (shown below). It would display a tiny blue box in the upper-right corner with the letter "N" if any notes exist for the current symbol:
So... I guess I know that the Notes function (Control-N) stores the user's notes in a Custom Database called "_notes". I'm just fuzzy on how I'd code a test to see if it is empty or not?
A total count in the upper-right *and* a set of vertical arrows to individually call out each day on-screen that has notes? Quite nice! I'd say that 95% solves what I'm looking for!
As it turns out, the remaining 5% of the problem represents an unexpected twist:
Some of my notes are coming to me from the future! :) They're in the database, but the functions are only counting past and present notes. Any thoughts on how to count any upcoming notes? (Or some other way to obtain the complete total of entries in the _notes database?)
// The total number of notes for the symbol
PrintChart(iffstr(total_notes, total_notes."N", ""), "", TopRight, colorWhite, colorWhite, colorBlue, 255*total_notes);
// The total number of notes on or prior to the day the cursor is over
//PrintChart(iffstr(total_notes, notes_prior."N", ""), "", TopRight, colorWhite, colorWhite, colorBlue, 255*total_notes);
// The total number of notes after the day the cursor is over
//PrintChart(iffstr(total_notes, notes_after."N", ""), "", TopRight, colorWhite, colorWhite, colorBlue, 255*total_notes);
<<<<
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.