PureBytes Links
Trading Reference Links
|
Any help would be greatly appreciated.
// FIND ARRAY VALUES AND BARS SINCE CONDITIONS MET STEPPING-BACK IN TIME
// WITH MULTIPLE INCIDENCES OF CONDITION
// THIS EXAMPLE DEVELOPED AS A 'CODE BUILDING BLOCK' FOR FUTURE USE
// To Find Previous instances of a 'Condition'
// Substitute any 'Condition' (Rule) for the example 'Range' beneath:
Range = H-L > 0.50;
// Find Bars Since Condition was True:
BS_Range_1 = BarsSince(Range);
Bars2_Range_1 = ValueWhen(Range,BarIndex(),1)+1;// Need to add '1' to be in
line with Chart Status Bar Value
Bars2_Range_2 = ValueWhen(Range,BarIndex(),2)+1;// Need to add '1' to be in
line with Chart Status Bar Value
LastBar = LastValue(BarIndex()+1); // Need to add '1'
to be in line with Chart Status Bar Value
BS_Range_2 = LastBar - Bars2_Range_2;
// Find Close Price when Condition 1 or 2 were met:
Close_Range_1 = ValueWhen(Range,C,1);
Close_Range_2 = ValueWhen(Range,C,2);
Filter = 1;
AddColumn(BS_Range_1,"BS_Range_1",1.0,colorBlue,50);
AddColumn(Close_Range_1,"Close_Range_1",1.4,colorBlue,50);
AddColumn(BS_Range_2,"BS_Range_2",1.0,colorBlue,42);
AddColumn(Close_Range_2,"Close_Range_2",1.4,colorBlue,42);
AddColumn(Bars2_Range_2,"Bars2_Range_2",1.0,colorBlue,43);
AddColumn(Bars2_Range_1,"Bars2_Range_1",1.0,colorBlue,43);
AddColumn(LastBar,"LastBar",1.0,colorBlue,43);
Regards,
Gordon Sutherland
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
<<attachment: winmail.dat>>
|