|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object TradingStrategies.TradingStrategy TradingStrategies.StrategyDoubleOrNothing
A strategy which starts with 100 shares and increases the number of shares by a factor f whenever the asset price declines a certain trigger percentage below the level at the last buy.
Warning:if f is large enough this can wrest positive returns even from an asset drifting lower (bear market). In this case however the position can grow very large. Do this only if you have very deep pockets!
Constructor Summary | |
StrategyDoubleOrNothing(double fixed_trc,
double prop_trc,
Asset asset,
int triggerPercentage,
double f)
|
Method Summary | |
double |
newWeight(int t)
The new weight of the asset given that a trade takes place at time t (ie. |
Methods inherited from class TradingStrategies.TradingStrategy |
discountedGainsAndNumberOfTrades, discountedGainsFromTrading, get_asset, get_B, get_currentWeight, get_dt, get_fixed_trc, get_nTrades, get_prop_trc, get_S, get_T, get_tradeTrigger, initialInvestment, newDiscountedGainsAndNumberOfTrades, newDiscountedGainsFromTrading, newReturnFromTrading, newTradeStatistics, returnsFromTrading, tradeStatistics |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StrategyDoubleOrNothing(double fixed_trc, double prop_trc, Asset asset, int triggerPercentage, double f)
fixed_trc
- fixed transaction costs per tradeprop_trc
- proportional transaction costs per tradeasset
- the asset invested intriggerPercentage
- percent decline triggering a buyf
- factor by which number of shares is increased on each buyMethod Detail |
public double newWeight(int t)
TradingStrategy
The new weight of the asset given that a trade takes place at time t (ie. the portfolio is rebalanced at time t).
If no trade takes place at time t the weight of the asset is in the member variable currentWeight. This variable is kept up to date to allow reference to the last weight in the computation of the next weight newWeight(t) at time t (eg "doubling up", "selling half" etc.).
newWeight
in class TradingStrategy
t
- current time.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |