Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Real Code programming question Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
BillJohnson
Posted : Wednesday, March 10, 2010 10:45:14 PM
Registered User
Joined: 10/7/2004
Posts: 16
I am trying to program the following into Realcode but I keep getting errors.  Can you assist, please?

RSI drops for three days in a row
RSI on day 1 is less than 60

This is part of a Connors' ETF strategy that I am trying to code into StockFinder.

Thanks for your help.
bobre1
Posted : Thursday, March 11, 2010 8:44:28 AM
Registered User
Joined: 10/7/2004
Posts: 886

'# WR = indicator.Library.Wilders RSI

If WR.value(3) < 60 _
 And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then pass

You'll need to edit the condition to change the default value of the RSI to, I'm assumming, 2, which is what Connor's uses.

Bob

jas0501
Posted : Thursday, March 11, 2010 8:13:44 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
QUOTE (bobre1)

'# WR = indicator.Library.Wilders RSI

If WR.value(3) < 60 _
 And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then pass

You'll need to edit the condition to change the default value of the RSI to, I'm assumming, 2, which is what Connor's uses.

Bob


A couple minor points:

Day 1 might be 2 days ago, so the above could would then be

If WR.value(2) < 60 _
 And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then 
     pass
end if

or day 1 could be the latest bar, if so then it would be

If WR.value < 60 _
 And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then 
     pass
end if



Lastly, the code would be slightly faster using AndAlso in place of And

If WR.value(2) < 60 _
 AndAlso WR.Value(3) > WR.Value(2) _
 AndAlso WR.Value(2) > WR.Value(1) _
 AndAlso  WR.Value(1) > WR.Value Then 
    pass
end if

danielbender
Posted : Monday, March 15, 2010 10:06:02 PM
Registered User
Joined: 1/14/2006
Posts: 436
Bill - Have you taken Connors class?
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.