PureBytes Links
Trading Reference Links
|
Dear folks,
I have two questions regarding the code below, if you
care:
1./ I need to find out when a given condition happens
in relation to its bar number, i.e. I -let´s say- want to find out where a
condition happens closest to bar number 1000. Can I use the iif-function with
"true result" being a cum-fun function which has multiple values.
2./ when I use this scan, I seem to get the proper
results in terms of the low value and bar number, but the date I´, given is
always the last bar´s date INSTEAD of the date´s bar when the conditon happens.
How can I get the condition´s bar date, please?
Sorry for my ignorance and the waste of your
time<g>.
Markus
- - - - - - - - - -
A=<FONT face="Courier New"
color=#0000ff>IIf<FONT face="Courier New"
color=#000000>(Low<<FONT face="Courier New"
color=#0000ff>Ref<FONT face="Courier New"
color=#000000>(Low,-<FONT face="Courier New"
color=#ff00ff>1),<FONT
face="Courier New" color=#0000ff>Cum<FONT face="Courier New"
color=#000000>(1<FONT
face="Courier New" color=#000000>),<FONT face="Courier New"
color=#ff00ff>0);
B=A<1000<FONT
face="Courier New" color=#000000>;
C=A>0<FONT
face="Courier New" color=#000000>;
Filter=1<FONT
face="Courier New" color=#000000>;<FONT face="Courier New"
color=#0000ff>
AddColumn(<FONT
face="Courier New" color=#0000ff>Cum<FONT face="Courier New"
color=#000000>(1<FONT
face="Courier New" color=#000000>),<FONT face="Courier New"
color=#ff00ff>"total barnumber"<FONT face="Courier New"
color=#000000>,1.3<FONT
face="Courier New" color=#000000>);<FONT face="Courier New"
color=#0000ff>
AddColumn(<FONT
face="Courier New" color=#0000ff>ValueWhen<FONT face="Courier New"
color=#000000>(B AND C,Low,<FONT face="Courier New"
color=#ff00ff>2),<FONT
face="Courier New" color=#ff00ff>"low"<FONT face="Courier New"
color=#000000>,1.3<FONT
face="Courier New" color=#000000>);<FONT face="Courier New"
color=#0000ff>
AddColumn(<FONT
face="Courier New" color=#0000ff>ValueWhen<FONT face="Courier New"
color=#000000>(B AND C,<FONT face="Courier New"
color=#0000ff>Cum(<FONT
face="Courier New" color=#ff00ff>1<FONT face="Courier New"
color=#000000>),2<FONT
face="Courier New" color=#000000>),<FONT face="Courier New"
color=#ff00ff>"condition bar number"<FONT face="Courier New"
color=#000000>,1.3<FONT
face="Courier New" color=#000000>);<FONT
face="Courier New">
|