Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 4/20/2010 Posts: 20
|
I spoke with customer service today about this and they told me I should put a request in this forum because it would have to be written as a real code scan. I need a scan that does the following please:
I would like to identify, with a colored candle and a mark on the chart, the following:
Scan# 1....paint an orange Candle and put a mark on the chart......When the number of up days exceeds the number of down days in the previous 5 days.
Scan# 2......paint a yellow candle and put a mark on the chart......When the number of down days exceeds the number of up days in the previous 5 days.
IMPORTANT......The up days vs. down days MUST be defined by close to close. In other words......the down days need to be identified by the close being lower than the previous days close and the up days need to be defined by the close being higher than the previous days close.
I would like to put both of these scans on every chart in a watchlist/layout so that when I bring up the watchlist/layout it automatically scans each stock in that watchlist for these criteria. Thanks very much.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (biggolfer2) Scan# 1....paint an orange Candle and put a mark on the chart......When the number of up days exceeds the number of down days in the previous 5 days.
Create the following RealCode Rule with the Rule Color set to orange. After creating the Rule, Edit it and check Paint Price when Passing and Show On Chart.
Static Up As Integer
Static Dn As Integer
If CurrentIndex >= 7 Then
If Price.Last(1) > Price.Last(2) Then
Up += 1
Else If Price.Last(1) < Price.Last(2) Then
Dn += 1
End If
If Price.Last(6 ) > Price.Last(7) Then
Up -= 1
Else If Price.Last(6 ) < Price.Last(7) Then
Dn -= 1
End If
Else If CurrentIndex >= 2 Then
If Price.Last(1) > Price.Last(2) Then
Up += 1
Else If Price.Last(1) < Price.Last(2) Then
Dn += 1
End If
Else
Up = 0
Dn = 0
End If
If CurrentIndex >= 6 Then
If Up > Dn Then
Pass
End If
Else
SetIndexInvalid
End If
QUOTE (biggolfer2) Scan# 2......paint a yellow candle and put a mark on the chart......When the number of down days exceeds the number of up days in the previous 5 days.
Create the following RealCode Rule with the Rule Color set to yellow. After creating the Rule, Edit it and check Paint Price when Passing and Show On Chart.
Static Up As Integer
Static Dn As Integer
If CurrentIndex >= 7 Then
If Price.Last(1) > Price.Last(2) Then
Up += 1
Else If Price.Last(1) < Price.Last(2) Then
Dn += 1
End If
If Price.Last(6 ) > Price.Last(7) Then
Up -= 1
Else If Price.Last(6 ) < Price.Last(7) Then
Dn -= 1
End If
Else If CurrentIndex >= 2 Then
If Price.Last(1) > Price.Last(2) Then
Up += 1
Else If Price.Last(1) < Price.Last(2) Then
Dn += 1
End If
Else
Up = 0
Dn = 0
End If
If CurrentIndex >= 6 Then
If Dn > Up Then
Pass
End If
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/20/2010 Posts: 20
|
Thanks much Bruce
|
|
Registered User Joined: 4/20/2010 Posts: 20
|
Thanks again Bruce for creating my scan request. Unfortunately I'm not getting the intended result from the scan. Could be the way I worded the request. I'll think about it and re-write the request. Maybe it would be better if I just explained ,in detail, what I'm wanting the scan to identify on the chart?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I thought your original request was fairly specific. If it is not returning the desired results however a more detailed alternate description would be helpful.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |