Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 05-24-2009, 09:59 PM   #1

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

IFF (EasyLanguage Function)

IFF (EasyLanguage Function)

This thread is about the EasyLanguage Function IFF.



The IFF function is used to conditionally return one of two specified numeric values.


Syntax

IFF( Test, TrueVal, FalseVal )


Returns (Double)

The numeric value of TrueVal if Test is true
and the numeric value of FalseVal if Test is false.


Parameters

Test

Specifies a conditional expression to check (such as Close > Open).

TrueVal

Sets a numeric value to return if Test expression is true.

FalseVal

Sets a numeric value to return if Test expression is false.


Remarks

By using the IFF function, you are able to evaluate one or more conditions in the Test input expression, returning one
numeric value if Test is true, and returning another numeric value if Test is false.


Example

Assigns to Value1 the number 1 if Close>Open is true or the number -1 if Close>Open is false.

Value1 = IFF( Close>Open, 1, -1 );


Reference

The IFF function was developed by tradestation Technologies, Inc.



source: EasyLanguage manual

Last edited by Tams; 05-24-2009 at 10:44 PM.
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
aaa (05-30-2009)
Old 05-24-2009, 10:08 PM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: IFF (EasyLanguage Function)

The code inside the IFF function:

Code:
inputs: 
Test( truefalsesimple ), 
TrueVal( numericsimple ), 
FalseVal( numericsimple ) ;

if Test then
	IFF = TrueVal 
else 
	IFF = FalseVal ;
Tams is offline  
Reply With Quote
The Following 2 Users Say Thank You to Tams For This Useful Post:
aaa (05-30-2009), Trader333 (05-25-2009)

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can function in TS8 return array? ImXotep Technical Analysis 5 05-25-2009 02:13 AM
ADX Easylanguage Code Without Calling a Function Frank Coding Forum 1 02-08-2009 09:39 PM
Breakeven function on OEC Trader popstocks Open E Cry 3 02-03-2009 12:17 PM
[Site Update] Attachment Function Updated Soultrader Announcements 2 01-05-2009 08:23 AM
Januson Function Library januson Trading Indicators 0 11-28-2008 06:19 PM

All times are GMT -4. The time now is 01:17 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.