Page 1 of 1
Enter when other symbols meet criteria
Posted: Fri Jun 01, 2012 12:53 pm
by Import
Is it possible enter when the CCI(20 period) of Microsoft is below 200 and the S&P 500 index (or its ETF equivalent) is above its 75 period moving average. If yes, how is this done?
Re: Enter when other symbols meet criteria
Posted: Fri Jun 01, 2012 1:51 pm
by Chris White
Yes - the way you would do this is by adding the following script:
Code: Select all
cond1:= FML('MSFT', 'CCI(20)[CCI]') < 200;
cond2:= FML('SPY', 'C') > FML('SPY', 'MA(75)');
event: cond1 & cond2;
Here you can see that they symbols for comparison have been 'hard-coded' to MSFT for the CCI calculation and SPY for the MA calculation.
When using this script it is important that your active symbol list contains both MSFT and SPY and that you have updated the list so that all symbols contained within it have the same start and end dates.
When you add this script to a chart area it will look like this:

- Calculation of this indicator is based on other symbols in the list
Note that the chart is showing ILF and the CCI(20) area is showing CCI for ILF, but the Darrell2 area is calculating based off of other symbols (SPY and MSFT).
When you run this script in the security selector in the entries and exits tab, you will see something like this:

- Entries are determined by fixed symbols
Note here that every time the condition is true, all symbols that are in the symbol list are selected.