Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 1/3/2005 Posts: 72
|
Good morning,
I'm using blocks. Is it possible to some how label at bar when a condition is met. Put arrow over or under bar when condition is met, place a color dot over or under bar or make the bar a different color? Anything to indicate a condition was met on the price history.
Is this possible is Stockfinder?
Thanks for any assistance.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The easiest of these things to do would be to paint the Bar a different Color when a Rule returns True. Just Drag and Drop the Rule onto the Indicator and it should Paint the Indicator the color of the Rule whenever it is met.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/3/2005 Posts: 72
|
Bruce,
Thanks for explaining how to paint the bar a different color when a rule returns true. I need assistance in setting up the Blocks rule for upward and downward five bar swing points and turning the bar different colors. The rules that I need assistance with are as follows:
Upward five bar swing point rule: The swing point bar has two bars to the left with lower highs and two bars to the right with lower highs highs.
Downward five bar swing point rule: The swing point bar has two bars to the left with higher lows and two bars to the right with higher lows.
Once the rules are set up in Blocks. How do you turn the swing point bars different colors. Can the swing point bars be painted different colors? I don't have an indicator to drop the rule on as stated in your reply.
Once the rules have been established will all the past price history have the colored bars for upward and downward five bar swing points? That is what I really want is to see all the past and new five bar patterns.
Thanks for any assistance.
Mark
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Price is an Indicator, so you can Drag and Drop the Rules onto the Price History.
One way to write the RealCode Rule for the upward five bar swing point rule would be:
If Price.High > Price.High(1) AndAlso _
Price.High(1) > Price.High(2) AndAlso _
Price.High > Price.High(-1) AndAlso _
Price.High(-1) > Price.High(-2) Then Pass
One way to write the RealCode Rule for the downward five bar swing point rule would be:
If Price.Low < Price.Low(1) AndAlso _
Price.Low(1) < Price.Low(2) AndAlso _
Price.Low < Price.Low(-1) AndAlso _
Price.Low(-1) < Price.Low(-2) Then Pass
These Rules use future data and should not be used for backtesting.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/3/2005 Posts: 72
|
Bruce,
This is my first time using real code rules. I copied and pasted the rule into Real code condition and and hit apply. I did not see any indicator on the chart. Did I do something wrong? Can you provide any direction on how to apply these real code rules into the charts
Thanks again for all your help.
Mark
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
An Indicator will not appear on the Chart for a RealCode Rule unless you Drag and Drop the Rule to the Chart or left-click on the Rule to bring up the Edit Rule window and select Show On Chart. It will not Paint the Price History unless you Drag and Drop the Rule onto Price History, left-click on the Rule to bring up the Edit Rule window and select Paint Price when Passing or right-click on Price History and select Edit Colors so you can check the Rule in the Colors tab of the Edit window.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/3/2005 Posts: 72
|
Bruce,
Thanks for helping me understand how to implement realcode rules into the stock price. It works GREAT!! I really appreciate your help. Thanks!!
I'm trying to write two more codes. The rules are as follows:
Uptrend 3 bar
Always need at least 3 price bars with higher highs.
The third bar must close in the lower half of the bar and have a higher high than the previous bar.
(if possible) The third bar must be higher (not touching) 5 Exponential Moving Average, 8 EMA or 13 EMA.
Downtrend 3 bar
Always need at least 3 bars with lower lows.
The third bar must close in the upper half of the bar and have a lower low than the previous bar.
(if possible) The third bar must be lower (not touching) 5 EMA, 8 EMA or 13 EMA
Thanks for any assistance.
Mark
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If I'm understanding correctly, Uptrend 3 Bar could be created using the following RealCode Rule:
'# Cumulative
Static EMA(2,2) As Single
If isFirstBar Then
For i As Integer = 0 To 2
EMA(i, 0) = 0
EMA(i, 2) = 1
Next
EMA(0, 1) = 4 / 6
EMA(1, 1) = 7 / 9
EMA(2, 1) = 12 / 14
End If
For i As Integer = 0 To 2
Dim Weight = 1 / EMA(i, 2)
EMA(i, 0) = EMA(i, 0) * (1 - Weight) + Weight * Price.Last
EMA(i, 2) = EMA(i, 2) * EMA(i, 1) + 1
Next
If Price.High > Price.High(1) AndAlso _
Price.High(1) > Price.High(2) AndAlso _
Price.High(2) > Price.High(3) AndAlso _
Price.Last - Price.Low <= (Price.High - Price.Low) / 2 AndAlso _
(Price.Low > EMA(0, 0) OrElse _
Price.Low > EMA(1, 0) OrElse _
Price.Low > EMA(2, 0)) Then Pass
And Downtrend 3 Bar could be created using the following RealCode Rule:
'# Cumulative
Static EMA(2,2) As Single
If isFirstBar Then
For i As Integer = 0 To 2
EMA(i, 0) = 0
EMA(i, 2) = 1
Next
EMA(0, 1) = 4 / 6
EMA(1, 1) = 7 / 9
EMA(2, 1) = 12 / 14
End If
For i As Integer = 0 To 2
Dim Weight = 1 / EMA(i, 2)
EMA(i, 0) = EMA(i, 0) * (1 - Weight) + Weight * Price.Last
EMA(i, 2) = EMA(i, 2) * EMA(i, 1) + 1
Next
If Price.Low < Price.Low(1) AndAlso _
Price.Low(1) < Price.Low(2) AndAlso _
Price.Low(2) < Price.Low(3) AndAlso _
Price.High - Price.Last <= (Price.High - Price.Low) / 2 AndAlso _
(Price.High < EMA(0, 0) OrElse _
Price.High < EMA(1, 0) OrElse _
Price.High < EMA(2, 0)) Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |