Parameter, Flag, Argument meaning, was: AFL Plot function.

someone please explain the difference between a parameter, flag and an argument by taking the plot function as an example.

In this context parameter and argument are pretty much synonyms, see:

Some make distinction using the term parameter for "formal argument" in function definition, while using argument to indicate actual value passed in function call. So, in

Plot( array, name, color, style = styleLine, minvalue = Null, maxvalue = Null, XShift = 0, Zorder = 0, width = 1 )

the array, name, color, style, minvalue, maxvalue, xshift, zorder, width would be called parameters or formal arguments.

Then in

Plot(Close,"MyTitle",colorBlack);

the Close, "MyTitle", colorBlack would be actual arguments of function call.

But I am not that strict and I bet there are lots of places in the documentation where I could interchange both.

Flag usually means an "on/off" switch, usually represented by value being power of 2 (such as 1, 2, 4, 8, 16, 32, 64 and so on) that can be combined with other switches using Binary OR operator: |

So for example style parameter in Plot() function can be combination of several flags such as styleLine | styleThick giving you thick line.:

Plot(Close,"Close",colorBlack,styleLine | styleThick);
1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.