QTusers Forum
February 11, 2012, 06:22:49 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the QuoteTracker Users Discussion Forum
Latest QuoteTracker Version is 3.9.7
Released on April 13th 2010

 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Paintbar question - prior bar reference  (Read 1567 times)
copodon
New Member
*
Posts: 9


« on: October 21, 2006, 10:17:41 AM »

I'm working on a two-rule paintbar and am having trouble with the second rule.

First rule is to find the bar with the lowest low over n number of periods (swing low).  I got that part figured out.

Now i want to create a rule to identify when the current bar close is greater than  the high of that swing low bar.  This is where i am running into trouble.

When i tried to code it, it keeps marking the bar if it has a close greater than the prior bar's high, which is not necessarily the swing low bar.

Any ideas where i am screwing up?

Logged
cmx
Sr. Member
****
Posts: 93


WWW
« Reply #1 on: October 21, 2006, 10:43:13 AM »

post the code you are using
Logged
copodon
New Member
*
Posts: 9


« Reply #2 on: October 21, 2006, 03:40:31 PM »

CMX! What a sight for sore eyes.  Glad to see you around on these new forums.

This is the code for reversal.  I've been playing with it for awhile, seeems to only work if the bar with a higher close is the one right after the swing low bar

if Bar Low>Bar Low[1] and Bar Low<Bar Low[2] and Bar Low<Bar Low[3] and Bar Low<Bar Low[4] and Bar Close>Bar High[1] set color to Green

Thanks for taking a look i appreciate it.
Logged
cmx
Sr. Member
****
Posts: 93


WWW
« Reply #3 on: October 22, 2006, 12:59:03 AM »

hello copo, glad to see you also...it is pretty quiet here. Still confused a bit...can you give both formulas used in the PB?...

yeah I need more info ...I can't get my head around what you have posted so far...
« Last Edit: October 23, 2006, 10:58:45 AM by cmx » Logged
copodon
New Member
*
Posts: 9


« Reply #4 on: October 24, 2006, 10:05:01 AM »

the first rule is to mark the low bar of the last five periods,

if Bar Low<Bar Low[1] and Bar Low<Bar Low[2] and Bar Low<Bar Low[3] and Bar Low<Bar Low[4] set color to red.

after that i have rule two as stated above.
Logged
cmx
Sr. Member
****
Posts: 93


WWW
« Reply #5 on: October 24, 2006, 11:30:50 AM »

OK...here is a rule that will start you off....

Your current 5 bar swing low rule  #1:

if Bar Low<Bar Low[1] and Bar Low<Bar Low[2] and Bar Low<Bar Low[3] and Bar Low<Bar Low[4] set color to Red

New 5 bar "breakup" rule #2:

if ((paintbar[1] =red)  and (bar high[1]<bar close)) or((paintbar[2] =red)  and (bar high[2]<bar close))or((paintbar[3] =red)  and (bar high[3]<bar close))or((paintbar[4] =red)  and (bar high[5]<bar close))or((paintbar[5] =red)  and (bar high[5]<bar close)) set color to Lime

This will color a bar green if it is within five bars of and if it closes higher than the high of a new swing low of the last five bars.....



The deal is, you will have to have a set the number of bars to check "back" for the "break up".
The "break-up" could occur beyond the five bar range coded here for example.

Let me know what you think. I'm sure it could be cleaned up and improved. For example I don't like the multiple signals(even though they are valid)...

 
« Last Edit: October 24, 2006, 11:49:08 AM by cmx » Logged
copodon
New Member
*
Posts: 9


« Reply #6 on: October 24, 2006, 01:34:09 PM »

Thanks CMX, that looks great.  I will test it out.

Question, is there some sort of way to add like "and stop" feature, so after the first green bar no more are printed until a new swing low is made?
Logged
cmx
Sr. Member
****
Posts: 93


WWW
« Reply #7 on: October 24, 2006, 02:20:23 PM »

The "and stop" works within each bar. So no, it wouldn't be a quick fix for that problem.
I'm sure there is an elegant way to do it...just need the time to focus...if you come up with an idea let me know. It "works" as is...
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!