Seer logo - advanced backtesting for stock, futures and forex trading systems using using technical analysis indicators, charts, money management and position sizing
Functions by Category Functions by Alphabetical list

NumberOfBars

Usable in an seer event objectUsable in an seer indicator objectUsable in an seer chart object

This function returns the number of bars for the current symbol. This function is used to iterate though the bars of a column. When iterating, the first item is zero while the last item is NumberOfBars-1.

This function is typically used when creating your own indicators or charts. It should not be used in the Bar event.

Examples:

 #Loop round all the "cells" in the column
 for my $bar (0..NumberOfBars-1) {
   #workout the average of the open and close 
   $answer=(Value(Open,$bar)+Value(Close,$bar))/2;
   #set the answer for the new column
   SetValue($col,$bar,$answer);
 }

Related functions:

ValidatePeriods , ValidateColumns , SetColumnName , Value , SetValue , BarsBack , NewColumn , SetColumnType

© 2011 seer trading systems ltd
feedback FAQ legal privacy