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

Re: [amibroker] T3 Question



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>Rakesh,
One 
way would be to make your indicator a function then call the function as many 
times as you wish in as many plot statements as you need. Here is an example of 
a function for the tillson indicator that was discussed at length by Dt a few 
weeks ago. Note the plot lines at the end of the code where Ti3 is called using 
different parameters....
 
Regards,Jayson 
 
//the Ti3 average
function<FONT color=#282828 
size=2> T3(price,periods,s)
{
e1=<FONT face=Arial 
color=#0000ff size=2>EMA<FONT face=Arial 
color=#0000ff>(price,periods);
e2=<FONT face=Arial 
color=#0000ff size=2>EMA<FONT face=Arial 
color=#0000ff>(e1,Periods);
e3=<FONT face=Arial 
color=#0000ff size=2>EMA<FONT face=Arial 
color=#0000ff>(e2,Periods);
e4=<FONT face=Arial 
color=#0000ff size=2>EMA<FONT face=Arial 
color=#0000ff>(e3,Periods);
e5=<FONT face=Arial 
color=#0000ff size=2>EMA<FONT face=Arial 
color=#0000ff>(e4,Periods);
e6=<FONT face=Arial 
color=#0000ff size=2>EMA<FONT face=Arial 
color=#0000ff>(e5,Periods);
c1=-s*s*s;
c2=<FONT 
color=#0000ff>3*s*s+<FONT 
size=2>3<FONT face=Arial 
color=#0000ff>*s*s*s;
c3=-<FONT 
color=#0000ff>6*s*s-<FONT 
size=2>3*s-3<FONT 
color=#282828 size=2>*s*s*s;
c4=<FONT 
color=#0000ff>1+<FONT 
size=2>3*s+s*s*s+<FONT 
size=2>3<FONT face=Arial 
color=#0000ff>*s*s;
<FONT face=Arial 
color=#0000ff>Ti3=c1*e6+c2*e5+c3*e4+c4*e3;<FONT 
color=#800000 size=2>
return<FONT color=#282828 
size=2> ti3;
}
pd1=<FONT 
color=#0000ff>Param(<FONT 
size=2>"Long",40<FONT 
size=2>,10,<FONT 
size=2>100,1<FONT 
color=#282828 size=2>);
pd2=<FONT 
color=#0000ff>Param(<FONT 
size=2>"Short" ,10<FONT 
size=2>,5,<FONT 
size=2>50,1<FONT color=#282828 
size=2>);
Plot<FONT color=#282828 
size=2>(t3(C<FONT 
color=#282828 size=2>,pd1,.71),"T3 
" +<FONT color=#ff00ff 
size=2>"("+<FONT color=#0000ff 
size=2>WriteVal(pd1,<FONT color=#ff00ff 
size=2>1.0)+<FONT color=#ff00ff 
size=2>")",<FONT 
size=2>colorYellow<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>|styleThick<FONT color=#282828 
size=2>);
Plot<FONT color=#282828 
size=2>(t3(C<FONT 
color=#282828 size=2>,pd2,.74),<FONT color=#ff00ff 
size=2>"T3" +<FONT color=#ff00ff 
size=2>"("+<FONT color=#0000ff 
size=2>WriteVal(pd2,<FONT color=#ff00ff 
size=2>1.0)+<FONT color=#ff00ff 
size=2>")",<FONT 
size=2>colorBlue<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>|styleThick<FONT color=#282828 
size=2>);

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Rakesh Sahgal 
  [mailto:rakeshsahgal@xxxxxxxxx]Sent: Tuesday, April 13, 2004 10:50 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
  Param Question
  Group
   
  Can someone please explain how I should go about plotting multiple 
  instances of an indicator with differing parameters in the same chart 
  pane?
   
  In simple words lets say an oscillator of EMAs' of periodicities 
  3&10, 5&35 etc etc.The paremters are not predefined but are manually 
  entered.
   
  TIA
   
  Rakesh
   
   
  
  
  Do you Yahoo!?Yahoo! Tax Center - <A 
  href="">File online by April 15th 
  Send 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: <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.