Documentation ¶
Overview ¶
Copyright 2022 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func PrintEod(quotes []*Eod)
- func SaveAdjCloseToDb(ctx context.Context, conn PgxIface, prices []*Eod) error
- func UpdateSyntheticHistory(ctx context.Context, conn *pgx.Conn, asset *SyntheticAsset, history []*Eod) error
- type Eod
- type PercentChange
- type PgxIface
- type SyntheticAsset
- type SyntheticComponent
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidConfig = errors.New("one of CompositeFigi or FileName must be set on a component")
)
Functions ¶
func SaveAdjCloseToDb ¶
SaveAdjCloseToDb updates database record with adjusted close value
func UpdateSyntheticHistory ¶
func UpdateSyntheticHistory(ctx context.Context, conn *pgx.Conn, asset *SyntheticAsset, history []*Eod) error
UpdateSyntheticHistory updates the database with the synthetic asset
Types ¶
type Eod ¶
type Eod struct { EventDate time.Time EventDateStr string `csv:"date"` Ticker string CompositeFigi string Close float64 AdjClose float64 `csv:"adjClose"` Dividend float64 SplitFactor float64 }
func AdjustAssetEodPrice ¶
func BuildSyntheticHistory ¶
func BuildSyntheticHistory(ctx context.Context, asset *SyntheticAsset, history []*Eod) ([]*Eod, error)
BuildSyntheticHistory iterates over all the components of a synthetic asset and calculates
func LoadEodHistory ¶
func LoadEodHistory(ctx context.Context, conn *pgx.Conn, asset *SyntheticAsset) []*Eod
loadEodHistory reads recent EOD quotes from eod