EDS is a stock selection process whereby you specify a number of
logical conditions, which when taken together, will provide the
criteria by which stocks are selected.
Keep each line simple and remember to add a "full stop" at the end of EVERY line.
So we start like this. The letters ABCD are arbitrary and can be anything you want to call them....
A if condition 1 is true.
B if condition 2 is true.
C if condition 3 is true.
C if condition 4 is true.
and so on.
Select the stock IF A and B and C and D are all true.
So lets take a simple "A"
I want to select stocks that are between ( today's CLOSE) 50p and 1000p (£10.00)
PriceRange if [close]>50 and [close]<1000.
Note all "items" MUST be within square brackets.
Now lets do a test for something that needs to be compared with "yesterday"
Let's test for arguments sake, to see if today's OPEN was higher than yesterdays CLOSE- this is called a GAP UP- some ppl compare today's OPEN with yesterday's HIGH.
GapIsUp if [OPEN]> val([close],1).
This can also be written :
GapUp if val([close],1) < [open].
NOTE you can use capitals, or not, as you chose.....
Note that you have to use "VAL" on anything that is not "today"
note the "comma 1". This signifies one day ago, so " ,10" is 10 days ago etc.
Let's try a slope test........this is an "average slope over the previous X days. It can also be "back dated" by Y days. For example, lets code for a falling RSI over a 10 day period, starting 15 days ago.We dont know what it did in the last 5 days therefore.
RsiSlopeDown if slope([RSI WILDER],10,5)<0.
And now a test to se if the RSI slope over the last 5 days was positive:
RsiUp if slope([rsi wilder],5)>0.
so putting these all together we get:
PriceRange if [close]>100 and [close]<1000.
GapIsUp if [OPEN]> val([high],1).
RsiSlopeDown if slope([RSI WILDER],10,5)<0.
RsiUp if slope([rsi wilder],5)>0.
BuyTest if PriceRange and GapIsUp and RsiSlopeDown and RsiUp.
OK! that's it!.
You can copy and paste this direct into EDS.It won't do very well in backtest. So add some more selectors..
How about test for RSI > 40 today
Vol > 1000
Close> ST MA
etc.
Have fun and remember this is only a tutorial.The selections will be "lagging" so you will at leat see what you missed on backtesting.
logical conditions, which when taken together, will provide the
criteria by which stocks are selected.
Keep each line simple and remember to add a "full stop" at the end of EVERY line.
So we start like this. The letters ABCD are arbitrary and can be anything you want to call them....
A if condition 1 is true.
B if condition 2 is true.
C if condition 3 is true.
C if condition 4 is true.
and so on.
Select the stock IF A and B and C and D are all true.
So lets take a simple "A"
I want to select stocks that are between ( today's CLOSE) 50p and 1000p (£10.00)
PriceRange if [close]>50 and [close]<1000.
Note all "items" MUST be within square brackets.
Now lets do a test for something that needs to be compared with "yesterday"
Let's test for arguments sake, to see if today's OPEN was higher than yesterdays CLOSE- this is called a GAP UP- some ppl compare today's OPEN with yesterday's HIGH.
GapIsUp if [OPEN]> val([close],1).
This can also be written :
GapUp if val([close],1) < [open].
NOTE you can use capitals, or not, as you chose.....
Note that you have to use "VAL" on anything that is not "today"
note the "comma 1". This signifies one day ago, so " ,10" is 10 days ago etc.
Let's try a slope test........this is an "average slope over the previous X days. It can also be "back dated" by Y days. For example, lets code for a falling RSI over a 10 day period, starting 15 days ago.We dont know what it did in the last 5 days therefore.
RsiSlopeDown if slope([RSI WILDER],10,5)<0.
And now a test to se if the RSI slope over the last 5 days was positive:
RsiUp if slope([rsi wilder],5)>0.
so putting these all together we get:
PriceRange if [close]>100 and [close]<1000.
GapIsUp if [OPEN]> val([high],1).
RsiSlopeDown if slope([RSI WILDER],10,5)<0.
RsiUp if slope([rsi wilder],5)>0.
BuyTest if PriceRange and GapIsUp and RsiSlopeDown and RsiUp.
OK! that's it!.
You can copy and paste this direct into EDS.It won't do very well in backtest. So add some more selectors..
How about test for RSI > 40 today
Vol > 1000
Close> ST MA
etc.
Have fun and remember this is only a tutorial.The selections will be "lagging" so you will at leat see what you missed on backtesting.