Any Idea (Please) How to....

evostik

Well-known member
Messages
337
Likes
7
Hi All

In terms of automation, let's say we have a version of 'N Min Change' so we have a real-time list of (say) the strongest 3 stocks in our list. We then get a 'Go Long' signal from whatever we are using to decide the market direction. Putting aside other issues, for now, how can we identify these top three stocks in EeasyLanguage? From my limited knowledge, we can sort the 'ATR' values into the correct order by putting them in an Array and using a 'sort'; but in doing this we lose the stock symbol because this is a string.

I guess I have explained this really badly but if anyone can work out what I am talking about then any help would be much appreciated.

Thanks
Steve
 
Hi All

In terms of automation, let's say we have a version of 'N Min Change' so we have a real-time list of (say) the strongest 3 stocks in our list. We then get a 'Go Long' signal from whatever we are using to decide the market direction. Putting aside other issues, for now, how can we identify these top three stocks in EeasyLanguage? From my limited knowledge, we can sort the 'ATR' values into the correct order by putting them in an Array and using a 'sort'; but in doing this we lose the stock symbol because this is a string.

I guess I have explained this really badly but if anyone can work out what I am talking about then any help would be much appreciated.

Thanks
Steve
The easiest way is to use Global Variables. Use for example

ReturnVal = GVSetNamedDouble(GetSymbolName, Average(C,10));

GetSymbolName fetches the current symbol being processed. It then uses this name e.g. IBM as the name of the global variable. The value assigned to this global variable called IBM is then set to the second part of the expression - in this example the average closing price over 10 periods.

Global variables are VERY VERY POWERFUL and if you are not using them in your strategy you will face lots of limitations.

To fetch the global variable use GVGetNamedFloat e.g.

DouleDuty = GVGetNamedDouble("Super Algorith", ErrorCode);

This will assign to the variable DoubleDuty the value previously stored in the global variable that you called "Super Algorithm". As stated above this may be a name that automatically incorporates the symbol.

Other useful ones includ GVGetNamedString and GVGetNamedInt amongst many others. If you have access to the tradestation forum sites for either TS8 or T2k look there for the manuals.

Charlton
 
Thanks Charlton

I do use GV and, as you say, they are very useful.

I guess I am not expressing my problem too well but I am pretty sure you would be able to help me if I asked the right question LOL. When we use N Min change in a radarScreen then we are using the Sort function to sort the Radar based on ATR Change so it sorts the stocks based on this. But, when trying to do this in code, I can only think of using the function (eg) "sortdown_a" once I have put the ATR Change values into an Array. This will sort the ATR's, of course, but I can't find a way of getting it to also 'remember' the stock symbol. Otherwise, how would I know which stock has the biggest ATR Change.

See what I mean?

Thanks Again,
Steve
 
Thanks Charlton

I do use GV and, as you say, they are very useful.

I guess I am not expressing my problem too well but I am pretty sure you would be able to help me if I asked the right question LOL. When we use N Min change in a radarScreen then we are using the Sort function to sort the Radar based on ATR Change so it sorts the stocks based on this. But, when trying to do this in code, I can only think of using the function (eg) "sortdown_a" once I have put the ATR Change values into an Array. This will sort the ATR's, of course, but I can't find a way of getting it to also 'remember' the stock symbol. Otherwise, how would I know which stock has the biggest ATR Change.

See what I mean?

Thanks Again,
Steve

PS. Unfortunately I don't have access to the manuals etc.
 
Thanks Charlton

I do use GV and, as you say, they are very useful.

I guess I am not expressing my problem too well but I am pretty sure you would be able to help me if I asked the right question LOL. When we use N Min change in a radarScreen then we are using the Sort function to sort the Radar based on ATR Change so it sorts the stocks based on this. But, when trying to do this in code, I can only think of using the function (eg) "sortdown_a" once I have put the ATR Change values into an Array. This will sort the ATR's, of course, but I can't find a way of getting it to also 'remember' the stock symbol. Otherwise, how would I know which stock has the biggest ATR Change.

See what I mean?

Thanks Again,
Steve

There's some more documentation freely available on the web

http://www.fntec.com/uploads/board/uboard.asp?id=t3&u=down&u_no=2219&file_no=1
for manual on global variables

https://www.tradestation.com/support/books/pdf/EL_Essentials.pdf

function arrays page 109

To achieve this you will probably require a multidimensional array and you will need to write some calling functions.

The second source will probably be more useful for you, but to achieve what you want is experienced programming stuff. There isn't a lot on input/output functions and multidimensional arrays, but it might give you some ideas.

Charlton
 
Thanks again, Charlton. It's great of you to help.

Using a multi-dimensional array is as far as I got before deciding it's too hard! I couldn't work out how to sort on this basis. I guess I need to take a different approach to the problem. In the meantime I will just carry on trading the strat manually. I will post if I have a brain wave!

Thanks Again,

cheers
Steve
 
Top