Few quick questions - page 2

 
Proximus:

Understood.I have 1 more question.

Can i put all myindicators in the Init(),

Read all the posts from today . . . that may not be the best idea.
 
RaptorUK:

I don't mind at all, I'm always ready to learn

1) How does iCustom know which of the externs you have specified ? if you provide just one does it assume it is the first ? what if you just provided the 2nd ? how would it know ? I haven't tested it, maybe you have ?
2) the simple and least prone to error advice is "specify them all or specify none" IMO . . . it may not be the minimally needed information but it should work.

add 1) C knows how to handle that: It has the option of functions called with a variable lists of parameter: http://www.cprogramming.com/tutorial/c/lesson17.html.

add 2) depends! Sometimes it could help to 'hide' things? I use e.g. Ex.Var isEAcall=true (as default) that way..

Gooly

 
WHRoeder:
Only if you call an indicator

what else can you call?
 
gooly:

add 1) C knows how to handle that: It has the option of functions called with a variable lists of parameter: http://www.cprogramming.com/tutorial/c/lesson17.html.

I don't see how that is possible . . . if there are 3 externs all type int and I specify 2 ints in the iCustom() call for the parameters which 2 are they ? 1&2, 2&3, or 1&3 ?
 
Proximus: Can i put all myindicators in the Init(),
Only if you only want the value when the EA was attached, not any subsequent values.
if ( main >50) BUY=true; // Why would you THINK main would change when the only assignment is in init()?
 
RaptorUK:
I don't see how that is possible . . . if there are 3 externs all type int and I specify 2 ints in the iCustom() call for the parameters which 2 are they ? 1&2, 2&3, or 1&3 ?

iCostume ;) knows what indicator was called, therefore it knows the amount and the sequence of its extern vars.
The first argument after the "indiName" must be ExternVariable1, the next must be the second and so on.
The list of the args. has e.g. 9 elements (size of an array). arg[0]=Symbol(), arg[1]=Period(). arg[2]=Indi.Name.
At the end arg[size-1] = last one => shift, arg[size-2] = buffer, all the others are now easy to match - no?
I assume all args are of string-type to make it as easy as possible for us users..

 
gooly:

iCostume ;) knows what indicator was called, therefore it knows the amount and the sequence of its extern vars.
The first argument after the "indiName" must be ExternVariable1, the next must be the second and so on.
The list of the args. has e.g. 9 elements (size of an array). arg[0]=Symbol(), arg[1]=Period(). arg[2]=Indi.Name.
At the end arg[size-1] = last one => shift, arg[size-2] = buffer, all the others are now easy to match - no?
I assume all args are of string-type to make it as easy as possible for us users..

OK, so you are saying that ALL the externs must be specified ? that was one of the options I gave just before you offered to correct me . . .

RaptorUK:

2. for iCustom you either specify them all or none, if you specify none then the default values coded into the Indicator are used.

 
gooly: all the others are now easy to match - no? I assume ...
Don't assume. Write a test and tell us the results, like iCustom(... 1,2,3, 0,0) where indicator has buffer[0]=extInt1+extInt2+extInt3;
 
RaptorUK:

OK, so you are saying that ALL the externs must be specified ? that was one of the options I gave just before you offered to correct me . . .


No, you must specify arg[0,1,2]: Symbol(), Period(), "indiName" and the last 2: indiBuffer, indiShirt.

If you want to have a non-default value of the second argument of the indicator you have to give the first as well!!

so double Jaws = iCustom(NULL, 0, "Alligator", 0,0) will have the the Jawe[0] of the Alligator(..) with standard values.

I'll give you an example, wait a bit..

 
gooly:

No, you must specify arg[0,1,2]: Symbol(), Period(), "indiName" and the last 2: indiBuffer, indiShirt.

If you want to have a non-default value of the second argument of the indicator you have to give the first as well!!

OK, so the safest way is specify all the externs if the users wants any that are non-default . . . or the user can specify none of the externs if they want to use just the defaults . . . which is what I said in the first place
Reason: