Fund Manager
PORTFOLIO MANAGEMENT SOFTWARE
Contact Us

Trendlines with currencies

Questions on using, creating, or understanding data in Fund Manager graphs.

Postby Djobydjoba » Sun Oct 29, 2023 3:40 am

Hi Mark,

Sorry, quite a long post again...

I'm still not happy with the way trendlines are implemented with currencies and currency templates.

To explain again my problem with the current implementation (summary of our past discussion above):

- I track many investments in FM and of course they can have different native currencies.
- I have set up the currency settings to be able to convert each of these native currencies to my default currency (which is €) with the "Exchange Rate Adjusted" button. This setup is saved as the EUR Template
- I have created too an USD Template to be able to convert each of the native currencies to another default currency which is $, because $ is the international reference currency, and I find very useful to analyze graphs in this reference currency too (an outstanding feature of the program btw)

Here are my currency settings for the EUR Template and the USD Template. Nothing special, standard way to set things I think.

EUR Template.png
EUR Template.png (31.1 KiB) Viewed 3326 times

USD Template.png
USD Template.png (30.83 KiB) Viewed 3326 times


You can see I use 3 letter codes for the investment's native currencies, and the symbols € and $ for the default currencies. This way I find it easier to see in the program:
1) if the investments have a native currency assigned or the default currency assigned (the last when their prices must not be adjusted with the "Exchange Rate Adjusted" command)
2) when "Exchange Rate Adjusted" is on or off


So, for market analysis, I very often switch between "Exchange Rate Adjusted" on and off and between the EUR and USD templates. So there are 4 situations where I draw trendlines:
1) "Exchange Rate Adjusted" on in EUR Template
2) "Exchange Rate Adjusted" off in EUR Template
3) "Exchange Rate Adjusted" on in USD Template
4) "Exchange Rate Adjusted" off in USD Template

What I would want is to draw trendlines without having to think of the current situation and that the trendlines to be displayed in all and only situations where it is relevant.
For example:
- in the situation 4 above, I draw a trendline on an investment whose native currency is EUR. So this trendline should appear too in the situations 1 and 2.
- in the situation 3 above, I draw a trendline on an investment whose native currency is EUR. So this trendline should NOT appear in all the other situations.


Here are examples of the problems with the current implementation, for an investment whose native currency is EUR:
1) "Exchange Rate Adjusted" on in EUR Template: the initial situation where the trendline is drawn / created (image1)
2) "Exchange Rate Adjusted" off in EUR Template: the trendline is not displayed, but it should be because it is relevant here too (image2)
3) "Exchange Rate Adjusted" on in USD Template: the trendline is displayed but it should not be, as it is not relevant when the investment is converted to $ currency (image3)
4) "Exchange Rate Adjusted" off in USD Template: the trendline is not displayed, but it should be because it is relevant here too (image4)


You had explained perfectly well above in this post the current behavior, why it behaves this way.

And you had suggested a workaround:
I think you can get what you want by just drawing trendlines with "Exchange Rate Adjusted" in the OFF position. Your trendlines will only be displayed when "Exchange Rate Adjusted" is OFF, no matter what template you load.


but this solution doesn't suit me as it lacks too much fluidity.

For what it's worth (and for the fun, because I like to think about those things :) ), I have thought of a modified implementation, certainly with flaws too and improvable, but I think better than the current. I hope you will find it useful to rethink the implementation.

First, a table that summarize the various situations:

Table_Trendlines_currencies.png
Table_Trendlines_currencies.png (32.73 KiB) Viewed 3326 times


And, below pseudocode on how things could work, roughly (I am not a coder so be forgiving)

Code: Select all
--------------------------------------------
At the trendline creation (when it is drawn)
--------------------------------------------

