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 |

BarsVisible Declaration Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
billjsmith
Posted : Monday, May 24, 2010 12:39:51 PM
Gold Customer Gold Customer

Joined: 7/21/2007
Posts: 32
What object do I have to declare to gain access to BarsVisible? I thought it would be Price History but not so.
Kuf
Posted : Monday, May 24, 2010 12:55:44 PM


Administration

Joined: 9/18/2004
Posts: 3,522
Bars Visible? As in how many bars you can see on the chart?

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
billjsmith
Posted : Monday, May 24, 2010 1:15:53 PM
Gold Customer Gold Customer

Joined: 7/21/2007
Posts: 32
Yes, it is a Property of the ChartExecutionContext Class.
billjsmith
Posted : Monday, May 24, 2010 6:16:42 PM
Gold Customer Gold Customer

Joined: 7/21/2007
Posts: 32
I need to compute the average volume over the visible bars as the first step to computing a volume adjusted moving average. I thought BarsVisible would help me do that but then I discovered that IsFirstBar CurrentDate was in June of 2002 with less than 5 months visible. 

How would you write that code?
jas0501
Posted : Monday, May 24, 2010 8:56:53 PM
Registered User
Joined: 12/31/2005
Posts: 2,499

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0
www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:BarsVisible
'|******************************************************************

plot = activechart.barsvisible

However resizing the chart area does not refresh the value plotted until the symbol is changed.

Kuf
Posted : Tuesday, May 25, 2010 9:25:01 AM


Administration

Joined: 9/18/2004
Posts: 3,522
QUOTE (jas0501)

However resizing the chart area does not refresh the value plotted until the symbol is changed.



Adding this to code will refresh your plot when you change the number of bars visible or scroll the chart.

'#RECALC_ON_ZOOM_SCROLL

See page 46 of the RealCode Reference.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
jas0501
Posted : Tuesday, May 25, 2010 12:15:39 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
QUOTE (Kuf)
QUOTE (jas0501)

However resizing the chart area does not refresh the value plotted until the symbol is changed.



Adding this to code will refresh your plot when you change the number of bars visible or scroll the chart.

'#RECALC_ON_ZOOM_SCROLL

See page 46 of the RealCode Reference.


Cool!

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0
www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:BarsVisible
'|******************************************************************
'#RECALC_ON_ZOOM_SCROLL
plot = activechart.barsvisible



Note this permits displaying the number of bars visible on the toolbar by adding a data display item and editing the block diagram of said data display item.

Add Data Display.3
 



Edit Data Display.3's block diagram




Pin Bars Visible Demo pane and  below shows bars visible resized to 850 with legend display:

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.