|
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!
|
|
|
|
|
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.
(by SystemTrade,
uploaded several months ago)
No notes
|
|
|
|
|