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

RE: [amibroker] Can´t detect proper cum values - TJ please read



PureBytes Links

Trading Reference Links




<SPAN 
class=175072716-17022003>Marcus,
<SPAN 
class=175072716-17022003> 
lets 
say that fistswing high occurs on bar 50. The value is 10. In your code AB 
would now look for ANY occurance of H=10 so if the high at bar 100 was also 10 
then  the cum(1) value will be 100. If firstswing has criteria that is 
defined, and as you say only occurs one time per chart, then perhaps my approch 
will work,,,,,,
<SPAN 
class=175072716-17022003> 
<FONT color=#0000ff 
face=Arial 
size=2>Value1=Valuewhen(firstswingtop,cum(1),1)     

 Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: funnybiz@xxxxxx 
[mailto:funnybiz@xxxxxx]Sent: Monday, February 17, 2003 11:20 
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker] 
Can´t detect proper cum values - TJ please read
Jayson,
 
I thought about what you said.
 
The variables "firstswingtop" and 
"firstswingbottom" are try only once in the chart (this is why I callend the 
FIRST; the next occurence would be secondswingbottom and secondswingtop 
etc.).
 
And since they occur only once in the chart, I 
thought it couldn´t be such a problem to find their respective cum 
values.
 
What puzzles me is that the conditions return the 
proper high value (for firstswingtop) and the proper low value (for 
firstswingtbottom). so, I figured that if the high value hits firstswingtop 
value for the first time, this cum value could be returned by using valuewhen 
function (analogue for firstswingbottom).
 
Do you know what I mean? If you ran the code in 
explore mode, you´ll be given one single value for each condition. 
 
