Registered User Joined: 10/7/2004 Posts: 12
|
The Reference Manual indicates:
Advanced Tip: If there is not enough data to calculate your
rule (because you are calling for data x bars ago) RealCode will not output a value until there is enough data foryour rule to
calculate. You can help speed this process up and increase
performance by doing a check at the top ofyour code that will
exit if the current bar is less than the largest number of bars
back you need to evaluate.
What is the code that is required to do the above?
|
Registered User Joined: 12/31/2005 Posts: 2,499
|
'
' Note the period depends on the combination of periods used in a calculation.
' For example a indicator X, a 50 day moving average of indicators Y, a 10 day moving average
' would require 10 days for indicator Y to start to plot and
' then 50 days from there for indicator X to start to plot.
' So 10 + 50 or sixty days
'
'# Period = unerinput.integer = 60
If currentindex >= Period then
'...
'... whatever logic you want to execute
'...
end if
|