Isn't the following simpler? (available to ALL charts )

 

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

NameL  = StrLeft(Name(),4); //truncate Symbol to 4 characters
used in Titles

SymbL1 = StrLeft(Name(),1); //truncate name to 1 left char,
differentiate start time of currencies

SymbL2 = StrLeft(Name(),2);

 

StaticVarSetText("NameL"+Name(),NameL);

StaticVarSetText("SymbL1"+Name(),SymbL1);

StaticVarSetText("SymbL2"+Name(),SymbL2);

 

Title = NameL+StrFormat("- {{INTERVAL}} {{DATE}} , C=%g, H=%g,
L=%g,     V={{VALUES}}"+

                     NumToStr(Volume,1.0,separator=True), C,
H, L);

 

//permanent TickSize for all futures

TickSize_ = IIf(SymbL1 == "6" OR SymbL2 ==  "E7", 0.0001,

                       IIf(SymbL2 == "6B" , 0.0002,

                       IIf(SymbL2 == "6J" , 0.000001,

                       IIf(SymbL2 == "ER" OR SymbL2 == "SP" OR
SymbL2 == "IN" OR SymbL2 == "ME", 0.1,

                       IIf(SymbL2 == "ES" OR SymbL2 == "NQ",
0.25,

                       IIf(SymbL2 == "YM" OR SymbL2 == "TI" OR
SymbL2 == "HS", 1.0, 0.01))))));

 

InvTick = Nz(1/TickSize_,0.001) ; // save On divisions

 

PriceFormat = IIf(SymbL1 == "6" OR SymbL2=="E7", 1.4, 

                           IIf(SymbL2 == "6J" , 1.7,

                           IIf(SymbL2 == "ER" OR SymbL2 ==
"SP" OR SymbL2 == "IN" OR SymbL2 == "ME", 1.1,

                           IIf(SymbL2 == "YM" OR SymbL2 ==
"TI" OR SymbL2 == "HS", 1.0, 1.2))));

 

StaticVarSet("TickSize_"+Name(),TickSize_);

StaticVarSet("InvTick"+Name(),LastValue(InvTick) ) ;

StaticVarSet("PriceFormat"+Name(),PriceFormat);

 

//PointValue = not implemented yet additions welcome.

 

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

 

Joseph Biran

____________________________________________

-----Original Message-----
From: [email protected] On Behalf Of vlanschot
Sent: Tuesday, January 29, 2008 9:10 AM
To: [email protected]
Subject: [amibroker] Re: Multiple string constants in switch()
case statement

 

Perhaps importing your details via the ASCII-importer is a
solution. 

You basically input&update your details for a list of symbols
for 

example in a XL-file, save it as a csv-file, and import once
after 

each adjustment:

 

Your format-file (to call via the ASCII-importer) looks, for
example, 

like this:

 

$FORMAT Ticker,FullName

$SKIPLINES 1

$SEPARATOR ,

$OVERWRITE 1

$AUTOADD 1

$NOQUOTES 1

 

The actual csv-file which you then import looks like this:

 

Ticker,Fname

ACNFCOMF IX,ABC News Washington Post US Weekly Consumer
Comfort Index

ADP CHNG IX,ADP National Employment Report SA Private Nonfarm
Level 

Change

CHPMINDX IX,US Chicago Purchasing Managers Index SA

 

Obviously, you will need to use/add the variable names for the


specific items you want to include in your overview but these
are 

described in the User Manual; search for ascii)

 

PS

--- In [email protected], "J. Biran" <[EMAIL PROTECTED]>
wrote:

> 

> 

> Because future contracts expire and the job needs to be

> repeated over and over

> 

> Joseph Biran

> ____________________________________________

> -----Original Message-----

> From: [email protected]

> [mailto:[EMAIL PROTECTED] On Behalf Of Tomasz

> Janeczko

> Sent: Tuesday, January 29, 2008 4:17 AM

> To: [email protected]

> Subject: Re: [amibroker] Re: Multiple string constants in

> switch() case statement

> 

> Why don't you just use the EDIT fields

> in the View->Information window.

> 

> There are fields that allow you to enter point value,
ticksize

> and margin deposit on per-symbol basis

> and you don't need to code it at all!

> 

> http://www.amibroker.com/guide/w_information.html

> 

> Best regards,

> Tomasz Janeczko

> amibroker.com

> ----- Original Message ----- 

> From: "bilbo0211" <[EMAIL PROTECTED]>

> To: <[email protected]>

> Sent: Tuesday, January 29, 2008 7:48 AM

> Subject: [amibroker] Re: Multiple string constants in
switch()

> case statement

> 

> 

> >I think what you want is:

> > 

> > symcurrency = StrToUpper( StrLeft( sym, 6 ) );

> > switch ( symcurrency )

> > {

> > case "AUDUSD":

> > case "CADUSD":

> > case "CHFUSD":

> > case "EURUSD":

> > case "GBPUSD":

> > case "HKDUSD":

> > case "MXNUSD":

> > case "NLGUSD":

> > case "NZDUSD":

> > case "SEKUSD":

> > case "SGDUSD":

> > 

> > myPointValue = 100000;

> > myTickSize = 0.0001;

> > myMarginDeposit = 1000;

> > break;

> > 

> > case "JPYUSD"

> > :

> > myPointValue = 100000;

> > myTickSize = 0.01;

> > myMarginDeposit = 1000;

> > break;

> > 

> > I think a simpler way to accomplish your goal is:

> > 

> > mult=IIF(C>10,100,1);

> > myTickSize = 0.0001*mult;

> > 

> > Bill

> > 

> > --- In [email protected], "whitneybroach"

> <WhitneyBroach@>

> > wrote:

> >>

> >> Can it be done?  Formula Editor doesn't like this, but I

> wonder

> >> something similar is even possible?

> >> 

> >> ////////////////////////////////////////////

> >> symcurrency = StrToUpper( StrLeft( sym, 6 ) );

> >> switch ( symcurrency )

> >> {

> >>   case "AUDUSD"

> >>       ,"CADUSD"

> >>       ,"CHFUSD"

> >>       ,"EURUSD"

> >>       ,"GBPUSD"

> >>       ,"HKDUSD"

> >>       ,"MXNUSD"

> >>       ,"NLGUSD"

> >>       ,"NZDUSD"

> >>       ,"SEKUSD"

> >>       ,"SGDUSD"

> >>       :

> >>     myPointValue = 100000;

> >>     myTickSize = 0.0001;

> >>     myMarginDeposit = 1000;

> >>     break;

> >> 

> >>   case "JPYUSD"

> >>       :

> >>     myPointValue = 100000;

> >>     myTickSize = 0.01;

> >>     myMarginDeposit = 1000;

> >>     break;

> >> 

> >>   default:

> >>     myPointValue    = PointValue;

> >>     myTickSize      = TickSize;

> >>     myMarginDeposit = MarginDeposit;

> >> }

> >> ////////////////////////////////////////////

 

Reply via email to