Documentation
¶
Index ¶
- Constants
- type OrderConditiondeprecated
- type Schedulerdeprecated
- type TrailingStopdeprecated
- func NewTrailingStop() *TrailingStopdeprecated
Constants ¶
const MaxOrderAttempts = 3
MaxOrderAttempts is how many times a Scheduler sends the order of a condition met, once per Update while it fails: past it, the condition is dropped, an error logged, never sent again.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler
deprecated
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler sends an order at the market once a condition is met on a candle, the condition dropped once sent, or after MaxOrderAttempts failures.
Deprecated: no agent uses it, only the unregistered strategy of agents/strategies.NewTrailing. Kept until its removal is decided.
func NewScheduler
deprecated
type TrailingStop
deprecated
type TrailingStop struct {
// contains filtered or unexported fields
}
TrailingStop follows the best price of a position, its stop moved by as much as the price moves in favor of the position, never back: of a BUY when started with the stop below the price, of a SELL when above it.
Deprecated: no agent uses it, only the unregistered strategy of agents/strategies.NewTrailing; the agents trail their stops at the broker, see agents/strategies (trailing-atr). Kept until its removal is decided.
func NewTrailingStop
deprecated
func NewTrailingStop() *TrailingStop
NewTrailingStop returns a trailing stop not started.
Deprecated: see TrailingStop.
func (TrailingStop) Active ¶
func (t TrailingStop) Active() bool
func (*TrailingStop) Start ¶
func (t *TrailingStop) Start(current, stop float64)
Start follows a position at current with its stop: of a SELL when stop is above current, else of a BUY.
func (*TrailingStop) Stop ¶
func (t *TrailingStop) Stop()
func (*TrailingStop) Update ¶
func (t *TrailingStop) Update(current float64) bool
Update moves the stop with a price better than the best one since the start, by as much, so a price back from a worse one doesn't move it, and tells whether current reached it: at or below it for a BUY, at or above it for a SELL.