|
Reserve Words, Skip Words, and Comments
Reserve words are words in easy language that have built in meanings. For instance, the word close already refers to the closing price of the current bar. Therefore, the word close is reserved and cannot be used as an input or variable name. Reserve words are color coded in blue. Click here for a full list of reserve words.
inputs:
MAVGPeriod( 20 ); // The default value is 20
variables:
{ The default value is 0, which implies that it is numeric }
MAVGValue( 0 );
{ code executes on the close of every bar, so our MAVGValue variable will update every bar as well }
MAVGValue=average(close, MAVGPeriod);
// The plot statement is used to plot a value on your chart
Plot1(MAVGValue);
|