PureBytes Links
Trading Reference Links
|
<SPAN
class=496454320-08032003>Markus,
I am
not sure I understand. If you want the cum(1) value when a variable was True
then your first example should do it.
<SPAN
class=496454320-08032003>
<FONT
size=2>Example: <FONT
size=2>
AddColumn(<FONT
color=#0000ff>ValueWhen(z,<FONT
color=#0000ff>Cum(<FONT
color=#ff00ff>1),<FONT
color=#ff00ff>1)<FONT
color=#282828>,"barcount At Z"<FONT
color=#282828>);<FONT
color=#0000ff>
AddColumn(<FONT
color=#0000ff>ValueWhen(y,<FONT
color=#0000ff>Cum(<FONT
color=#ff00ff>1),<FONT
color=#ff00ff>1),"barcount
at Y");<FONT
color=#0000ff>
AddColumn(<FONT
color=#0000ff>ValueWhen(<FONT
color=#282828>z,<FONT
color=#0000ff>Cum(<FONT
color=#ff00ff>1),<FONT
color=#ff00ff>1)<FONT
color=#282828>-ValueWhen<FONT
color=#282828>(y<FONT
color=#282828>,Cum<FONT
color=#282828>(1<FONT
color=#282828>),1<FONT
color=#282828>),"Bars in Swing"<FONT
color=#282828>);
I may
be wrong but I wonder why you are using lastvalue for firstlinechangeup and
down. Would'nt you want simply the bar count as it occurs?
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: funnybiz@xxxxxx
[mailto:funnybiz@xxxxxx]Sent: Saturday, March 08, 2003 1:14
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Canīt
find the cum value!!!!!!!!!!!!
Jayson, Anthony and others,
I recently posted a question that I couldnīt find a
cum value for a high (or low) value I found with my code
(attached).
This question is posing a problem I canīt resolve
on my own.
If anybody has an idea, please feel free to step
in!
The code comes below. It pinpoints the high ad low
values correctly. I now need their cum values.
I tried for instance
Valuewhen(high=firstswingtop, cum(1),1)
or
Iif (cum(1)>firstlinechangeup and
cum(1)<firstlinechangedown and
high=hhv(high,firstlinechangeup-firstlinechangedown),cum(1),0)
but neither works.
Thanks for your help!
Markus
- - - - - - - - -
swingsize=5<FONT
color=#6600aa face="Courier New">;// could be any value of your choice
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=#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">(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">(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">(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">(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">(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">(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">(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">(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=#000000 face="Courier New">AND<FONT color=#6600aa
face="Courier New"> MA<FONT
color=#6600aa face="Courier New">(<FONT color=#000000
face="Courier New">Volume<FONT color=#6600aa
face="Courier New">,50<FONT
color=#6600aa face="Courier New">)>=<FONT color=#ff00ff
face="Courier New">20000<FONT color=#6600aa
face="Courier New">;<FONT
color=#0000ff face="Courier New">
AddColumn(<FONT
color=#0000ff face="Courier New">Cum<FONT color=#6600aa
face="Courier New">(1<FONT
color=#6600aa face="Courier New">), <FONT color=#ff00ff
face="Courier New">"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">(firstlinechangeup,<FONT color=#ff00ff
face="Courier New">"1dlcup"<FONT color=#6600aa
face="Courier New">,<FONT color=#ff00ff
face="Courier New">1.1<FONT color=#6600aa
face="Courier New">);
AddColumn<FONT color=#6600aa
face="Courier New">(firstlinechangedown,<FONT color=#ff00ff
face="Courier New">"1dlcdown"<FONT color=#6600aa
face="Courier New">,<FONT color=#ff00ff
face="Courier New">1.1<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">);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
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.
|