Documentation ¶
Index ¶
Constants ¶
View Source
const ID = "ewo_dgtrd"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeikinAshi ¶
func NewHeikinAshi ¶
func NewHeikinAshi(size int) *HeikinAshi
func (*HeikinAshi) Print ¶
func (s *HeikinAshi) Print() string
func (*HeikinAshi) Update ¶
func (inc *HeikinAshi) Update(kline types.KLine)
type Strategy ¶
type Strategy struct { Market types.Market Session *bbgo.ExchangeSession UseHeikinAshi bool `json:"useHeikinAshi"` // use heikinashi kline Stoploss fixedpoint.Value `json:"stoploss"` Symbol string `json:"symbol"` Interval types.Interval `json:"interval"` UseEma bool `json:"useEma"` // use exponential ma or not UseSma bool `json:"useSma"` // if UseEma == false, use simple ma or not SignalWindow int `json:"sigWin"` // signal window DisableShortStop bool `json:"disableShortStop"` // disable TP/SL on short *bbgo.Graceful bbgo.SmartStops // contains filtered or unexported fields }
func (*Strategy) Initialize ¶
func (*Strategy) Run ¶
func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error
Trading Rules: - buy / sell the whole asset - SL/TP by atr (buyprice - 2 * atr, sellprice + 2 * atr) - SL by s.Stoploss (Abs(price_diff / price) > s.Stoploss) - entry condition on ewo(Elliott wave oscillator) Crosses ewoSignal(ma on ewo, signalWindow)
- buy signal on crossover
- sell signal on crossunder
- and filtered by the following rules:
- buy: prev buy signal ON and current sell signal OFF, kline Close > Open, Close > ma(Window=5), ewo > Mean(ewo, Window=5)
- sell: prev buy signal OFF and current sell signal ON, kline Close < Open, Close < ma(Window=5), ewo < Mean(ewo, Window=5)
Cancel and repost on non-fully filed orders every 1m within Window=1
ps: kline might refer to heikinashi or normal ohlc
func (*Strategy) SetupIndicators ¶
func (s *Strategy) SetupIndicators()
func (*Strategy) Subscribe ¶
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
type UpdatableSeries ¶
type VWEMA ¶
type VWEMA struct { PV UpdatableSeries V UpdatableSeries }
Click to show internal directories.
Click to hide internal directories.