Symbol() OR NULL ?

 
I've seen in alot of indicators that if there is any sub-indicator, like an indicator based on moving averages, stochastichs or so, those sub-indicators inside an indicator either have the symbol set to NULL or to Symbol(). Whats the difference between it?
 
Proximus:
I've seen in alot of indicators that if there is any sub-indicator, like an indicator based on moving averages, stochastichs or so, those sub-indicators inside an indicator either have the symbol set to NULL or to Symbol(). Whats the difference between it?
NULL is a special constant and equals int 0, and can represent "the current chart symbol" for many functions, although not all . . . Symbol() means the current chart symbol.
 
RaptorUK:
NULL is a special constant and equals int 0, and can represent "the current chart symbol" for many functions, although not all . . . Symbol() means the current chart symbol.

so it's more accurate to use Symbol() if the indicator is only running on the plotted chart and doesnt take data from other ones?
 
Proximus:
so it's more accurate to use Symbol() if the indicator is only running on the plotted chart and doesnt take data from other ones?


It is more logical. Using a substitute for integer zero, which name is NULL, and placing it where a string is expected, it is rather misleading.
 
Proximus:
so it's more accurate to use Symbol() if the indicator is only running on the plotted chart and doesnt take data from other ones?

Not more or less accurate but certainly is unambiguous and less prone to causing errors as it's harder to use incorrectly. It will probably be imperceptably slower . . .
 
RaptorUK:
NULL is a special constant and equals int 0, and can represent "the current chart symbol" for many functions, although not all . . . Symbol() means the current chart symbol.

I am probably tired, but Symbol() isn't always the current chart symbol ?
 
angevoyageur:
I am probably tired, but Symbol() isn't always the current chart symbol ?

Yes it is . . . but NULL "equals int 0, and can represent "the current chart symbol" for many functions, although not all . . . . "
 
RaptorUK:
Yes it is . . . but NULL "equals int 0, and can represent "the current chart symbol" for many functions, although not all . . . . "

Oops...yes I am tired
Reason: