Strategy.isLong()

ICE Data Services -

Strategy.isLong() Back Testing Functions

isLong() is a method of the Strategy Object that returns a Boolean (true/false) value to indicate that the strategy is currently holding a long position.  The Strategy Object is for back testing purposes only and is not intended for real time trading.

 

Syntax

Strategy .isLong( )


Parameters

N/A


Return Value(s)

Boolean (true/false)

 

Notes

Strategy.isLong() returns true if a long position is currently being held.  This method is a logic function used to control back testing logic within conditional statements.  For example, a user may want to check to see if the strategy is currently in a long position before evaluating a long exit condition. 


Code Examples

function main()  {
	if (Strategy.isLong() == true) {
	    // Evaluate long exit condition	
	    if (/* Your Exit Condition */) {
	        //Strategy.doSell(...);	
	        }	
	    
	} 
}
 
See Also

 

Back Testing Functions
EFS Library:  Back Testing
Strategy Analyzer
eSignal Bulletin Board Search Engine
Help Guides and Tutorials