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

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



PureBytes Links

Trading Reference Links




OOops,
 
I made a mistake.
 
The code doens´t detect the last bars cum value but 
a wrong value anyways!
 
Sorry ´bout dat!
 
Markus
 
 
----- Original Message ----- 
From: <A 
title=funnybiz@xxxxxx href="">IVA GmbH 
To: <A title=amibroker@xxxxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Monday, February 17, 2003 4:04 PM
Subject: 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 face=Arial 
color=#000000>Value1=Valuewhen(h==firstswingtop,cum(1),1)     
and
<FONT face=Arial 
color=#000000>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 
face="Courier New" color=#6600aa>;
weeklyrange=(Ref<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>HHV(<FONT 
face="Courier New" color=#000000>High<FONT face="Courier New" 
color=#6600aa>,swingsize),-<FONT face="Courier New" 
color=#ff00ff>1)-<FONT 
face="Courier New" color=#0000ff>Ref<FONT face="Courier New" 
color=#6600aa>(LLV<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#000000>Low<FONT face="Courier New" 
color=#6600aa>,swingsize),-<FONT face="Courier New" 
color=#ff00ff>1))*<FONT 
face="Courier New" color=#ff00ff>0.1<FONT face="Courier New" 
color=#6600aa>;
Thresholddown=Ref<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>LLV(<FONT 
face="Courier New" color=#000000>Low<FONT face="Courier New" 
color=#6600aa>,swingsize),-<FONT face="Courier New" 
color=#ff00ff>1)-weeklyrange;
Thresholdup=Ref<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>HHV(<FONT 
face="Courier New" color=#000000>High<FONT face="Courier New" 
color=#6600aa>,swingsize),-<FONT face="Courier New" 
color=#ff00ff>1)+weeklyrange;
Linechangeup=<FONT face="Courier New" 
color=#000000>High<FONT face="Courier New" 
color=#6600aa>>Thresholdup;
Linechangedown=<FONT face="Courier New" 
color=#000000>Low<FONT face="Courier New" 
color=#6600aa><thresholddown;
z=Linechangedown;
y=linechangeup;
firstlinechangedown=<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>ValueWhen<FONT face="Courier New" 
color=#6600aa>(z,Cum<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#ff00ff>1),<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>));
firstlinechangeup=<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>ValueWhen<FONT face="Courier New" 
color=#6600aa>(y,Cum<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#ff00ff>1),<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>));
firstswingtop=Ref<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>HHV(<FONT 
face="Courier New" color=#000000>High<FONT face="Courier New" 
color=#6600aa>,(firstlinechangedown-firstlinechangeup)+<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>),-(<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(Cum<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>))-firstlinechangedown));
secondlinechangedown=<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>ValueWhen(z 
AND<FONT 
face="Courier New" color=#6600aa> <FONT face="Courier New" 
color=#0000ff>Cum(<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>)<<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(firstlinechangeup),<FONT face="Courier New" 
color=#0000ff>Cum(<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>),1<FONT 
face="Courier New" color=#6600aa>));
secondlinechangeup=<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#0000ff>ValueWhen(y 
AND<FONT 
face="Courier New" color=#6600aa> <FONT face="Courier New" 
color=#0000ff>Cum(<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>)<<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(secondlinechangedown),<FONT face="Courier New" 
color=#0000ff>Cum(<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>),1<FONT 
face="Courier New" color=#6600aa>));
firstswingbottom=<FONT face="Courier New" 
color=#0000ff>Ref(<FONT 
face="Courier New" color=#0000ff>LLV<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>Low<FONT face="Courier New" 
color=#6600aa>,(firstlinechangeup-secondlinechangedown)+<FONT 
face="Courier New" color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>),-(<FONT face="Courier New" 
color=#0000ff>LastValue<FONT face="Courier New" 
color=#6600aa>(Cum<FONT 
face="Courier New" color=#6600aa>(<FONT face="Courier New" 
color=#ff00ff>1<FONT face="Courier New" 
color=#6600aa>))-firstlinechangeup));<FONT face="Courier New" 
color=#6600aa>
Filter<FONT face="Courier New" 
color=#6600aa>=firstlinechangedown>firstlinechangeup;<FONT 
face="Courier New" color=#0000ff>
AddColumn(<FONT 
face="Courier New" color=#0000ff>Cum<FONT face="Courier New" 
color=#6600aa>(1<FONT 
face="Courier New" color=#6600aa>), <FONT face="Courier New" 
color=#ff00ff>"total bars"<FONT face="Courier New" 
color=#6600aa>,1.0<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#0000ff>
AddColumn<FONT face="Courier New" 
color=#6600aa>(firstswingtop,"1. 
swing top",<FONT 
face="Courier New" color=#ff00ff>1.2<FONT face="Courier New" 
color=#6600aa>);
AddColumn<FONT face="Courier New" 
color=#6600aa>(firstswingbottom,<FONT face="Courier New" 
color=#ff00ff>"1. swing bottom"<FONT face="Courier New" 
color=#6600aa>,1.2<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#6600aa>
AddColumn(<FONT 
face="Courier New" color=#0000ff>MA<FONT face="Courier New" 
color=#6600aa>(<FONT face="Courier New" 
color=#000000>Volume<FONT face="Courier New" 
color=#6600aa>,50<FONT 
face="Courier New" color=#6600aa>),<FONT face="Courier New" 
color=#ff00ff>"50DMA Vol."<FONT face="Courier New" 
color=#6600aa>,1.2<FONT 
face="Courier New" color=#6600aa>);<FONT face="Courier New" 
color=#0000ff>
AddColumn(<FONT 
face="Courier New" color=#000000>Close<FONT face="Courier New" 
color=#6600aa>, "last 
close",<FONT 
face="Courier New" color=#ff00ff>1.2<FONT face="Courier New" 
color=#6600aa>);






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.