If (The investment's currency is the default currency (of any template))
{
   Do nothing special
}
Else If (The investment's currency is a native currency)
{
   If ('Exchange Rate Adjusted' is not activated) Or If ('Exchange Rate Adjusted' is activated AND the investment's native currency has an 'Exchange Rate to default' set to 'Constant ratio = 1' in the currently loaded currency template)
   {
      Add to the trendline an internal tag "Drawn_In_Native_Currency"
   }
   Else If ('Exchange Rate Adjusted' is activated AND the investment's native currency has NOT an 'Exchange Rate to default' set to "Constant ratio = 1" in the currently loaded currency template)
   {
      Add to the trendline an internal tag "Drawn_In_CurrencyTemplate_Name_Id" (so with the info about the currently loaded currency template)
   }
}


Code: Select all
---------------------------
When to display a trendline
---------------------------

If (The investment's currency is the default currency (of any template))
{
   Display the trendline in all situations (as it is now)
}
Else If Exists (The "Drawn_In_Native_Currency" internal tag attached to the trendline)
{
   If ('Exchange Rate Adjusted' is not activated)
   {
      Display the trendline
   }
   Else If ('Exchange Rate Adjusted' is activated AND the investment's native currency has an 'Exchange Rate to default' set to "Constant ratio = 1" in the currently loaded currency template)
   {
      Display the trendline
   }
}
Else If Exists (The "Drawn_In_CurrencyTemplate_Name_Id" attached to the trendline)
{
   If (The currency template referenced in the tag is currently loaded)
   {
      If ('Exchange Rate Adjusted' is activated)
      {
         Display the trendline
      }
   }
}


Thank you for considering these improvements.
Djobydjoba
 
Posts: 795
Joined: Tue Mar 09, 2010 9:39 am

Postby Mark » Sun Oct 29, 2023 2:29 pm

Hi Djobydjoba,

Thanks for sharing your usage and needs in this area (and solutions). I haven't looked at this in a while. Let me see if I recall the issue. I believe the essence of the problem is depending on the currency template and option state for view exchange rate adjusted you can have different currency symbols/positions remembered for your trendlines, and your ultimate goal is to draw trendlines on graphs if the trendline was drawn in the currently displayed currency, and not drawn if the graph is displayed in another currency? One complication being sometimes it is EUR, and sometimes it is €, even though there is a constant ratio of 1 between the two currencies. Is this the problem?
Thanks,
Mark
Fund Manager - Portfolio Management Software
Mark
Site Admin
 
Posts: 11610
Joined: Thu Oct 25, 2007 2:24 pm
Location: Chandler, AZ

Postby Djobydjoba » Mon Oct 30, 2023 12:36 am

your ultimate goal is to draw trendlines on graphs if the trendline was drawn in the currently displayed currency, and not drawn if the graph is displayed in another currency?

Exactly.

There are two key principles to have in mind to understand the request:

Principle #1 - A trendline is only valid for the prices (so currency) it has been originally drawn (ie. created). If prices change because they are converted to another currency, the trendline becomes invalid and must not be displayed.

With the current implementation, this principle is not always respected, so problem n°1.

Problem #1 situation: for an investment whose assigned currency is EUR, and the trendline is originally drawn (ie. created) with "Exchange Rate Adjusted" ON in the EUR Template (image1). When the template is changed to USD Template (still with "Exchange Rate Adjusted" ON), the trendline is still displayed but should not because it is invalid (image3).

The problem occurs because the current implementation only assigns here the trendline to the default currency slot, but without taking into account the currency template that is currently loaded.


Principle #2 - A trendline originally drawn (ie. created) for given prices (so for a given currency) should always be displayed when these prices (currency) are displayed, whatever the "Exchange Rate Adjusted" and currency template situations.

With the current implementation, this principle is not always respected, so problem n°2

Problem #2 situation: for an investment whose assigned currency is EUR, and the trendline is originally drawn (ie. created) with "Exchange Rate Adjusted" ON in the EUR Template (ie. with default currency = €)(image1). When "Exchange Rate Adjusted" is changed to OFF (same template) the trendline is not displayed (image2), but it should be.
And same problem when the trendline is originally drawn (ie. created) with "Exchange Rate Adjusted" OFF and when "Exchange Rate Adjusted" is changed to ON.

This is because the current implementation only assigns trendlines to default currency OR assigned (native) currency, but without taking into account the possibility that default currency and assigned (native) currency may be the same (constant ratio of 1 between the two currencies).


PS: The prices of the investments whose assigned (native) currency is the default currency are never converted, whatever the state of "Exchange Rate Adjusted" or the currency template that is loaded. So for those investments the trendlines should be displayed in all situations. The current implementation behaves correctly on this, it should not be changed.

PPS: not related but the online help ('Currency Settings Dialog') could maybe be more explicit (probably in 'Usage tips') on this particular point that, like Exchange Rate investments, non standard investments expressed in non-monetary units (like economic indicators, bond Yields), generally used for market analysis, has to be assigned to the default currency (and probably placed in their own sub-portfolio) because it is on this slot that they will never be converted, whatever the state of "Exchange Rate Adjusted" or the currency template that is loaded. I remember that I had a little trouble understanding this.

Thanks.
Djobydjoba
 
Posts: 795
Joined: Tue Mar 09, 2010 9:39 am

Postby Mark » Mon Oct 30, 2023 5:34 pm

Hi Djobydjoba,

Okay, thanks for the refresher. I hadn't looked at this in a while. I understand what you're wanting, and I think the simpler implementation that will achieve the desired result is to remember the currency symbol, instead of position in the currency stack. In addition, we'd have to do some smart comparison, where $ (or USD) could be a match on USD and € (or EUR) would match on EUR. This was on the list of possible improvements, but didn't make it to the top of the list for FM 2024. I'll try to increase the priority.
Thanks,
Mark
Fund Manager - Portfolio Management Software
Mark
Site Admin
 
Posts: 11610
Joined: Thu Oct 25, 2007 2:24 pm
Location: Chandler, AZ

Postby Djobydjoba » Mon Oct 30, 2023 11:32 pm

It is an improvement that will be welcome. If not everyone use currency templates I guess, the problem to "lose" the trendlines just by changing the state of "Exchange Rate Adjusted" currently may concern quite a few people.

Your idea to implement that sounds great.

No problem to wait for a / the next release.

Thanks.
Djobydjoba
 
Posts: 795
Joined: Tue Mar 09, 2010 9:39 am

Postby Djobydjoba » Sun Jul 28, 2024 6:14 am

For information, TradingView, the current benchmark for stock charting software, hides too the trendlines (and horizontal lines, in fact all drawing elements) not drawn specifically in the currency currently displayed.

Animated screenshot: https://i.ibb.co/0Ys8mdJ/Trendlines-With-Currencies.gif
Djobydjoba
 
Posts: 795
Joined: Tue Mar 09, 2010 9:39 am

Postby Mark » Fri Aug 02, 2024 11:13 am

Hi Djobydjoba,

Great, understood, and thank you.
Thanks,
Mark
Fund Manager - Portfolio Management Software
Mark
Site Admin
 
Posts: 11610
Joined: Thu Oct 25, 2007 2:24 pm
Location: Chandler, AZ

Previous

Return to Graphs

Who is online

Users browsing this forum: No registered users and 7 guests

FundManagerSoftware.com | Search | Site Map | About Us | Privacy Policy
Copyright © 1993-2024 Beiley Software, Inc. All rights reserved.