[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Equity(2) questions



PureBytes Links

Trading Reference Links









<span
>Hi Graham,

<span
> 

<span
>Thanks for prompt response.

<span
> 

<span
>I have changed my code as per your suggestions
with the caveat that I have changed the &#8220;+3&#8221; to &#8220;-3&#8221;
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  (&#8216;Line&#8217;)  then  a warning pops-up &#8220;Error
2. Bad Argument(s)&#8221;. I have the QuickAFL&#8482; switched on but it makes
no difference if I turn this feature off!

<span
> 

<span
>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.

<span
> 

<span
lang=EN-NZ >/* JOHN CLAYBURG
BASED SUPPORT/RESISTANCE LINES

<span
lang=EN-NZ >            
Coded by GBS May 2004

<span
lang=EN-NZ > 

<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;

<span
lang=EN-NZ > 

<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

<span
lang=EN-NZ > 

<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



<span
> 

<span
>Regards,

<span
>
Gordon Sutherland



<span
> 

<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"> 

<font size=2
face="Courier New">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&#8217;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
&#8216;x0&#8217; 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
&#8226; To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
  
&#8226; To unsubscribe from this group, send an
email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
  
&#8226; 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
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 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.