PureBytes Links
Trading Reference Links
|
<span
>Hi Bob,
<span
>
<span
>Thanks very much for helping me to get my ‘Clayburg’
S & R & Trendlines working when Plotted. I have never done any script
writing to date so I guess I have a whole new learning curve ahead!
<span
>
<span
>One further point if I may, the trading
system I am working on will use these Support and Resistance Lines as Triggers
for entries and exits (after the Dual Oscillators have fired as per John
Clayburg’s trading method). In order to System Test, I would want AB to
only analyze the last Plot as extended and not previous extended plot lines. In
the code so far written, is there any way that I can suppress all extensions
other than the last one - mainly for System Testing but also for Charting
clarity.
<span
>
<span
>Once again thank you for your invaluable
help.
<span
>
<span
>Regards,
<span
>
Gordon Sutherland
<span
>
<span
>-----Original Message-----
From: Bob Johnson
[mailto:bjohnson314@xxxxxxxxx]
Sent: Sunday, 23 May 2004 2:26
a.m.
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re: Help
with Line Array Coding for Clayburg
<font size=3
face="Times New Roman">
<font size=2 color=black
face=Arial>Try
putting your LineArray & Plot calls in a for loop after you've calculated
the x,y arrays and after you've plotted the price histogram.
<font size=2 color=black
face=Arial>I've
changed the 'extend' so it's dependent on how close to the right edge
you are.
<font size=2 color=black
face=Arial>If you
have 'extend' = 1 all the time the indicator becomes unreadable because
old plot lines extend far above & below the price chart.
<font size=3 color=green
face="Times New Roman">
<font size=2 color=black
face=Arial>/* JOHN
CLAYBURG BASED SUPPORT/RESISTANCE LINES
<font size=2 color=black
face=Arial> Coded
by GBS May 2004
<font size=2 color=black
face=Arial>/*
CATEGORY 3 SUPPORT BREAKOUT TRIGGER FOR SHORTS: */
<font size=3 color=maroon
face="Times New Roman">
<font size=2 color=black
face=Arial>LL_3_6
= Ref(L,-6) > Ref(<span
>L,-3);
<font size=2 color=black
face=Arial>LL_3_5
= Ref(L,-5) > Ref(<span
>L,-3);
<font size=2 color=black
face=Arial>LL_3_4
= Ref(L,-4) > Ref(<span
>L,-3);
<font size=2 color=black
face=Arial>LL_3_2
= Ref(L,-2) > Ref(<span
>L,-3);
<font size=2 color=black
face=Arial>LL_3_1
= Ref(L,-1) > Ref(<span
>L,-3);
<font size=2 color=black
face=Arial>LL_3_0
= L > Ref(<span
>L,-3);
<font size=3 color=maroon
face="Times New Roman">
<font size=2 color=black
face=Arial>Cat3Sup
= LL_3_6 AND LL_3_5 <span
>AND LL_3_4 AND LL_3_2 AND
LL_3_1 AND LL_3_0;
<font size=2 color=black
face=Arial>
<font size=2 color=black
face=Arial>/*
SUPPORT LINE ("SC") */
<font size=3 color=maroon
face="Times New Roman">
<font size=2 color=black
face=Arial>Cat3 =
ValueWhen(Cat3Sup,BarIndex(),1)-3;
<font size=2 color=black
face=Arial>y0=ValueWhen(Cat3Sup,Ref(<span
>L,-3),2);
<font size=2 color=black
face=Arial>y1=ValueWhen(Cat3Sup,Ref(<span
>L,-3),1);
<font size=2 color=black
face=Arial>x0=ValueWhen(Cat3Sup,BarIndex(),2)-3;
<font size=2 color=black
face=Arial>x1=ValueWhen(Cat3Sup,BarIndex(),1)-3;
<font size=3 color=maroon
face="Times New Roman">
<font size=2 color=black
face=Arial>Plot(y0,
"Trendline Bot y0", colorDefault,<span
>styleNoLine+styleOwnScale);
<font size=2 color=black
face=Arial>Plot(y1,
"Trendline Bot y1", colorBlue,<span
>styleNoLine+styleOwnScale);
<font size=2 color=black
face=Arial>Plot(x0,"x0",<span
>colorDefault,styleNoLine+styleOwnScale);
//test only to check for correct bar value
<font size=2 color=black
face=Arial>Plot(x1,"x1",<span
>colorDarkGrey,styleNoLine+styleOwnScale);
//test only to check for correct bar value
<font size=2 color=black
face=Arial>Plot(BarIndex(),"BarIndex()",<span
>colorDefault,styleNoLine+styleOwnScale);
//test only to check for correct bar value
<font size=3 color=maroon
face="Times New Roman">
<font size=2 color=black
face=Arial>Plot(<span
>C,"C", colorRed, styleCandle);
<font size=3 color=maroon
face="Times New Roman">
<font size=2
color=black face=Arial>for<span
> ( i = 7 ; i < <font
face=Arial>BarCount
; i++ ) {
<font size=2
color=black face=Arial> if ( x0[i] != x0[i-1] ) {
<font size=2
color=black face=Arial> if ( i > BarCount - 50 )
<font size=2
color=black face=Arial> extend = 1;
<font size=2
color=black face=Arial> else
<font size=2
color=black face=Arial> extend = 0;
<font size=2
color=black face=Arial> Line = LineArray( x0[i], y0[i], x1[i],
y1[i],extend,True);
<font size=2
color=black face=Arial> Plot(Line,"Cat3Sup
Line",colorDefault,styleLine);
<font size=2
color=black face=Arial> }
<font size=2
color=black face=Arial>}
<span
>----- Original Message -----
<font
size=2 face=Arial>From: <a href=""
title="gosuth@xxxxxxxxxx">Gordon Sutherland
<span
>To:<font
size=2 face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx
<span
>Sent:<font
size=2 face=Arial> Saturday,
May 22, 2004 2:27 AM
<span
>Subject:<font
size=2 face=Arial> RE:
[amibroker] Re: Help with Line Array Coding for Clayburg
<font size=3
face="Times New Roman">
<font size=3 color=black
face="Times New Roman">Hi Graham,
<font size=3
face="Times New Roman">
<font size=3 color=black
face="Times New Roman">Thanks for
prompt response.
<font size=3
face="Times New Roman">
<font size=3 color=black
face="Times New Roman">I have
changed my code as per your suggestions with the caveat that I have changed the
“+3” to “-3” because you are computing from the start
rather than the end of the data. The values for the four co-ordinates seem to
be correct when I plot them before applying the LineArray function. However,
when I activate the LineArray function (‘Line’) then
a warning pops-up “Error 2. Bad Argument(s)”. I have the
QuickAFL™ switched on but it makes no difference if I turn this feature
off!
<font size=3
face="Times New Roman">
<font size=3 color=black
face="Times New Roman">The revised
code is submitted below. I would appreciate any help as to what I am doing
wrong that will not accept the code for AutoPlot.
<font size=3
face="Times New Roman">
<span
lang=EN-NZ >/* JOHN CLAYBURG
BASED SUPPORT/RESISTANCE LINES
<span
lang=EN-NZ >
Coded by GBS May 2004
<font size=3
face="Times New Roman">
<span
lang=EN-NZ >/* CATEGORY 3
SUPPORT BREAKOUT TRIGGER FOR SHORTS: */
<span
lang=EN-NZ >LL_3_6 =
Ref(L,-6) > Ref(L,-3);
<span
lang=EN-NZ >LL_3_5 =
Ref(L,-5) > Ref(L,-3);
<span
lang=EN-NZ >LL_3_4 =
Ref(L,-4) > Ref(L,-3);
<span
lang=EN-NZ >LL_3_2 =
Ref(L,-2) > Ref(L,-3);
<span
lang=EN-NZ >LL_3_1 =
Ref(L,-1) > Ref(L,-3);
<span
lang=EN-NZ >LL_3_0
= L > Ref(L,-3);
<span
lang=EN-NZ >Cat3Sup = LL_3_6
AND LL_3_5 AND LL_3_4 AND LL_3_2 AND LL_3_1 AND LL_3_0;
<font size=3
face="Times New Roman">
<span
lang=EN-NZ >/* SUPPORT LINE
("SC") */
<span
lang=EN-NZ >Cat3 =
ValueWhen(Cat3Sup,BarIndex(),1)-3;
<span
lang=EN-NZ >y0=ValueWhen(Cat3Sup,Ref(L,-3),2);
<span
lang=EN-NZ >y1=ValueWhen(Cat3Sup,Ref(L,-3),1);
<span
lang=EN-NZ >x0=ValueWhen(Cat3Sup,BarIndex(),2)-3;
<span
lang=EN-NZ >x1=ValueWhen(Cat3Sup,BarIndex(),1)-3;
<span
lang=EN-NZ >//Line =
LineArray( x0, y0, x1, y1, 1); // Warning comes up "Error 2 - Bad
Argument(s)"
<span
lang=EN-NZ >//Plot(Line,"Cat3Sup
Line",colorDefault,1);// Dependent on "Line = LineArray..." not
working
<font size=3
face="Times New Roman">
<span
lang=EN-NZ >Plot(C,"C",
colorRed, styleCandle);
<span
lang=EN-NZ >Plot(y0,
"Trendline Bot y0", colorDefault,16);
<span
lang=EN-NZ >Plot(y1,
"Trendline Bot y1", colorBlue,1+4);
<span
lang=EN-NZ >Plot(x0,"x0",colorDefault,16);
//test only to check for correct bar value
<span
lang=EN-NZ >Plot(x1,"x1",colorDarkGrey,16);
//test only to check for correct bar value
<span
lang=EN-NZ >Plot(BarIndex(),"BarIndex()",colorDefault,16);
//test only to check for correct bar value
<font size=3
face="Times New Roman">
<font size=3 color=green
face="Times New Roman">Regards,
<font size=3 color=green
face="Times New Roman">
Gordon Sutherland
<font size=3
face="Times New Roman">
<span
>-----Original Message-----
From: Graham
[mailto:gkavanagh@xxxxxxxxxxxxx]
Sent: Saturday, 22 May 2004 4:27
p.m.
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Re: Help
with Line Array Coding for Clayburg
<font size=3
face="Times New Roman">
Tired
to sort out what you were doing, does this help you at least<font
size=2 face="Courier New">
alternative way of doing it?
Cat3 = Valuewhen(Cat3Sup,barindex(),1)+3;
x0 = Valuewhen(Cat3Sup,barindex(),2)+3;
Cheers,
Graham
http://e-wire.net.au/~eb_kavan/
-----Original Message-----
From: Gordon Sutherland [mailto:gosuth@xxxxxxxxxx]
Sent: Saturday, May 22, 2004 12:09 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Help with Line Array
Coding for Clayburg
Hi,
I am new to AB (Std Version 4.56 Beta) and I am
working on porting my custom
indicators and systems over from my previous
software (AIQ and MetaStock).
Not being very good at programming at the best of
times, I have spent
several hours trying to get the coding right to
Plot custom Trendlines using
John Clayburg’s Category 3
Support/Resistance Lines. For the Line Array
function in AB I have gotten as far as getting the
y0/y1/x1 co-ordinates
coding sorted but the final hurdle of
‘x0’ has got be beat. Any help with my
coding would be greatly appreciated. The code I
have written so far is:
/* JOHN CLAYBURG BASED CATEGORY 3
SUPPORT/RESISTANCE LINES
as discussed in his
book "Four Steps To Trading Success" /*
/* CATEGORY 3 SUPPORT LINE: */
LL_3_6 = Ref(L,-6) > Ref(L,-3);
LL_3_5 = Ref(L,-5) > Ref(L,-3);
LL_3_4 = Ref(L,-4) > Ref(L,-3);
LL_3_2 = Ref(L,-2) > Ref(L,-3);
LL_3_1 = Ref(L,-1) > Ref(L,-3);
LL_3_0 =
L > Ref(L,-3);
Cat3Sup = LL_3_6 AND LL_3_5 AND LL_3_4 AND LL_3_2
AND LL_3_1 AND LL_3_0;
/* SUPPORT LINE ("SC") */
Cat3 = BarsSince(Cat3Sup)+3;
//Fx0 = BarCount - 1 - Cat3 -
ValueWhen(Cat3Sup,BarsSince(Cat3Sup)+3,2); //
NOT WORKING CORRECTLY
Fx1 = BarCount - 1 - Cat3; /* This gives me my x0
co-ordinate */
y0=ValueWhen(Cat3Sup,Ref(L,-3),2);
y1=ValueWhen(Cat3Sup,Ref(L,-3),1);
//x0=BarCount - 1 - ValueWhen(Cat3Sup,Cat3,2); //
NOT WORKING CORRECTLY
x1=BarCount - 1 - Cat3;
//Line = LineArray( x0, y0, x1, y1, 1 ); //
Pending sorting the x0 coding
out
Plot(C,"C", colorRed, styleCandle);
Plot(y0, "Trendline Bot y0",
colorDefault,16);
Plot(y1, "Trendline Bot y1",
colorBlue,1+4);
//Plot(???,"",colorDefault,16);
// Dependent on sorting Coding on
co-ordinate x0
//Plot(Cat3,"",colorDarkGrey,16); //
Working OK
TIA,
Regards,
Gordon Sutherland
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send 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
Yahoo! Groups Sponsor
ADVERTISEMENT
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
the Yahoo! Terms of Service.
Send BUG
REPORTS to bugs@xxxxxxxxxxxxx<span
>
Send 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
Send
BUG REPORTS to bugs@xxxxxxxxxxxxx<font size=2
face="Courier New">
Send 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
<font size=3
face="Times New Roman">
Send
BUG REPORTS to bugs@xxxxxxxxxxxxx<font size=2
face="Courier New">
Send 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
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
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 the Yahoo! Terms of Service.
|