Screener ExampleΒΆ
Generally, an asset screener filters a universe of assets to identify those that meet some criteria/s. In boatwright, the boatwright.Screener filters an asset universe using one or more boatwright.Strategy instances and counts how many orders have been generated in a recent period. For convenience, users can save asset universes in CSV files, and define a collection of strategies, including variable parameter settings, in a JSON file. In addition to writing a python program, the screener can be run from the command line interface as:
boatwright screen -sf strategies.json -uv universe.csv -tp 3 -dg "DAY"
Strategies JSON file: ../../examples/screener_example/strategies.json
{
"MACD_fast": {
"file": "../MACD.py",
"parameters": {
"fast_period": 5,
"slow_period": 10
}
},
"MACD_medium": {
"file": "../MACD.py",
"parameters": {
"fast_period": 7,
"slow_period": 14
}
},
"MACD_slow": {
"file": "../MACD.py",
"parameters": {
"fast_period": 12,
"slow_period": 26
}
},
"StochasticOscillator_fast": {
"file": "../stochastic_oscillator.py",
"parameters": {
"k_period": 7,
"d_period": 2
}
},
"StochasticOscillator_medium": {
"file": "../stochastic_oscillator.py",
"parameters": {
"k_period": 14,
"d_period": 3
}
},
"StochasticOscillator_slow": {
"file": "../stochastic_oscillator.py",
"parameters": {
"k_period": 21,
"d_period": 5
}
},
"BollingerBands_fast": {
"file": "../bollinger_bands.py",
"parameters": {
"period": 10,
"std_devs": 2
}
},
"BollingerBands_medium": {
"file": "../bollinger_bands.py",
"parameters": {
"period": 20,
"std_devs": 2
}
},
"BollingerBands_slow": {
"file": "../bollinger_bands.py",
"parameters": {
"period": 40,
"std_devs": 2
}
}
}