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 |

Color price bars - day forward Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jtr
Posted : Sunday, November 23, 2008 2:34:35 PM
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
Bruce_L
Posted : Monday, November 24, 2008 3:15:23 PM


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
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.