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

[amibroker] Re: What's wrong with this formula?



PureBytes Links

Trading Reference Links





Try this.  I use it, it works.  Just 
modify the sound files.
Gernot
 
//T3 Crossover<FONT 
face="Courier New" color=#800000 size=1>
function T3(price,periods) 
{
s = Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"a",<FONT 
face="Courier New" color=#ff00ff size=1>0.7<FONT face="Courier New" 
size=1>,0.1<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>2.0,<FONT 
face="Courier New" color=#ff00ff size=1>0.1<FONT face="Courier New" 
size=1>);
e1=EMA<FONT 
face="Courier New" size=1>(price,periods);
e2=EMA<FONT 
face="Courier New" size=1>(e1,Periods);
e3=EMA<FONT 
face="Courier New" size=1>(e2,Periods);
e4=EMA<FONT 
face="Courier New" size=1>(e3,Periods);
e5=EMA<FONT 
face="Courier New" size=1>(e4,Periods);
e6=EMA<FONT 
face="Courier New" size=1>(e5,Periods);
c1=-s*s*s;
c2=3<FONT 
face="Courier New" size=1>*s*s+<FONT face="Courier New" color=#ff00ff 
size=1>3*s*s*s;
c3=-6<FONT 
face="Courier New" size=1>*s*s-<FONT face="Courier New" color=#ff00ff 
size=1>3*s-<FONT 
face="Courier New" color=#ff00ff size=1>3<FONT face="Courier New" 
size=1>*s*s*s;
c4=1<FONT 
face="Courier New" size=1>+<FONT face="Courier New" color=#ff00ff 
size=1>3*s+s*s*s+<FONT 
face="Courier New" color=#ff00ff size=1>3<FONT face="Courier New" 
size=1>*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;<FONT face="Courier New" 
color=#800000 size=1>
return ti3;
}<FONT 
face="Courier New" size=1>
p1 = Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Period 1st T3",<FONT 
face="Courier New" color=#ff00ff size=1>3<FONT face="Courier New" 
size=1>,2<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>100,<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
p2 = Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Period 2nd T3",<FONT 
face="Courier New" color=#ff00ff size=1>5<FONT face="Courier New" 
size=1>,2<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>100,<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
p3 = Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Period 3rd T3",<FONT 
face="Courier New" color=#ff00ff size=1>8<FONT face="Courier New" 
size=1>,2<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>100,<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
p4 = Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Period 4th T3",<FONT 
face="Courier New" color=#ff00ff size=1>13<FONT face="Courier New" 
size=1>,2<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>100,<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
p5 = Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Period 5th T3",<FONT 
face="Courier New" color=#ff00ff size=1>21<FONT face="Courier New" 
size=1>,2<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>100,<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
p6 = Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Period 6th T3",<FONT 
face="Courier New" color=#ff00ff size=1>34<FONT face="Courier New" 
size=1>,0<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>100,<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="Courier New" 
size=1>);
Col1=Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Color 1st T3",<FONT 
face="Courier New" color=#ff00ff size=1>27<FONT face="Courier New" 
size=1>,1<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>54,<FONT face="Courier New" 
color=#ff00ff size=1>1);
Col2=Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Color 2nd T3",<FONT 
face="Courier New" color=#ff00ff size=1>6<FONT face="Courier New" 
size=1>,1<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>54,<FONT face="Courier New" 
color=#ff00ff size=1>1);
Col3=Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Color 3rd T3",<FONT 
face="Courier New" color=#ff00ff size=1>11<FONT face="Courier New" 
size=1>,1<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>54,<FONT face="Courier New" 
color=#ff00ff size=1>1);
Col4=Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Color 4th T3",<FONT 
face="Courier New" color=#ff00ff size=1>10<FONT face="Courier New" 
size=1>,1<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>54,<FONT face="Courier New" 
color=#ff00ff size=1>1);
Col5=Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Color 5th T3",<FONT 
face="Courier New" color=#ff00ff size=1>7<FONT face="Courier New" 
size=1>,1<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>54,<FONT face="Courier New" 
color=#ff00ff size=1>1);
Col6=Param<FONT 
face="Courier New" size=1>(<FONT face="Courier New" color=#ff00ff 
size=1>"Color 6th T3",<FONT 
face="Courier New" color=#ff00ff size=1>4<FONT face="Courier New" 
size=1>,1<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>54,<FONT face="Courier New" 
color=#ff00ff size=1>1);<FONT 
face="Courier New" color=#0000ff size=1>
Plot(T3(C,p1),<FONT 
face="Courier New" color=#ff00ff size=1>"T3(3)"<FONT face="Courier New" 
size=1>,col1,styleThick);<FONT face="Courier New" 
color=#0000ff size=1>
Plot(T3(C,p2),<FONT 
face="Courier New" color=#ff00ff size=1>"T3(5)"<FONT face="Courier New" 
size=1>,col2,styleThick);<FONT face="Courier New" 
color=#0000ff size=1>
Plot(T3(C,p3),<FONT 
face="Courier New" color=#ff00ff size=1>"T3(8)"<FONT face="Courier New" 
size=1>,col3,styleThick);<FONT face="Courier New" 
color=#0000ff size=1>
Plot(T3(C,p4),<FONT 
face="Courier New" color=#ff00ff size=1>"T3(13)"<FONT face="Courier New" 
size=1>,col4,styleThick);<FONT face="Courier New" 
color=#0000ff size=1>
Plot(T3(C,p5),<FONT 
face="Courier New" color=#ff00ff size=1>"T3(21)"<FONT face="Courier New" 
size=1>,col5,styleThick);<FONT face="Courier New" 
color=#0000ff size=1>
Plot(T3(C,p6),<FONT 
face="Courier New" color=#ff00ff size=1>"T3(34)"<FONT face="Courier New" 
size=1>,col6,styleDots);

GraphXSpace=<FONT face="Courier New" color=#0000ff 
size=1>Param(<FONT 
face="Courier New" color=#ff00ff size=1>"GraphXSpace"<FONT 
face="Courier New" size=1>,<FONT face="Courier New" color=#ff00ff 
size=1>1,-<FONT face="Courier New" 
color=#ff00ff size=1>10,<FONT 
face="Courier New" color=#ff00ff size=1>10<FONT face="Courier New" 
size=1>,0.5<FONT 
face="Courier New" size=1>);
T3p1=T3(C,p1);
T3p2=T3(C,p2);
T3p3=T3(C,p3);
T3p4=T3(C,p4);
T3p5=T3(C,p5);
T3p6=T3(C,p6);
Buy=<FONT face="Courier New" color=#0000ff 
size=1>Cross(T3p1,T3p2);
Sell=<FONT face="Courier New" color=#0000ff 
size=1>Cross(T3p2,T3p1);<FONT 
face="Courier New" color=#0000ff size=1>
PlotShapes(<FONT 
face="Courier New" color=#0000ff size=1>IIf<FONT face="Courier New" 
size=1>(Buy,shapeUpArrow,shapeNone) 
,colorBrightGreen,<FONT face="Courier New" color=#ff00ff 
size=1>0,Graph0,-<FONT 
face="Courier New" color=#ff00ff size=1>15<FONT face="Courier New" 
size=1>);
PlotShapes(<FONT 
face="Courier New" color=#0000ff size=1>IIf<FONT face="Courier New" 
size=1>(Sell,shapeDownArrow,shapeNone),colorRed,<FONT 
face="Courier New" color=#ff00ff size=1>0<FONT face="Courier New" 
size=1>,Graph1,-<FONT face="Courier New" color=#ff00ff 
size=1>15);<FONT 
face="Courier New" color=#0000ff size=1>
AlertIf( Buy, <FONT 
face="Courier New" color=#ff00ff size=1>"SOUND C:\\Amibroker\\Sounds\\buy 
alert.wav", <FONT 
face="Courier New" color=#ff00ff size=1>"Audio alert"<FONT 
face="Courier New" size=1>, <FONT face="Courier New" color=#ff00ff 
size=1>1 );<FONT 
face="Courier New" color=#0000ff size=1>
AlertIf( Sell, <FONT 
face="Courier New" color=#ff00ff size=1>"SOUND C:\\Amibroker\\Sounds\\sell 
alert.wav", <FONT 
face="Courier New" color=#ff00ff size=1>"Audio alert"<FONT 
face="Courier New" size=1>, <FONT face="Courier New" color=#ff00ff 
size=1>2 );
Title=<FONT face="Courier New" 
color=#0000ff size=1>Name()+<FONT 
face="Courier New" color=#ff00ff size=1>" "<FONT face="Courier New" 
size=1>+<FONT face="Courier New" color=#0000ff 
size=1>EncodeColor(col1)+<FONT 
face="Courier New" color=#ff00ff size=1>"T3("<FONT face="Courier New" 
size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal(p1,<FONT 
face="Courier New" color=#ff00ff size=1>1.0<FONT face="Courier New" 
size=1>)+") = "<FONT 
face="Courier New" size=1> +<FONT face="Courier New" color=#0000ff 
size=1>WriteVal(T3p1,<FONT 
face="Courier New" color=#ff00ff size=1>1.4<FONT face="Courier New" 
size=1>)+", 
"
+EncodeColor<FONT 
face="Courier New" size=1>(col2)+<FONT face="Courier New" color=#ff00ff 
size=1>"T3("+<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(p2,1.0<FONT 
face="Courier New" size=1>)+<FONT face="Courier New" color=#ff00ff 
size=1>") = " +<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(T3p2,<FONT face="Courier New" color=#ff00ff 
size=1>1.4)+<FONT 
face="Courier New" color=#ff00ff size=1>", "<FONT face="Courier New" 
size=1>
+EncodeColor<FONT 
face="Courier New" size=1>(col3)+<FONT face="Courier New" color=#ff00ff 
size=1>"T3("+<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(p3,1.0<FONT 
face="Courier New" size=1>)+<FONT face="Courier New" color=#ff00ff 
size=1>") = " +<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(T3p3,<FONT face="Courier New" color=#ff00ff 
size=1>1.4)+<FONT 
face="Courier New" color=#ff00ff size=1>", "<FONT face="Courier New" 
size=1>
+EncodeColor<FONT 
face="Courier New" size=1>(col4)+<FONT face="Courier New" color=#ff00ff 
size=1>"T3("+<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(p4,1.0<FONT 
face="Courier New" size=1>)+<FONT face="Courier New" color=#ff00ff 
size=1>") = " +<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(T3p4,<FONT face="Courier New" color=#ff00ff 
size=1>1.4)+<FONT 
face="Courier New" color=#ff00ff size=1>", "<FONT face="Courier New" 
size=1>
+EncodeColor<FONT 
face="Courier New" size=1>(col5)+<FONT face="Courier New" color=#ff00ff 
size=1>"T3("+<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(p5,1.0<FONT 
face="Courier New" size=1>)+<FONT face="Courier New" color=#ff00ff 
size=1>") = " +<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(T3p5,<FONT face="Courier New" color=#ff00ff 
size=1>1.4)+<FONT 
face="Courier New" color=#ff00ff size=1>", "<FONT face="Courier New" 
size=1>
+EncodeColor<FONT 
face="Courier New" size=1>(col6)+<FONT face="Courier New" color=#ff00ff 
size=1>"T3("+<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(p6,1.0<FONT 
face="Courier New" size=1>)+<FONT face="Courier New" color=#ff00ff 
size=1>") = " +<FONT 
face="Courier New" color=#0000ff size=1>WriteVal<FONT face="Courier New" 
size=1>(T3p6,<FONT face="Courier New" color=#ff00ff 
size=1>1.4);
 
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=bruiserbbq@xxxxxxxxxxxx 
  href="">bruiserbbq 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, April 28, 2004 9:05 
  PM
  Subject: [amibroker] Re: What's wrong 
  with this formula?
  <FONT face=Arial 
  size=2>No luck with this one either:function 
  T3(price,len,amp){s = amp;e1=EMA(price,len); 
  e2=EMA(e1,len);e3=EMA(e2,len); e4=EMA(e3,len);e5=EMA(e4,len); 
  e6=EMA(e5,len);c1=-s*s*s; c2=3*s*s+3*s*s*s;c3=-6*s*s-3*s-3*s*s*s; 
  c4=1+3*s+s*s*s+3*s*s;Ti3=c1*e6+c2*e5+c3*e4+c4*e3;return 
  ti3;T3A = T3(C,3);T3B = T3(C,9);Buy = 
  Cross(T3A,T3B);AlertIf( Buy, "SOUND C:\\Program 
  Files\\ahead\\Nero\\Beeth9th.wav", "Audio alert", 2 );Line 12, 
  Column 3:Ti3=c1*e6+c2*e5+c3*e4+c4*e3;return 
  ti3;T3A--^Error 23.Syntax 
  errorSend 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 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.