私は「定量的金融」でこの質問をしようとしましたが、取引よりもプログラミングに関する質問なので、これはより良い場所のようです
インターフェイスをどのように宣言しIndicator
ますか?「インジケーター」をモデル化する正しい方法は何でしょうか?
私はc#を使用しており、次Indicator
のようにインターフェイスを宣言したいと思います。
interface Indicator
{
double Value { get; }
event Action<Void> ValueUpdated;
}
またはおそらくこのように:
interface Indicator
{
event Action<Double> ValueUpdated;
}
私は「純粋な価格」も些細な指標と考えています。
class PriceIndicator : Indicator {
PriceIndicator(string ticker) {
....
}
}
MAの例:
class MovingAverage : Indicator {
private PriceIndicator price;
public MovingAverage(PriceIndicator price, int period) {
....
}
// when price.ValueUpdated event occurs need to recalculate MA and raise ValueUpdated event
}
どう思いますか?どんな提案でも大歓迎です!