[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] exiting flat positions



PureBytes Links

Trading Reference Links


Dave,
 
What'll happen to EI in the example you've given is denominator (ATR) will go up and the numerator will go down which will cripple the EI.  I have no idea how it'll work on a position management basis, but it's certainly worth a look.  Also, parabolic comes to mind which is more or less what your stop is doing.
 
Have a great weekend,
GaryDave Merrill <dmerrill@xxxxxxx> wrote:


Hi Gary, I saw your EI post and want to investigate, but unless I'm misunderstanding something, that's not the issue I'm trying to get at. It seems like you'd use EI to put you in stocks that move without big changes in volatility, which I'd think would allow more tailored stops, among other things.
 
What I'm wondering about is positions that don't move at all, or stop moving after you've held them a while. For instance, say you get a great bump up immediately after entry, then it just sits there flat. Doesn't hit a stop since it's not falling, didn't go high enough to hit a target if you have one, just sits.
 
My code was an effort at kicking positions like that out the door at some point, so their capital can be used for other things. It didn't test out profitably in the context I checked it though. Not sure what that means.
 
Dave
 

I like your code, and your idea.  In terms of an alternative, Al posted Tharpe's Efficiency Index which addresses chop.  Here's his code and explaination. Regards,
Gary
 
Effiency Index (EI) = (C - ref(C,-x)/ATR(x)

An efficient stock is a stock whose price movements are high relative to its volatility changes (i.e., the price change is high but the volatility change is minor). So, if a stock increases by 3 points while its volatility only increases a little, that's good because it gives you greater profitability at a given volatility.

I think the way you would use it would be as a boolean Buy (or Short) qualifier. In other words, something like this:
Buy = <your normal buy rules> AND EI > y; //where y is an optimizable variable.Dave Merrill <dmerrill@xxxxxxx> wrote:
Obviously, losses are a problem. But so are positions that hang in thereforever taking up available cash but going nowhere, without hitting profittargets or stops.How would you code that, assuming you're dealing with a system that tries todump losers but let winners run as long as they're advancing.I tried starting from a modest stoploss, with the stop percentage advancingevery day until it becomes negative, enforcing the requirement to make aprofit or get off the bus. I'm not certain, but I think it's working, justnot very profitable in the context I tried it:.Here's the code:----------------bars_since_buy = NZ(BarsSince(buy), BarCount);bars_since_short = NZ(BarsSince(short), BarCount);bars_since_entry = IIf(bars_since_buy < bars_since_short, bars_since_buy,bars_since_short);stoploss_rise =
 Optimize("stoploss rise", .5, .1, 1, .1);stoploss = 13 - (stoploss_rise * bars_since_entry);ApplyStop(stopTypeLoss, stopModePercent, stoploss, false, true, 0);----------------Anyone see any problems with the implementation? Any other ideas foravoiding sitting in stagnant positions?DaveSend BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of
 Service. 


Do you Yahoo!?New Yahoo! Photos - easier uploading and sharing Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.