Index | Recent Threads | Who's Online | Search

New Thread
This topic has been viewed 558 times and has 1 reply
hoosthu1
Feature Request: conditional buy and sell rules

assume i want to follow one set of buy rules with rsi > 60 and another with rsi < 30

or for a series result above a certain level and below a certain level

eg . if xxxxxx
then xxxx
View the feature request here .

Sep 14, 2014 5:08:15 AM       
pdemartino
Re: Feature Request: conditional buy and sell rules

If I'm reading this correctly, you can already do this with the Eval function.

Eval(statement being tested, what to do if it's true, what to do if it's false)

You can nest Eval, so:

Eval(RSI(14)>60,1,Eval(RSI(14) <30,Ticker("SH"),Ticker("SPY")))

Which, in an ETF screen, would buy an ETF if its RSI(14) was above 60, otherwise buy SPY if it's above 30 and buy SH if it's below 30. (Which is OK as an example but not a great rule, BTW.)

Sep 15, 2014 1:52:04 PM