Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Implemented Currency Conversion

Discussion in 'Stock Trader Closed Suggestions' started by wmtech, Jun 12, 2012.

  1. wmtech

    wmtech New Member AMS Premium RMS Premium SC Premium Sportsbook

    If you buy stocks from FTSE tab, the value is given in GBP.
    If you buy stocks from DJI tab, the value is given in USD.
    If you buy stock from anywhere in the world, the value is given in local currency.

    However, in your portfolio everything is converted simply 1:1 in USD (or any other currency symbol you choose in settings).

    IMHO this should be converted between the currencies using the current exchange rate at the time you buy and you sell the stocks. Also the current value of the portfolio should consider at least the exchange rate of the prior day.

    Is there any plan to implement currency settings correctly and when can we expect that?
    erich37 likes this.
  2. Bob

    Bob Developer Staff Member

    Some currency conversion is planned (and already being worked on) (US->GBP and GBP->US). When will it be available, I am not sure yet. The focus right now is on US Exchanges and integrating the London Exchange while building this. Other exchanges will be integrated (with proper currency conversions) as time allows.

    If you have a specific exchange(s) in mind (that are not US or London), let me know so I can maybe get a jump on it while working on the London integration.
  3. wmtech

    wmtech New Member AMS Premium RMS Premium SC Premium Sportsbook

    IMHO the software should at least be able to handle EUR, GBP and USD.
    • Let admin set in ACP which currency the system shall use (USD, GBP, EUR or custom/fake). (Later you may even add a function to allow each single user to select a currency for his portfolio.)
    • If custom/fake currency, let admin decide in ACP which fixed exchange rate to USD "Custom" should use. (maybe "1" as default?)
    • Create a cron job and fetch all exchange rates daily from a reliable source (Yahoo, XE, etc). Save them in a new db table.
    • Save curreny info for each stock in a new field in xf_xi_stocktrader_stock.
    • Add functions to convert stock currency to system currency (and vice versa) as set in ACP.
    • Use these functions when stock is bought, sold or the portfolio value is presented.
    • Portfolio values can be stored in system currency, but you may advise the admins that all user portfolios should be reseted if system currency will be changed.
    As we are located in Germany, german stock exchanges will be what we need. DAX, TECDAX, etc.
    Bob likes this.
  4. Bob

    Bob Developer Staff Member

    I've got (what I consider) a fairly decent "beta" version working right now. Please forgive me if it doesn't have all the bell, whistles and functionality that you dream of that an entire IT department funded by Google over a years time frame could come up with tho :p

    I've got it to the point where you set a system currency (US Dollars, Euro or British Pound) and it will convert all stocks to that currency based on the daily exchange rate (which default CRON grabs once per 24 hrs, but you can change the CRON to run at any interval you want). Lookups, Purchase, Sales all convert like a charm.

    However....once System Currency is set, you can switch it, but it will mess up all the "Profit Gain/Loss" because of all historical data (like Purchase Info) that is based on the currency when it was purchase. ie, you set Sys Currency to US on Jan 1st... on Jan 5th you purchase 10 shares of GE at $5 per share. In Oct you decide to change the Sys Cash to Euro.. Now the "current" value is calculated with Euro instead of US so the profit Gain/Loss is determined by 2 different currencies (Purchased amount was in US and Current Market value in Euro) so the Profit Gain/Loss for that stock is now out of wack (so, don't switch sys currency!) If you want to mess around with switching currency to see it work, do it in a development environment. There is absolutely NO valid reason to switch sys currency after you've started using the system. If you just "have" to switch, I'd global reset and start from scratch (after all, its entertainment)

    Thats about all the farther I am justifiably able to take this suggestion at this time. Going to spend time this week cleaning up the code, making some tweaks and minor adjustments, then will get it out to anyone with a stock trader license that wants to beta test it.

    btw, I AM open to working on this suggestion further as Custom paid work, but I can't currently justify any further enhancement to this specific functionality for free right now. Hope you understand.
    Sheldon likes this.
  5. Bob

    Bob Developer Staff Member

    Currency Conversion is now implemented in Beta 6/RC 1.

    I am marking this is "partial" as not 100% of what the thread created asked for is being implemented. More details will be released once beta testing has concluded.
  6. erich37

    erich37 Member

    I am not sure, but I think that the "statistics" like "Total Invested" , "Market Value" , "Net Worth", etc. are not correct if you do not have a currency-conversion.
    When I buy a stock in USD and another stock in EUR, then it would not be correct to just add-up those absolute numbers. The values are not correct IMHO.

    If the system works without displaying currencies, then I think it would be correct to just display the currency of a given stock in a specific column.
    But do not display "statistics" like "Net Worth", etc. as those statistics would not show the correct value.
  7. Bob

    Bob Developer Staff Member

    Not sure I understand. Its a 2 step process now, not just one. You must now set a SYSTEM currency in the Admin CP. You have 3 Options (US Dollar, British Pound or EURO). Once the System currency is set, you choose which exchanges you want to use (there are currently 3). When someone looks up a stock, stocks at that point are then converted to the SYSTEM currency, so everything is on ONE currency (the middle column of the stock on the lookup even tells you that its been converted from say US to EURO.

    Say you run a site in Germany. You'd most likely set your SYSTEM currency to EURO. If you enabled US Exchanges and London Exchange, all stock values in those exchanges will be converted from US to EURO and (pence to Pounds) to EURO.

    So yes, Stats like New Worth are correct. The OLD way I had it set up (before currency conversion) was not correct, cause obviously you can't add up 1000 US, 1000 Pounds and 1000 Euro lol

    ALL values throughout are ONE currency (and that is the system currency you choose).
    erich37 likes this.
  8. erich37

    erich37 Member

    oh, so then all is fine :)
  9. Bob

    Bob Developer Staff Member

    ya, it was kinda a mess before without any continuity conversion. Once I get this next version released (hopefully this weekend) I will be adding in some new Exchanges (its a big process).
    erich37 likes this.
  10. erich37

    erich37 Member

    what happens if there is a change in an index-composition, e.g. when a stock is dropped from the Nasdaq100 index and another stock is added to the index..... which happens from time to time.
    Would you then update the index or would I be able to do it myself via ACP ?
  11. Bob

    Bob Developer Staff Member

    Right now I have those stock symbols hard coded into an array for each type of index for the Popular stocks as they are not something that change a lot and even if/when they do, it can be handled via an update to the addon. RC1 had a few updates to the Popular Stocks indexes and NASDAQ100 was one of them (KFT IIRC). If you are comfortable in doing file edits, the arrays are in the stock model and are easy to edit :)
    erich37 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.