-
Notifications
You must be signed in to change notification settings - Fork 3
Home
This wiki provides a simple viewing of the different inputs and values to the RunScreen
function.
The RunScreen
function takes a ScreenInput
struct as its primary input.
// ScreenInput represents the data passed to the screen
type ScreenInput struct {
Signal SignalType
GeneralOrder GeneralOrderType
SpecificOrder SpecificOrderType
Tickers []string
Filters []FilterInterface
}
The Tickers
input is simply a list of ticker strings. Both lowercase and uppercase forms are accepted.
Filters
are the primary parameters used to modify a screen.
Each filter has an array of default options provided by Finviz.
Initializing a filter with a default value:
industry := IndustryFilter{Gold}
Initializing a filter with multiple default values:
industry := IndustryFilter{}.SetMultipleValues(Gold, Silver, Steel)
If Finviz supports a filter option that is not currently available in the default list, it can still be used.
The custom value passed to the filter must be the same as the value passed in the Finviz screen url. For the following example, the Finviz screen url would contain the parameter exch_virtualreality
. Thus, virtualreality
must be passed to the filter as shown below.
Initializing a filter with a custom value:
industry := IndustryFilter{"virtualreality"}
Each filter, by definition, stores its own URL prefix. Examples include exch_
, fa_netmargin_
, and ta_sma200_
respectively for Exchange, Net Profit Margin, and 200-Day Simple Moving Average.
Users only need to register the filter value they want to use, i.e. NYSE
, OMUnder80
, Price10PercentBelowSMA200
.
The values of the default 60+ filters provided by Finviz have already been defined as constants in filters.go
.
All registered filters are documented below.