Markus
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A href="" 
  title=jcasavant@xxxxxxxxxxxx>Jayson 
  To: <A 
  href="" 
  title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx 
  Sent: Monday, February 17, 2003 4:46 
  PM
  Subject: RE: [amibroker] Can´t detect 
  proper cum values - TJ please read
  
  <SPAN 
  class=793204015-17022003>Markus,
  <SPAN 
  class=793204015-17022003> 
  I do 
  not know how you calculated firstswing but have you 
  tried...
  <SPAN 
  class=793204015-17022003> 
  
  <FONT color=#000000 face=Arial 
  size=2>Value1=Valuewhen(firstswingtop,cum(1),1)     
  and
  <FONT color=#000000 face=Arial 
  size=2>Value2=Valuewhen(firstswingbottom,cum(1),1)
  In 
  your original cum(1) would be returned for the last time High was equal to 
  your trigger if this number occurs several times than your cum(1) could be 
  misrepresented......
   Jayson 
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: funnybiz@xxxxxx 
  [mailto:funnybiz@xxxxxx]Sent: Monday, February 17, 2003 10:05 
  AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
  Can´t detect proper cum values - TJ please read
  
  TJ,
  I´m trying to retrieve the cum values 
  for the two variable below clled "firstswingtop" and "firstswingbottom". I 
  sent the complete code so that you understand what those two variable are made 
  up of.
  I figured that the cum values were 
  this
  <FONT color=#000000 
  face=Arial>Value1=Valuewhen(h==firstswingtop,cum(1),1)     
  and
  <FONT color=#000000 
  face=Arial>Value2=Valuewhen(l==firstswingbottom,cum(1),1)
  but I aly get the last bars cum value. Why 
  is that since the conditions above can´t apply to this very last 
  bar????????
  I´m really puzzled, since firstswingtop and 
  firstswingbottom detect the right high and low 
  values    ;-))
  Markus
  - - - - - - - - - - - - - - - - - - - - - - 
  - - - - - - 
  swingsize=5<FONT 
  color=#6600aa face="Courier New">;
  weeklyrange=(Ref<FONT 
  color=#6600aa face="Courier New">(<FONT color=#0000ff 
  face="Courier New">HHV<FONT color=#6600aa 
  face="Courier New">(<FONT color=#000000 
  face="Courier New">High<FONT color=#6600aa 
  face="Courier New">,swingsize),-<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">)-<FONT color=#0000ff 
  face="Courier New">Ref<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">LLV<FONT color=#6600aa 
  face="Courier New">(<FONT color=#000000 
  face="Courier New">Low<FONT color=#6600aa 
  face="Courier New">,swingsize),-<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">))*<FONT color=#ff00ff 
  face="Courier New">0.1;
  Thresholddown=Ref<FONT 
  color=#6600aa face="Courier New">(<FONT color=#0000ff 
  face="Courier New">LLV<FONT color=#6600aa 
  face="Courier New">(<FONT color=#000000 
  face="Courier New">Low<FONT color=#6600aa 
  face="Courier New">,swingsize),-<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">)-weeklyrange;
  Thresholdup=Ref<FONT 
  color=#6600aa face="Courier New">(<FONT color=#0000ff 
  face="Courier New">HHV<FONT color=#6600aa 
  face="Courier New">(<FONT color=#000000 
  face="Courier New">High<FONT color=#6600aa 
  face="Courier New">,swingsize),-<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">)+weeklyrange;
  Linechangeup=<FONT color=#000000 
  face="Courier New">High<FONT color=#6600aa 
  face="Courier New">>Thresholdup;
  Linechangedown=<FONT color=#000000 
  face="Courier New">Low<FONT color=#6600aa 
  face="Courier New"><thresholddown;
  z=Linechangedown;
  y=linechangeup;
  firstlinechangedown=<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">ValueWhen<FONT color=#6600aa 
  face="Courier New">(z,<FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">),<FONT color=#ff00ff 
  face="Courier New">1));
  firstlinechangeup=<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">ValueWhen<FONT color=#6600aa 
  face="Courier New">(y,<FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">),<FONT color=#ff00ff 
  face="Courier New">1));
  firstswingtop=Ref<FONT 
  color=#6600aa face="Courier New">(<FONT color=#0000ff 
  face="Courier New">HHV<FONT color=#6600aa 
  face="Courier New">(<FONT color=#000000 
  face="Courier New">High<FONT color=#6600aa 
  face="Courier New">,(firstlinechangedown-firstlinechangeup)+<FONT 
  color=#ff00ff face="Courier New">1<FONT color=#6600aa 
  face="Courier New">),-(<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">))-firstlinechangedown));
  secondlinechangedown=<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">ValueWhen(z 
  AND<FONT 
  color=#6600aa face="Courier New"> <FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">)<<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(firstlinechangeup),<FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">),<FONT color=#ff00ff 
  face="Courier New">1));
  secondlinechangeup=<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">ValueWhen(y 
  AND<FONT 
  color=#6600aa face="Courier New"> <FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">)<<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(secondlinechangedown),<FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">),<FONT color=#ff00ff 
  face="Courier New">1));
  firstswingbottom=<FONT color=#0000ff 
  face="Courier New">Ref<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">LLV<FONT color=#6600aa 
  face="Courier New">(<FONT color=#000000 
  face="Courier New">Low<FONT color=#6600aa 
  face="Courier New">,(firstlinechangeup-secondlinechangedown)+<FONT 
  color=#ff00ff face="Courier New">1<FONT color=#6600aa 
  face="Courier New">),-(<FONT color=#0000ff 
  face="Courier New">LastValue<FONT color=#6600aa 
  face="Courier New">(<FONT color=#0000ff 
  face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1<FONT color=#6600aa 
  face="Courier New">))-firstlinechangeup));<FONT color=#6600aa 
  face="Courier New">
  Filter<FONT color=#6600aa 
  face="Courier New">=firstlinechangedown>firstlinechangeup;<FONT 
  color=#0000ff face="Courier New">
  AddColumn(<FONT 
  color=#0000ff face="Courier New">Cum<FONT color=#6600aa 
  face="Courier New">(<FONT color=#ff00ff 
  face="Courier New">1), 
  "total bars"<FONT 
  color=#6600aa face="Courier New">,<FONT color=#ff00ff 
  face="Courier New">1.0<FONT color=#6600aa 
  face="Courier New">);
  AddColumn<FONT color=#6600aa 
  face="Courier New">(firstswingtop,<FONT color=#ff00ff 
  face="Courier New">"1. swing top"<FONT color=#6600aa 
  face="Courier New">,<FONT color=#ff00ff 
  face="Courier New">1.2<FONT color=#6600aa 
  face="Courier New">);
  AddColumn<FONT color=#6600aa 
  face="Courier New">(firstswingbottom,<FONT color=#ff00ff 
  face="Courier New">"1. swing bottom"<FONT color=#6600aa 
  face="Courier New">,<FONT color=#ff00ff 
  face="Courier New">1.2<FONT color=#6600aa 
  face="Courier New">);<FONT 
  color=#0000ff face="Courier New">
  AddColumn(<FONT 
  color=#0000ff face="Courier New">MA<FONT color=#6600aa 
  face="Courier New">(<FONT color=#000000 
  face="Courier New">Volume<FONT color=#6600aa 
  face="Courier New">,<FONT color=#ff00ff 
  face="Courier New">50<FONT color=#6600aa 
  face="Courier New">),"50DMA 
  Vol.",<FONT color=#ff00ff 
  face="Courier New">1.2<FONT color=#6600aa 
  face="Courier New">);
  AddColumn(<FONT 
  color=#000000 face="Courier New">Close<FONT color=#6600aa 
  face="Courier New">, "last 
  close",<FONT 
  color=#ff00ff face="Courier New">1.2<FONT color=#6600aa 
  face="Courier New">);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. 
  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. 
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


  ADVERTISEMENT









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.