Registered User Joined: 8/19/2008 Posts: 19
|
I am trying to get a paint bar that will paint the high/low. How do I get it to look one day forward? It seems that when I use something like" price.low(-1)" the code does not like the -1. Soon as I do that all the price bars change color. Soon as I take that code out of there it is fine.
code looks something like this,
IF price.low(0) < price.low(1) and price.low(0) < price.low(-1) then pass
Also is there a way to ask the code to look at the past three bars? instead of doing price.low(0), price.low(1),price.low(2), etc?
Thanks
Joel
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I have no idea why your version doesn't work (it doesn't work on my computer either) while the following does, but please try it instead anyway:
If Price.Low(0) < Price.Low(1) AndAlso Price.Low(0) < Price.Low(-1) Then Pass
I'm not sure what you are asking about looking at the past three bars, but there is most likely quite a few ways to do what you want. For example:
If Price.Last < Price.Open AndAlso _
Price.Last(1) < Price.Open(1) AndAlso _
Price.Last(2) < Price.Open(2) Then Pass
Returns the same results as:
Static Count As Integer
If isFirstBar Then Count = 0
If Price.Last < Price.Open Then Count += 1
If Price.Last(3) < Price.Open(3) Then Count -= 1
If Count = 3 Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|