PureBytes Links
Trading Reference Links
|
Hi Graham,
I forgot to include the PivotLow function on the last send. Both are below. You'd use the functions like this:
#pragma nocache
#include "Wherever you put your afl file with the functions"
PH = PivotHigh(3,3); PL = PivotLow(3,3);
Plot( C, "C", colorLightGrey, styleBar+styleNoLabel );
Plot( PH, "res", colorRed, styleDots+styleNoLine );
Plot( PL, "sup", colorGreen, styleDots+styleNoLine );
Title = Name() + ", " + Date() + ", Support & Resistance Levels Support = "
+ PH + ", Resistance = " + PL ;
If you are using functions embedded in your afl, make sure they are above the code that actually calls them.
e.g.
Function Blah(Len);
{
return MoreBlah;
}
BL = Blah(5);
Plot(BL,"BL",colordefault,styleline);
Hope this helps,
Gary
CODE BELOW FOR THE PIVOT LOW/HI FUNCTIONS
//===== PivotHigh(LeftStr, RightStr) ====================================
/*
SUPPORT & RESISTANCE LEVELS
Graham Kavanagh 9 Oct 2003
Returns High value of pivot
*/
function PivotHigh(LeftStr, RightStr)
{
//Find turning points
top = H == HHV(H,LeftStr+1) AND H == Ref(HHV(H,RightStr+1), RightStr);
topH = ValueWhen(top,H);
return topH;
}
//======= PivotLow(LeftStr, RightStr) ====================================
/*
SUPPORT & RESISTANCE LEVELS
Graham Kavanagh 9 Oct 2003
Returns Low value of pivot
*/
function PivotLow(LeftStr, RightStr)
{
//Find turning points
BOT = L == LLV(L,LeftStr+1) AND L == Ref(LLV(L,RightStr+1), RightStr);
BOTL = ValueWhen(BOT,L);
return BOTL;
}
Graham <gkavanagh@xxxxxxxxxxxxx> wrote:
Thanks Gary That makes it interesting as I have not yet tried the function function :) Do you just put the numbers you want into the intital function setting Eg function PivotHigh(2, 4)Cheers,Grahamhttp://groups.msn.com/ASXShareTradinghttp://groups.msn.com/FMSAustralia-----Original Message-----From: Gary A. Serkhoshian [mailto:serkhoshian777@xxxxxxxxx] Sent: Friday, 10 October 2003 11:43 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker] Simplified support resistance levelsHi Graham,I just added the ability to have variable right and left strength andconverted into a function. Hope this saves you some work, and thanks forall the posts and code you've
contributed.Regards,Gary//========== PivotHigh(LeftStr, RightStr) ============================/*SUPPORT & RESISTANCE LEVELSGraham Kavanagh 9 Oct 2003Returns High value of pivot*/function PivotHigh(LeftStr, RightStr){//Find turning pointstop = H == HHV(H,LeftStr+1) AND H == Ref(HHV(H,RightStr+1), RightStr);topH = ValueWhen(top,H);return topH;}Graham <gkavanagh@xxxxxxxxxxxxx> wrote: I have been looking at various ways to chart the support resistance elevels,ultimately to incorporate into various trading systems. Having attemptedloops and other methods of differing complexity I pulled back to thesimplest of forms, price.Now this is probably already shown somewhere, but will share it anyway.Any comments appreciated//SUPPORT & RESISTANCE LEVELS//Graham Kavanagh 9 Oct 2003//Find turning pointstop = H==HHV(H,3) AND H>=Ref(H,1) AND
H>=Ref(H,2);bot = L==LLV(L,3) AND L<=Ref(L,1) AND L<=Ref(L,2);topH = ValueWhen(top,H);botL = ValueWhen(bot,L);//Indicator sectionGraphXSpace=5;Plot( C, "C", colorLightGrey, styleBar+styleNoLabel );Plot( topH, "res", colorRed, styleDots+styleNoLine );Plot( botL, "sup", colorGreen, styleDots+styleNoLine );Title = Name() + ", " + Date() + ", Support & Resistance Levels Support = "+ topH + ", Resistance = " + botL ;Cheers,Grahamhttp://groups.msn.com/ASXShareTradinghttp://groups.msn.com/FMSAustraliaSend 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:http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Do you Yahoo!?The New Yahoo! Shopping - with improved product search Yahoo! Groups SponsorSend BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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:<A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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.
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
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.
|