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

Re: QRe: [amibroker] OT: monitor query



PureBytes Links

Trading Reference Links

Gary,
there is not any other language behind. Some logic rules like
1.
AND truth table is equivalent to the multiplication of binary 
quantities.
1*0=0*1=0*0=0
1*1=1
2.
For a binary COND
IIF(COND,A,B) is equivalent to COND*A+(NOT(COND))*B

There is no reason to step into vector spaces, it will not be that 
simple anymore, we should use linear independence [and it is not 
always obvious...]
Dimitris Tsokakis
PS.I am not a programmer, I have not the slightest idea of any 
programming language, just some AFL to do the job, nothing more.
--- In amibroker@xxxxxxxxxxxxxxx, "Gary A. Serkhoshian" 
<serkhoshian777@xxxx> wrote:
> Dimitris,
>  
> Very cool.  Thanks for the code tip. Did you pick up these 
shortcuts coding in another language?  It hadn't even occurred to me, 
but my friend always points out that vector math is much faster than 
looping as I'm sure your code will demonstrate.
>  
> Kind Regards,
> Gary
> 
> DIMITRIS TSOKAKIS <TSOKAKIS@xxxx> wrote:
> Gary,
> If you want to avoid IIFs and ANDs, then multiply the conditions 
and 
> add the colors.
> 
> VAL1=RSI();Plot(VAL1," RSI",1,8);
> COLOR=
> (VAL1<30)*colorBlack+
> (VAL1>=30)*(VAL1<40)*colorRed+
> (VAL1>=40)*(VAL1<50)*colorOrange+
> (VAL1>=50)*(VAL1<60)*colorYellow+
> (VAL1>=60)*(VAL1<70)*colorBrightGreen+
> (VAL1>=70)*colorWhite;
> Plot( 10, "Ribbon", COLOR,styleOwnScale|styleArea|styleNoLabel,2, 
> 100 ); 
> 
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "Gary A. Serkhoshian" 
> <serkhoshian777@xxxx> wrote:
> > Hi David,
> >  
> > You need to account for ranges in your IIFs as you never 
specified 
> what happens if Trin < 0.60.
> >  
> > The code below should send you in the right direction:
> >  
> > //Trin Barometer// 
> > Val1 = Foreign("$Trin","c"); 
> > 
> > Plot( 100, "Ribbon", 
> >    IIf( Val1< 0.80, colorDarkGreen, 
> >    IIf( Val1>= 0.80 AND Val <= 0.95, colorBrightGreen, 
> >    IIf( Val1 > 0.95 AND Val1 <= 1.05, colorYellow , 
> >    IIf( Val1 > 1.05 AND Val1 < 1.10, colorOrange, colorRed)))), 
> >    styleOwnScale|styleArea|styleNoLabel, -0.5, 100 ); 
> > 
> > Hope this Helps,
> > Gary
> >  
> >  
> >  
> > 
> > wooziwog <xcitemint@xxxx> wrote:
> > I am new to AFL code and have failed at getting the following 
> formula 
> > to work.  I am trying to create a ribbon that will change colors 
> > determined by the Trin reading.  I can get it to work with two 
> colors 
> > but am having problems with multi colors.  I appreciate any help 
> you 
> > can give.
> > 
> > David K.
> > 
> > //Trin Barometer//
> > Val1 = Foreign("$Trin","c");
> > 
> > Plot( 100, Ribbon", 
> > IIf( val1>.60, colorDarkGreen, 
> > IIf( Val1>.80, colorBrightGreen, 
> > IIf( Val1>.95, colorYellow , 
> > IIf(val1>1.05,colorOrange, 
> > IIf( Val1>1.10, colorRed, 
> > ) ) ) ) )) ,
> > styleOwnScale|styleArea|styleNoLabel, -0.5, 100 ); 
> > 
> > 
> > 
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > 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 SponsorADVERTISEMENT
> > 
> > 
> > ---------------------------------
> > 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. 
> > 
> > 
> > 
> > ---------------------------------
> > Do you Yahoo!?
> > Yahoo! Finance Tax Center - File online. File on time.
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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. 
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.



------------------------ 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/