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 |

bar count mis-match Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
3dbeing
Posted : Thursday, October 22, 2009 7:07:05 PM
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?
3dbeing
Posted : Thursday, October 22, 2009 7:50:52 PM
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...
jas0501
Posted : Thursday, October 22, 2009 8:59:19 PM
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.

3dbeing
Posted : Thursday, October 22, 2009 9:58:05 PM
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..
3dbeing
Posted : Friday, October 23, 2009 9:08:38 PM
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.
3dbeing
Posted : Saturday, October 24, 2009 9:31:53 PM
Registered User
Joined: 6/24/2009
Posts: 178
found it, at the end of the Properties and methods

me.numofbars

my appologies again...
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.