[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: What is the function that can force a new current symbol ?



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "gmorlosky" <gmorlosky@xxx> 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 );
> ...
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/