From 941e1bfb0ceba6fcdb5fe37d53995571772216bc Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 4 Jul 2022 20:08:06 +0800 Subject: [PATCH] doc: add notify api example --- doc/topics/developing-strategy.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/topics/developing-strategy.md b/doc/topics/developing-strategy.md index 77870ea1a..de727474e 100644 --- a/doc/topics/developing-strategy.md +++ b/doc/topics/developing-strategy.md @@ -403,6 +403,14 @@ bbgo.Notify(object, object2, object3) Note that, if you're using the third format, simple arguments (float, bool, string... etc) will be used for calling the fmt.Sprintf, and the extra arguments will be rendered as attachments. +For example: + +```go +bbgo.Notify("%s found support price: %f", "BTCUSDT", 19000.0, kline) +``` + +The above call will render the first format string with the given float number 19000, and then attach the kline object as the attachment. + ## Handling Trades and Profit ## Persistence