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

Re: [amibroker] Problem using LineArray



PureBytes Links

Trading Reference Links

Dimitris,
I have included the complete code that I am using. I will include
complete code in any future posts now that I understand your process
for helping us. Thanks for you help.

David K.


_N(Timeinterval = WriteIf(Interval()==86400,"Daily",
							WriteIf
(Interval()==432000,"Weekly",
							WriteIf
(Interval()==2160000,"Monthly",
							WriteIf
(Interval()==60, "1 Min", WriteVal(Interval()/60,1.0)+" Mins")))));
//+	WriteVal(DateTime(),formatDateTime)	
_N( Title  = Name()
		+ "  " + Timeinterval
      + "  " + Date()
+ "  Open:" + WriteVal(O,1.4)
      + "  High:" + WriteVal(H,1.4)
      + "  Low:" + WriteVal(L,1.4)
      + "  Close:" + WriteVal(C,1.4)
      + "  Volume:" + WriteVal(V,1.0)
      + WriteIf(C>=O, EncodeColor(colorGreen), EncodeColor
(colorRed)));
 	 
//*Bar Chart*//
Plot(C,"Open="+WriteVal(O,1.4)+",High="+WriteVal(H,1.4)
+",Low="+WriteVal(L,1.4)+",Close="+WriteVal(C,1.4),20,128,1.4);

//Colored OHLC Average*//
HaClose=(O+H+L+C)/4; 
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); 
HaHigh = Max( H, Max( HaClose, HaOpen ) ); 
HaLow = Min( L, Min( HaClose, HaOpen ) ); 

PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" , colorBlack, 
styleCandle+styleNoLabel );


///////////////// PRSI ///////////////////

function PRSI(price,eper,wper)
{

Value = EMA( RSI( wper ), eper );
AUC = Wilders( Max( price - Ref( price, -1 ), 0 ), wper );
ADC = Wilders( Max( Ref( price, -1 ) - price, 0 ), wper );
x = ( wper - 1 )*( ADC * Value/(100-Value)-AUC); 
PRSIP = IIf( x >= 0, price + x, price + x*(100-Value)/Value );

return PRSIP;
}





//////////////////////////////////////
//* Ti3 Average *//
function T3(price,periods,s)
{
e1=EMA(price,periods);
e2=EMA(e1,Periods);
e3=EMA(e2,Periods);
e4=EMA(e3,Periods);
e5=EMA(e4,Periods);
e6=EMA(e5,Periods);
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;
}
//The following "Param" includes(name,period,Min,Max,Step)and 
provides price period for t3*//
//pd1=Param("Long",18,2,500,1);
//The following statement includes (function(price,period,"s" )for 
function & Function name*//
//Plot(t3(C,pd1,0.71),"T3 "+"("+WriteVal(pd1,1.0)
+")",colorYellow,1|styleThick);





///////////////////////////////////////
PCLG=PRSI(C,100,150);
Plot(PCLG,"",colorBrightGreen,styleThick);

PCS2=PRSI(C,3,3);
psp=Param("psp",5,2,500,1);
PST=(t3(PCS2,psp,1.0));
Plot(pst,"",colorBlue,styleThick);

PCLR=PRSI(C,100,30);
psr=Param("psr",10,2,500,1);
PSRL=(t3(PCLR,psr,0.94));
Plot(psrl,"",colorRed,styleThick);

PCS=PRSI(C,43,50);
PCSW=(pcs+pcs2)/2;
psw=Param("psw",7,2,500,1);
PSWL=(t3(pcsw,psw,0.94));
Plot(pswl,"",colorWhite,styleThick);

LR1=LinearReg(C,23);
Plot(Lr1,"",colorYellow,styleThick+styleNoLabel);

PCLR1=PRSI(C,200,230);
psr1=Param("psr1",7,2,500,1);
PSRL1=(t3(PCLR1,psr1,0.94));
Plot(psrl1,"",colorBlack,styleThick);


bls=BarsSince( psrl1 > H );
bgs=BarsSince( pclg > H );
bus=BarsSince( pst > H );
res=BarsSince( psr1 > H );
whs=BarsSince( pswl > H );
yes=BarsSince( Lr1 > H );
Sellsig=(bls+bgs+bus+res+whs+yes);

blb=BarsSince( psrl1 < H );
bgb=BarsSince( pclg < H );
bub=BarsSince( pst < H );
reb=BarsSince( psr1 < H );
whb=BarsSince( pswl < H );
yeb=BarsSince( Lr1 < H );
Buysig=(blb+bgb+bub+reb+whb+yeb);


Filter=1;
Sell=(Buysig<30);
PlotShapes(shapeDownArrow*Sell,colorRed);
GraphXSpace=5;
AddColumn(Buysig,"BuySignal");
AddColumn(Sellsig,"SellSignal");




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/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/