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

RE: [amibroker] exiting flat positions



PureBytes Links

Trading Reference Links




<SPAN 
class=187043914-13122003>Different perspective always welcome 
(:-)
<SPAN 
class=187043914-13122003> 
<SPAN 
class=187043914-13122003>When you plotted stoploss, were you thinking it was in 
points? It's not, it's percent, so plotting it requires some math first. Here's 
the code again for reference:
<SPAN 
class=187043914-13122003> 
<SPAN 
class=187043914-13122003>----------------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);----------------
<SPAN 
class=187043914-13122003> 
<SPAN 
class=187043914-13122003>Dave
<SPAN 
class=187043914-13122003> 
<BLOCKQUOTE 
>
  
  <SPAN 
  >Dave- sure did.  
  Thought I would add some different perspective.  
  <SPAN 
  > 
  <SPAN 
  >I tried your code, 
  but it does not seem to work.  I plotted &#8220;stoploss&#8221; and even &#8220;C-stoploss&#8221; 
  but it does not seem to do what is intended.  I have a long only system, 
  so first added Short = 0; then changed to BarsSince(Sell) but can not make it 
  do anything.  No errors, just the plots look screwy.
  <SPAN 
  > 
  <SPAN 
  >The concept is 
  important and valid.  I just must not be applying it correctly.  I 
  will play with it some more because I am at the point in my system development 
  where I will be testing stops, and the concept of what you are talking about 
  is important.
  <SPAN 
  > 
  <SPAN 
  >Ken
  <SPAN 
  > 
  <SPAN 
  >-----Original 
  Message-----From: Dave 
  Merrill [mailto:dmerrill@xxxxxxx] <SPAN 
  >Sent: Friday, December 12, 2003 11:01 
  PMTo: 
  amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: RE: [amibroker] exiting flat 
  positions
  <SPAN 
  > 
  
  <SPAN 
  >Ken, did you 
  see the code I posted in starting this thread? It's a pretty simple ApplyStop, 
  starting as a stoploss but rising each bar until it requires more and more 
  profit to stay in. I'm not 100% sure, but I think it worked as intended, it 
  just wasn't very profitable with the system I tried it 
  with.
  
  <SPAN 
  > 
  
  <SPAN 
  >Dave
  <SPAN 
  >. Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor












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.