Click here to Login





                                                   Multi Currency Stock Portfolio Backtesting

Back to threads - Tags: --
  1

0
SystemTrade
2012-06-14 15:57:50


@ all

I have uploaded a Money Management Script today, which will provide the functionality to backtest a stock portfolio in different currencies and report the results in a base currency of your choice.

The script works, but as I could not fully test it with the trading systems and currencies I use, I have still named it Beta version.

Please use this thread for your comments, ideas, criticism, suggestions ... I might consider those for the final version.


Enjoy and be the profits with you!



QuantShare
2012-06-14 17:09:02

  0

Great upload. Here is the link: Multi Currency Stock Portfolio Backtesting - Beta 0.6




Multi Currency Stock Portfolio Backtesting - Beta 0.6 (by SystemTrade, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

Tom Huggens
2012-06-15 11:49:48

  0

First, let me tell you that your money management script is excellent.

However, I think there is an issue when using the following methods:
- System provides B/C, NbShares converted to T/C
- System provides T/C, NbShares unchanged

I have used a simple trading system:
buy = rsi(14)> 50;
N-Bar Stop: 10%
Symbol: AAPL

The problem is that the equity curve highly increases when taking a new position and it decreases when exiting that position.





SystemTrade
2012-06-15 15:43:34

  0

Thanks Tom, I will have a look into that next week.


SystemTrade
2012-06-19 11:59:44

  0

@ Tom: this in fact is a presentation issue with the 2 options you have indicated, I think I will disable these 2 options in the final version, but let me explain what happened:

Assuming you are trading in USD, your base currency is EUR and the exchange rate EUR/USD is 1.25.

When your system e.g. buys 100 AAPL at a price of 580 USD then this trade will reduce your equity (which is interpreted in EUR as your base currency) by 58000 and your portfolio will be valued at 58000 also.
Then the MM script will make a cash adjustment by 58000-100*580/1.25 = 11.600 to reflect available cash in EUR. Same happens with opposite sign when AAPL are sold.

The problem is, that the (simplified) formula
Equity = Cash + nbShares * StockPrice
which is embedded in QuantShare, needs to be changed to
Equity[EUR] = Cash[EUR] + (nbShares * StockPrice[USD]) / Exchange Rate

The only possibility I presently see (as the Stock Price used by QuantShare is fix in USD) is to do it by
a) adjusting the number of shares:
Equity[EUR] = Cash[EUR] + (nbShares / Exchange Rate) * StockPrice[USD]
This is basically the option "System provides B/C, NbShares unchanged" and will result in correct Cash and Equity (FX-effects calculated by use of Custom variable Var3)

or
b) adjusting cash:
Equity = (Cash + Adjustment)[EUR] + (nbShares * StockPrice[USD])
Which will result in correct Cash but incorrect Equity while the Position is open as you have experienced.


Hence the "price" for a correct cash number in these 2 options are the peaks in equity.

I suggest that you go with the "System provides B/C, NbShares unchanged" option.

Do you see other solutions?



Tom Huggens
2012-06-21 12:01:21

  0

Thank you for the explanation. I will go with the "System provides B/C, NbShares unchanged" option.

I have asked QuantShare support few weeks ago about a multi-currency feature and they told me that it is in the todo list. Can someone from QuantShare team confirm that?



QuantShare
2012-06-21 14:01:26

  1

Yes, we will add multi-currency support for the simulator/portfolio tools soon


SystemTrade
2012-08-23 07:34:36

  0

Due to some changes in QuantShare version 2.9.2 regarding the accessibility of the Data class in functions, version 0.6 of this script only works for QuantShare version 2.9.1 and below.
I will provide an updated version in some days. This new version will use the new Global event and will also provide functionality to use the script for Forex (I will probably change the name of the script to Currency Management as it will no longer be for stock portfolio only).



SystemTrade
2012-08-27 10:23:47

  0

New Version for QuantShare 2.9.2 and above uploaded today.

Currency Mgmt v 0.9

I have deleted the old version, if anyone still needs it, just send me a personal note.





Currency Mgmt v 0.9 (by SystemTrade, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Portfolio vs Stock Return
Currency Mgmt v 0.9
High to low stock pattern for the close price
ETF Number of securities, percent stock and cash - Historical Dat...
Hedge a portfolio strategy

How-to Lessons
How to plot the number of stock tweets per day
How to import trades into a portfolio
How to synchronize stock charts?
How to drag & drop a stock to a static watchlist
How to create a strategy-based portfolio

Related Forum Threads
Multi currency functionality
backtesting on currency pairs
Importing portfolio from a comma delimted file
Calculate total volatility of portfolio
Where can I get global historical stock and bond index prices?

Blog Posts
9 mistakes you should avoid when backtesting an end-of-day stock ...
Backtesting a Strategy Based on Bond and Stock Index ETFs
Create a stock index or a trading indicator using the composite t...
How to Backtest Each Stock or Asset Individually
How to Switch On/Off Trading Rules in Your Stock Trading System









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



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.