Page 1 of 1

Multiple condition entries and exits

Posted: Fri Jun 01, 2012 12:37 pm
by Import
Can there be more than one condition for an entry (and exit) e.g. enter when CCI(20 period) is below 200 and the stock price is above its 75 period moving average. If yes, how is this done? If more than one condition is possible, is there a limit on the number of conditions?

Re: Multiple condition entries and exits

Posted: Fri Jun 01, 2012 12:42 pm
by Chris White
Yes there can be more than one condition for an entry and exit. Even though the security selector only accepts one chart script currently, that chart script can be configured with multiple conditions. The number of conditions added in this way is unlimited.

As an example, for the specific criteria that you mentioned, here's how that would be done in Chart Script:

Code: Select all

cond1:= FML('CCI(20)[CCI]') < 200;
cond2:= C > MA(C, 75);

event: cond1 & cond2;
When this script is added to a chart area it looks like this:
This script outputs an event when CCI &lt; 200 and MA &gt; 75
This script outputs an event when CCI < 200 and MA > 75
When this script is added to the entries and exits tab to perform scanning it looks like this:
The script selects stocks that meet the defined criteria
The script selects stocks that meet the defined criteria