Indicator value changed condition
Author: swiftmoscow
Creation Date: 1/19/2012 2:02 PM
profile picture

swiftmoscow

#1
Is there any way to track if custom indicator changes its value. For example how to use as a condition in If() that Highest.Series value changed?
Thank you.
profile picture

Eugene

#2
Save the indicator's value to a variable and compare.

CODE:
Please log in to see this code.
profile picture

Cone

#3
Or more simply, to see if the value changed from the previous bar...
CODE:
Please log in to see this code.
profile picture

swiftmoscow

#4
Thank you. How can I restart series to count it from market open every day? I use highest.series, but when new day starts it get value from previous day.
profile picture

Eugene

#5
See IntradayBarNumber in the QuickRef. It's 0 on the first bar of a trading session.
profile picture

Cone

#6
This might not be obvious, so to get the highest High for the current day in an intraday chart...
CODE:
Please log in to see this code.
profile picture

Eugene

#7
Just added this to our Knowledge Base: Intraday | Building blocks of Intraday trading strategies

profile picture

Cone

#8
But actually, that´s a very inefficient solution because the Value method has to go through every bar of the day on each bar. This is much more efficient -

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).