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

[EquisMetaStock Group] Re: How many IF() functions can I nest in a custom indicator??



PureBytes Links

Trading Reference Links



I have no idea!  But, if you are working with a complex lot of IF
statements (also true for spreadsheets) it is often better to use
boolean algebra in the following way:

 ( CLOSE > 10 ) * 1 - ( CLOSE <= 10 ) * 1

This will plot a 1 if the close is above and a -1 if the close is
equal to or below 10.  It sure is a lot easier to handle than many
IF statements.  If you want to plot say a 10 or a 5, change it to

 ( CLOSE > 10 ) * 10 + ( CLOSE <= 10 ) * 5

If you have a lot of requirements, just keep on multiplying.  Say
the close must be above 10 and below 20, then do

 ( CLOSE > 10 ) * ( CLOSE < 20 ) * 1

and so on.  You can add, I guess, more of these than of the if stuff.

Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://tsatsaeod.ferra4models.com
http://www.ferra4models.com




--- In equismetastock@xxxxxxxxxxxxxxx, "Mike Sloane" <mfsloane@xxxx>
wrote:
> I am sure someone out there knows the answer off the top of their head.
>  
> How many IF() functions can I nest in a custom indicator??
>  
> Thanks in advance,
> Mike Sloane








------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/