Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/7/2004 Posts: 12
|
A pivot high can only be determined subsequent to the pivot high occurring. I have a rule that says the following:
If price.High(4) <= price.High(2) AndAlso _
price.High(3) <= price.High(2) AndAlso _
price.High(1) <= price.High(2) AndAlso _
price.High(0) <= price.High(2) Then pass
I want to plot on the price.High(2) bar. The above plots ont he price.high(0) bar. How do I make it plot on the price.high(2) bar? Also how do I display the price.high(2) value?
Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You RealCode Rule could be re-written as (but most Rules with negative offsets should not be used for backtesting - including this one):
If Price.High(2) <= Price.High AndAlso _
Price.High(1) <= Price.High AndAlso _
Price.High(-1) <= Price.High AndAlso _
Price.High(-2) <= Price.High Then Pass
If you want to display the Values on the Chart, you would need to use a RealCode Indicator instead of a RealCode Rule:
If Price.High(2) <= Price.High AndAlso _
Price.High(1) <= Price.High AndAlso _
Price.High(-1) <= Price.High AndAlso _
Price.High(-2) <= Price.High Then
Label = Price.High
Plot = Price.High
Else
Plot = Single.NaN
End If
You will need to left-click on the Indicator to bring up the Main tab of the Edit window so you can check Show Custom Labels. You will probably also want to change the Plot Style to Shape. If you Drag and Drop the Indicator to the Chart and select Overlay so it is in the same Pane as your Price History, you will probably also want to right-click on the Indicator and select Scaling | Scale With | Price History to put it in the same Scale as Price.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 12
|
Is there a way post the pivot high and pivot low in "real time" (ie - not using the -1 and -2 offset references)? I do want to back test this at some point in time. I prefer that Real Code post the pivots as they can be defined in real time.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If you want to backtest, use the Rule as you wrote it originally.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/13/2009 Posts: 2
|
Is there a way to create a Rule that shows the "Lowest Low of 1 bar ago", say of a moving average,
or does this have to be done in Real Code ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
drumboy,
Rules return True or False. Something that returns a Value like the lowest low of 1 bar ago would be an Indicator. The Min or Max of Line Indicator has an Offset setting that can be used to find the Value from 1-Bar Ago when the Offset is set to 1.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/20/2008 Posts: 5
|
What is wrong with this scan:XAVGC30 < AVGC10 AND C > O AND H < H1 AND H1 < H2 AND H1 > XAVGC30.1 AND H1 < AVGC10 .1 AND C > XAVGC30 AND C < AVGC10 AND C > AVGC200 AND AVGC10.7 > XAVGC30.7 AND AVGC10 > XAVGC30 AND C > 5 AND V > 1000 AND V > V1
When I do the scan I get some symbols that are TRUE. Yet when you look at the charts, some of them have the last candle RED. This candle would indicate that the close is less than the open. However, the first line of the scan has C>O. Whats wrong?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
syglk,
Welcome to the forums. A very good foundation for learning how to use TeleChart can be gained by reviewing the following:
If you are new to TeleChart READ THIS FIRST!
Your formula has several spaces in it that shouldn't be there. The formula without the spaces would be:
XAVGC30 < AVGC10 AND C > O AND H < H1 AND H1 < H2 AND H1 > XAVGC30.1 AND H1 < AVGC10.1 AND C > XAVGC30 AND C < AVGC10 AND C > AVGC200 AND AVGC10.7 > XAVGC30.7 AND AVGC10 > XAVGC30 AND C > 5 AND V > 1000 AND V > V1
That said, a red candle in TeleChart does not indicate that the Close is less than the Open. The candlesticks in TeleChart combine color and body type to provide both Current Close versus Current Open and Current Close versus Previous Close information in the same Candle (if Plot down days in a different color is selected).
Candlesticks:
Current Close > Open = Hollow
Current Close < Open = Solid
Current Close >= Previous Close = Green
Current Close < Previous Close = Red
Price Color and Volume Bar Color treat a Net Change of zero differently. The Candle is green but the Volume Bar is red.
Volume Bars:
Current Close > Previous Close = Green
Current Close <= Previous Close = Red
It is also possible to have a Balance of Power (BOP) Indicator on the Chart with Apply BOP Colors to Price Graph checked. If this is the case, green means BOP is greater than thirty, red means BOP less than negative 30 and yellow means BOP is between thirty and negative thirty.
Price, Volume Bars and Balance of Power all allow you to adjust the specific colors used, but not the criteria used to assign the colors.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |