BasicRSI - An example trading system using Welles Wilder's RSI Indicator |
 |
Wilder's RSI is a popular oscillator that ranges between zero and 100.
Reading's above 70 indicate the stock is overbought, while readings below 30 indicate the stock is oversold.
The RSI is oftern used with other indicators, but this example uses the RSI alone.
Rules:
Buy when the RSI moves up through 30
Sell when the RSI moves down through 70
We have to define two variables to record the fact that the upper and lower
RSI bands have been breached. Once they have been breached, we enter/exit
when RSI moves back through the band.
 | |  | |
This trading system is included in the example trading systems that come with the free 30 day trial EOD version of Seer.
Once you have filled out this form simply download Seer to try this trading system.
| |  | |  |
#Basic RSI system
#Define the RSI bands - narrowing the bands will increase trades
my $upper=70;
my $lower=30;
#Set the triggers for the bands.
$TriggerLower=1 if Today(RSI(14))<$lower;
$TriggerUpper=1 if Today(RSI(14))>$upper;
if (not Position) {
#We do not have a position - has the trigger fired?
if ($TriggerLower) {
if (Today(RSI(14))>$lower) {
#The RSI has passed up through the lower band, go long.
BuyOpen;
#reset the triggers
$TriggerLower=0;
$TriggerUpper=0;
}
}
}
else {
#We have a position - has the trigger fired?
if ($TriggerUpper) {
if (Today(RSI(14))<$upper) {
#The RSI has passed down through the upper band, close the long.
SellOpen;
#reset the triggers
$TriggerLower=0;
$TriggerUpper=0;
}
}
}
|