Welcome to the Traders Laboratory Forums.
Technical Analysis The technical discussion forum for traders.

Reply
Old 04-10-2007, 03:28 PM   #1

Join Date: Jan 2007
Location: Moscow
Posts: 23
Ignore this user

Thanks: 0
Thanked 2 Times in 1 Post



Exclamation Can function in TS8 return array?

I need help in EasyLanguage. Can user function in TradeStation 8 return array. If can, then how?
Thx.
ImXotep is offline  
Reply With Quote
Old 04-10-2007, 04:25 PM   #2

Join Date: Oct 2006
Location: Houston
Posts: 92
Ignore this user

Thanks: 3
Thanked 6 Times in 5 Posts



Re: Can function in TS8 return array?

ImXotep,
yes, it can return an array. Look at example from TS user guide, search for SortArray, open it and see how it work.

weiwei
weiwei is offline  
Reply With Quote
Old 04-10-2007, 04:57 PM   #3

Join Date: Jan 2007
Location: Moscow
Posts: 23
Ignore this user

Thanks: 0
Thanked 2 Times in 1 Post



Re: Can function in TS8 return array?

ok. i will find it. THX!
ImXotep is offline  
Reply With Quote
Old 04-10-2007, 05:08 PM   #4

Join Date: Jan 2007
Location: Moscow
Posts: 23
Ignore this user

Thanks: 0
Thanked 2 Times in 1 Post



Re: Can function in TS8 return array?

Sorry, i'm don't see this example in this guide:
Sorts the values of a one-dimensional array in either ascending or descending order based on the specified inputs.

Note All array-based function calculations begin with array element 1.

Function
SortArray(PriceArray, Size, HiLo)

Parameters
PriceArray
The name of a declared numeric array to sort.

Size
The number of data elements (size) of the array, starting with element 1, to include in the sort.

HiLo
1 = sort descending, -1 = sort ascending


Returns
SortArray always returns 1. It will sort the values of the specified array elements in order based on the HiLo input.

and all!
ImXotep is offline  
Reply With Quote
Old 04-10-2007, 06:22 PM   #5

Join Date: Oct 2006
Location: Houston
Posts: 92
Ignore this user

Thanks: 3
Thanked 6 Times in 5 Posts



Re: Can function in TS8 return array?

In TS, click on file=>open Easylanguage Doc, then open SortArray function. It will show you how TS return a function.

Basically it is treated as procedure to return array as a variable.

weiwei
weiwei is offline  
Reply With Quote
Old 05-25-2009, 03:13 AM   #6

Join Date: Feb 2009
Location: Burnaby
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts



Re: Can function in TS8 return array?

the best way to return an array is to go for return as reference. please find the example function (called exfun) below.

//----------------------------------//
inputs: inarray[M](numericarrayref);
//EL code//

//end EL code//
exfun=1;


//note: M is length of array, and inarray is returned as by reference. Also, exfun=1 is required or else you will get an error from TS saying that you haven't assign a value to the function. Hope this helps!
tcyue1984 is offline  
Reply With Quote

Reply

Tags
array, function

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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