Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 01-06-2009, 01:10 AM   #1

Join Date: Dec 2008
Location: Morris, MN
Posts: 10
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Quote Tracker Value Chart Paintbar

Anyone,

I've been trying to develop a code to have a value chart as a paint bar on Quote Tracker, but have been having trouble with making the code work.

Here's what I have so far:

if (Bar High-SMA)/0.3>8 set color to Red

if (Bar High-SMA)/0.3>=4 AND (Bar High-SMA)/0.3<=8 set color to $B7B7F (Light Red)

if (Bar Low-SMA)/0.3<=-4 AND (Bar Low-SMA)/0.3>=-8 set color to $B7FFB7 (Light Green)

if (Bar Low-SMA)/0.3<-8 set color to Green


For example, the top line if (Bar High-SMA)/0.3>8 set color to Red, is the bar high minus the SMA (5 Day (H+L)/2), that part works fine.

The part I'm having trouble with is the 0.3 part. It is suppose to be what is called a volatility unit, which is figured by (((Bar High[4]-Bar Low[4])+(Bar High[3]-Bar Low[3])+(Bar High[2]-Bar Low[2])+(Bar High[1]-Bar Low[1])+(Bar High-Bar Low))/5)*0.20. I just put 0.3 in for now because that was some average I figured out.

The 0.20 makes it adjust to changing volatility overtime. I try putting it all together and nothing shows up.

I want to know when the highs or lows get to the overbought or oversold area, and shade them the appropriate color.

This is what it is suppose to be for signif. overbought:

(Bar High-SMA)/(((Bar High[4]-Bar Low[4])+(Bar High[3]-Bar Low[3])+(Bar High[2]-Bar Low[2])+(Bar High[1]-Bar Low[1])+(Bar High-Bar Low))/5)*0.20

> 8

It needs to be greater than +8.

Does anyone see what I'm doing wrong, or is it even possible to figure it out.

Any help would be appreciated.
cbratton is offline  
Reply With Quote
Old 01-06-2009, 06:23 AM   #2
OAC

OAC's Avatar

Join Date: Apr 2007
Location: manila
Posts: 524
Ignore this user

Thanks: 25
Thanked 63 Times in 52 Posts

Re: Quote Tracker Value Chart Paintbar

Quote:
Originally Posted by cbratton »

if (Bar High-SMA)/0.3>8 set color to Red
It has been a while that I have done paintbar coding in QT.
When in doubt, always put in the parenthesis:

if ((Bar High-SMA)/0.3)>8 set color to Red


Also is there an input value for SMA ?

Last edited by OAC; 01-06-2009 at 04:09 PM.
OAC is offline  
Reply With Quote
Old 01-06-2009, 01:30 PM   #3

Join Date: Dec 2008
Location: Morris, MN
Posts: 10
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Quote Tracker Value Chart Paintbar

This is what I have for the significantly Overbought:

if (Bar High-SMA(5)) / (((Bar High[4]-Bar Low[4]) + (Bar High[3]-Bar Low[3]) + (Bar High[2]-Bar Low[2]) + (Bar High[1]-Bar Low[1]) + (Bar High-Bar Low))/5)*0.2 >8 set color to Red

It still shows nothing on the chart.

It might be to complex or the expression is incorrect, anyone else have any thoughts?
cbratton is offline  
Reply With Quote
Old 01-06-2009, 04:08 PM   #4
OAC

OAC's Avatar

Join Date: Apr 2007
Location: manila
Posts: 524
Ignore this user

Thanks: 25
Thanked 63 Times in 52 Posts

Re: Quote Tracker Value Chart Paintbar

I got it working. Thanks.
I am going to compare to the NinjaTrader version and see how it goes.
OAC is offline  
Reply With Quote
Old 01-06-2009, 09:28 PM   #5

Join Date: Dec 2008
Location: Morris, MN
Posts: 10
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Quote Tracker Value Chart Paintbar

How did you get it working? Did you change it? Please let me know.
cbratton is offline  
Reply With Quote
Old 01-06-2009, 09:46 PM   #6
OAC

OAC's Avatar

Join Date: Apr 2007
Location: manila
Posts: 524
Ignore this user

Thanks: 25
Thanked 63 Times in 52 Posts

Re: Quote Tracker Value Chart Paintbar

Quote:
Originally Posted by cbratton »
How did you get it working? Did you change it? Please let me know.
Do you need eye glasses ?

When in doubt, always put in the parenthesis:
OAC is offline  
Reply With Quote
Old 01-07-2009, 12:24 AM   #7

Join Date: Dec 2008
Location: Morris, MN
Posts: 10
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Quote Tracker Value Chart Paintbar

Okay, I got it now. I tried putting parenthesis in, but it still didn't work. What I did was simplify the calculations, so now it works perfect. I don't know if you divided by 0.3 or the volitility unit formula.

Thanks for your help.
cbratton is offline  
Reply With Quote
Old 01-07-2009, 12:40 AM   #8
OAC

OAC's Avatar

Join Date: Apr 2007
Location: manila
Posts: 524
Ignore this user

Thanks: 25
Thanked 63 Times in 52 Posts

Re: Quote Tracker Value Chart Paintbar

if (Bar High-SMA(5)) /((((Bar High[4]-Bar Low[4]) + (Bar High[3]-Bar Low[3]) + (Bar High[2]-Bar Low[2]) + (Bar High[1]-Bar Low[1]) + (Bar High-Bar Low))/5)*0.2) >8 set color to Red


Happy New Year
OAC is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Creating a 9/30 Crossover Paintbar Indicator Disco Scottie Coding Forum 3 12-13-2010 04:38 AM
Trend Indicator Paintbar Squire69 Coding Forum 12 08-15-2010 05:11 PM
Convert CCI Code into a Paintbar TS2000i mrb123 Coding Forum 0 10-10-2008 12:01 PM
Up and DownTicks PaintBar jojojo Coding Forum 0 11-15-2007 04:05 AM
Simple Paintbar Request MrPaul Coding Forum 4 06-20-2007 08:10 PM

All times are GMT -4. The time now is 12:17 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.