I got it....Here is the code....enjoy...

Category                        = "";
function ParamCategory() // This is the main category where we look for our list
{
    global CategoryList;
    CategoryList                = "Market   ,Group    ,Sector   ,Industry 
,Watchlist,Favorite ,Index    ";
    Tickercategory      = ParamList( "Ticker category", 
"Market|Group|Sector|Industry|Watchlist|Favorite|Index", 3 ); // set to 3 for 
Industry
    Category                    = TickerCategory;
    TickerCategory      = ( StrFind( CategoryList, Tickercategory ) - 1 ) / 10;
    return TickerCategory;
}

function ParamListNum( Category ) // This is where we find the List Number
{
    global ListNum;
    ListNum             = Param( "List Number", 4, 0, 255, 1 ); // set to 4 for 
Agricultural Chemicals
    return ListNum;
}

TickerCategory  = ParamCategory();
TickerListNum   = ParamListNum( TickerCategory );
CategoryListOK  = IIf( StrLen( CategoryGetSymbols( TickerCategory, 
TickerListNum ) ) > 0, 1, 0 );
//ManualRefresh         = ParamTrigger( "Manual Refresh:", "REFRESH NOW" );
ListName                        = CategoryGetName( Tickercategory, ListNum );
Title1                          = ListName + " - " + ListNum + " - ";
Tickerlist                      = CategoryGetSymbols( Tickercategory, ListNum );
Filter = 1;

IIDnum = ListNum;
IIDname = ListName;
CompName     = "~i" + IIDnum + "-" + StrLeft( IIDname, 16 );


/////////////////


EnableScript("JScript");
<%
function SetChartTicker(newTicker)
{
AB = new ActiveXObject("Broker.Application");
AB.ActiveDocument.Name = newTicker;
return 1;
}
%>

TickerChanged = IIf(Name() != CompName,1,0);

if(TickerChanged)
{
script = GetScriptObject();
script.SetChartTicker(CompName);
}
/////////////////



SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, 
Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | 
ParamStyle("Style") | GetPriceStyle() ); 




--- In [email protected], "gmorlosky" <gmorlo...@...> wrote:
>
> What is the function that can force a new current symbol ? I want to cycle 
> through industrys using a parameter in an indicator and as each new indicator 
> is drawn, I want the current symbol to be a composite of that industry group, 
> which I have previously created with a unique name ?
> 
> I just need to force "CompName" to be the current Symbol.
> ...
> IIDnum = ListNum; // selected by param above
> IIDname = ListName; // selected by param above
> CompName     = "~i" + IIDnum + "-" + StrLeft( IIDname, 16 );
> ...
>


Reply via email to