Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 6/24/2009 Posts: 178
|
Ok, so I've run into the problem where it seems the issue is that bar counts don't match...
is there a trick to linning up bar counts?
|
|
Registered User Joined: 6/24/2009 Posts: 178
|
bascially what i've done is plot the absolute value, but I want to color by actual value...
whereas
plot = system.math.abs(-.76)
===============================
count = ( myInd_01.bar.count - 1 ) - ( myInd_02.bar.count - 1 )
For i As Integer = 0 To myInd_02.bar.count - 1
val = myInd_02.bar.value( i + count + 1 ) - myInd_02.bar.value( i + count )
If val >1 then
myCol = color.green
else
myCol = color.red
endif
addtooutput(myInd_02.bar.count(i), myCol)
next
================================
it all plots green...
|
|
Registered User Joined: 12/31/2005 Posts: 2,499
|
one approach, have 2 plots
Plot A
Plot = value
Plot B
Plot = abs(value)
Set Plot B's color to Red and the have a color rule based on Plot A > 0 color green
Finally don't draw Plot A
2 comment on your code.
1. ir assumes that mtInd_02 has the lessor number of bar. That may not always be the case
2. AddToOutput has a datevalue as the first argument, your code does not.
|
|
Registered User Joined: 6/24/2009 Posts: 178
|
Yeah I thought that I might have to do that, I thought there was a more mathematical approach though... ok, I'll do that then, thanks Jas..
|
|
Registered User Joined: 6/24/2009 Posts: 178
|
hmmmm, this seems promising
NumOfBars; The NumOfBars property overrides the Bar Limiter setting in the Data Manager allowing you to set more(or less) bars available for your calculation.
Unfortunately the reference doesn't give any code examples, so it's really a shot in the dark as to the syntax.
|
|
Registered User Joined: 6/24/2009 Posts: 178
|
found it, at the end of the Properties and methods
me.numofbars
my appologies again...
|
|
Guest-1 |