Dear Sirs,
I need to Retrieve some Array Values from an ODBC Data source for plotting on chart.
For the sake of conserving resources I wish to Retrieve/Refresh Values Only if Interval() or Name() has changed.
For that purpose I am using the following code:
if( Name() != VarGetText( "SYMBOL_XYZ" ) OR Interval(2) != VarGetText( "Interval_XYZ" ) )
{
VarSetText( "SYMBOL_XYZ", Name() );
VarSetText( "Interval_XYZ", Interval(2) );
VarSetText( "mNOW" , Now( 2 ) );
// Retrieve Values from ODBC Source
}
Title = VarGetText( "mNOW") ;
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
In this sample code, I expect the Title to update only on change in Interval() or Name() -
It should not change on chart scrolls, Zooms or simple clicks etc.
However, the title is changing even on Simple clicks on chart.
{Incidentally the AFL is going to be used on a Layout with Multiple charts, with multiple Intervals (Sharing same chart_ID ) }
It will be very nice if the Seniors please guide about what should be corrected in the AFL.
With Thanks and Regards
Sanjiv Bansal