tradeRules

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RuleTypeList = map[int]Rules{
	1: &accountExitRules{Rules: &ExitRules{}},
	2: &signalExitRules{Rules: &SignalExit{Rules: &ExitRules{}}},
}

Functions

This section is empty.

Types

type AccountMaxOpenPositions

type AccountMaxOpenPositions struct {
	Max int `json:"Max"`
}

*** RULE TYPES ****************************************

type ExitRules

type ExitRules struct {
	TakeProfitInPercentage float64 `json:"TakeProfitInPercentage"`
	TakeProfitInPoints     float64 `json:"TakeProfitInPoints"`
	StopLossInPercentage   float64 `json:"StopLossInPercentage"`
	StopLossInPoints       float64 `json:"StopLossInPoints"`
}

type Rules

type Rules interface {
	ApplyRules(rule string, tr *tt.TradeRequest) error
}

type SignalExit

type SignalExit struct {
	SourceAccountID int64      `json:"SourceAccountID"`
	Rules           *ExitRules `json:"Rules"`
}

type SignalMaxOpenPositions

type SignalMaxOpenPositions struct {
	SourceAccountID int64 `json:"SourceAccountID"`
	Max             int   `json:"Max"`
}

type SymbolMaxOpenPositions

type SymbolMaxOpenPositions struct {
	Symbol string `json:"Symbol"`
	Max    int    `json:"Max"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL