Skip to content

Commit

Permalink
Add security board and code to OpenPositionAction
Browse files Browse the repository at this point in the history
  • Loading branch information
evsamsonov committed Dec 28, 2023
1 parent 7795fa2 commit 4316fbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
25 changes: 21 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
lint:
.PHONY: help lint test doc
.DEFAULT_GOAL := help

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

pre-push: lint test ## Run golang lint and test

lint: ## Run golang lint using docker
go mod download
docker run --rm \
-v ${GOPATH}/pkg/mod:/go/pkg/mod \
-v ${PWD}:/app \
-w /app \
golangci/golangci-lint:v1.53.3 \
golangci/golangci-lint:v1.54.2 \
golangci-lint run -v --modules-download-mode=readonly

test:
GOARCH=amd64 go test ./...
test: ## Run tests
GOARCH=amd64 go test ./...

doc: ## Run doc server using docker
@echo "Doc server runs on http://127.0.0.1:6060"
docker run --rm \
-p 127.0.0.1:6060:6060 \
-v ${PWD}:/go/src/github.com/evsamsonov/trengin \
-w /go/src/github.com/evsamsonov/trengin \
golang:latest \
bash -c "go install golang.org/x/tools/cmd/godoc@latest && /go/bin/godoc -http=:6060"
2 changes: 2 additions & 0 deletions trengin.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ func (p *Position) RangeExtra(f func(key interface{}, val interface{})) {

// OpenPositionAction is an action to open a position
type OpenPositionAction struct {
SecurityBoard string // Trading mode identifier. Example, TQBR
SecurityCode string // Example, SBER
FIGI string // Financial Instrument Global Identifier
Type PositionType
Quantity int64
Expand Down

0 comments on commit 4316fbe

Please sign in to comment.