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

RE: [amibroker] Hold cond1 true then buy when cond2 happens



PureBytes Links

Trading Reference Links

The posted codes work without error, perhaps some wrapping problem 
cause the "syntax error" you see.
Anyway, for your code you may arrange like this

P=C; Plot(C,"C",colorBlack,styleCandle);
Periods = Param("Time Periods",10,1,1000,1); 
Direction=P-Ref(P,-periods);
Volatility=Sum(abs(P-Ref(P,-1)),periods);
Volatility=IIf(Volatility>0,Volatility,0.00001);
ER=abs(Direction/Volatility);
//1st
FastSC=2/(2+1);
SlowSC=2/(30+1);
SSC=ER* (FastSC-SlowSC)+SlowSC;
Constant=SSC^2;
Plot(AMA(P,Constant),"KAMA",colorRed,styleLine);
//2nd
FastSC=2/(3+1);
SlowSC=2/(40+1);
SSC=ER* (FastSC-SlowSC)+SlowSC;
Constant=SSC^2;
Plot(AMA(P,Constant),"KAMA",colorYellow,styleLine);
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "traderix2003" <d.adam@xxxx> wrote:
> Attn. Dimitris Tsokakis
> 
> Thank you, but I have "syntax error".Here is the formula I have 
> (only for one Kama):                   
> P=C;                                                           
> Periods = Param("Time Periods",10,1,1000,1); Direction=P-Ref(P,-
> periods);
> Volatility=Sum(abs(P-Ref(P,-1)),periods);
> Volatility=IIf(Volatility>0,Volatility,0.00001);
> ER=abs(Direction/Volatility);
> FastSC=2/(2+1);
> SlowSC=2/(30+1);
> SSC=ER* (FastSC-SlowSC)+SlowSC;
> Constant=SSC^2;
> Plot(AMA(P,Constant),"KAMA",colorRed,styleLine);
> Plot(C,"C",colorBlack,styleCandle);
> 
> ):



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/