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

[amibroker] Re: writeif in functions ?



PureBytes Links

Trading Reference Links

Tired to sort out what you were doing, does this help you at least
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: 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. 



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->

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:
     http://docs.yahoo.com/info/terms/