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 |

Running Display of metrics Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jmartyn
Posted : Thursday, July 17, 2008 2:51:11 PM
Registered User
Joined: 1/12/2005
Posts: 88

I am trying to display a running calculation of price relative to the open etc.. 

How would I do that. 

Does my code get called on every update or every bar?

Thanks in advance. 

Jeff
jmartyn
Posted : Thursday, July 17, 2008 2:54:15 PM
Registered User
Joined: 1/12/2005
Posts: 88
Oh these are intraday statistics. 
--
Bruce_L
Posted : Thursday, July 17, 2008 3:06:12 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
If I'm understanding your question correctly, which is not guaranteed, you may wish to try the following:

'Intraday Percent Change from Open
'#Cumulative
Static Open As Single
If isFirstBar
    Open = Price.Open
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
    Open = Price.Open
End If
Plot = 100 * Price.Last / Open - 100

Your RealCode normally gets calculated every Bar for each symbol. It is possible to adjust this using AutoLoop = false (in which case your code gets called only once per symbol).

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
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.