Screening symbols dynamically in EL?

Questions about MultiCharts and user contributed studies.
Xyzzy
Posts: 162
Joined: 19 Mar 2011
Has thanked: 43 times
Been thanked: 79 times

Screening symbols dynamically in EL?

Postby Xyzzy » 22 Apr 2011

This might be a "newbie" question. I'd like to develop a strategy that selects which symbols to trade for any given day or week based on certain criteria. This would be like using the Market Scanner, but selecting the symbols to trade algorithmically.

To give an example, I might want to define a portfolio with, e.g., twenty symbols. However, I'd only want to trade, e.g., the five symbols that have the "best" criteria out of those twenty symbols (e.g., the five symbols with the highest momentum, or the five symbols with the highest volume).

My understanding from this thread is that MultiCharts doesn't yet have portfolio-level trading.
viewtopic.php?f=1&t=7100

Based on this, my current assumption is that I'll need to create a workspace that has a separate chart for each of then twenty symbols, and then add a signal to each chart that determines whether any given symbol meets that screening criteria. In pseudocode, it would be something like:

Code: Select all

condition1 = ShouldITradeThisSymbol(...) ;
if condition1 then
begin
{actual trading code here}
end ;
I'm not sure how to go about the "ShouldITradeThisSymbol()" aspect. My assumption is that this would require the use of the All Data Everywhere library, perhaps by saving the relevant data for each symbol to the library (e.g., the volume) at the close of the bar, and then comparing the data in that library for each symbol on the next bar to determine which symbols meet the predefined criteria (e.g., which symbols have the highest volume).

Am I on the right track? If so, has anyone done this before, and is there any sample code? (I'm hoping to avoid reinventing the wheel.) Or am I off base, and is there an easier way of doing this?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Screening symbols dynamically in EL?

Postby TJ » 22 Apr 2011

some of my thoughts:

1. you have to use ADE for sure.

2. you have to collect the momentum rating from the 20 stocks,
... send the data to a central array
... then rank them...
... then sort them
... then select the top 5 and set the condition to "ShouldITradeThisSymbol = TRUE".

Xyzzy
Posts: 162
Joined: 19 Mar 2011
Has thanked: 43 times
Been thanked: 79 times

Re: Screening symbols dynamically in EL?

Postby Xyzzy » 22 Apr 2011

Thanks TJ! I was hoping that there would be an easier way, but I'll give this a shot. If anyone can point me to sample code where this has been done before, I'd be much obliged.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Screening symbols dynamically in EL?

Postby TJ » 22 Apr 2011

coding a strategy is easy,
coding a multi-conditional strategy, will take some testing,
coding a multi-conditional strategy on a portfolio will take a lot of planning.



ps. the sample code will cost $9,999.00 (j/k)


Return to “MultiCharts”