TradingView
kaigouthro
29 sept. 2022 02:44

FrostyBot 

NEM / TetherUS PERPETUAL CONTRACTBinance

Description

Library "FrostyBot"

JSON Alert Builder for FrostyBot.js Binance Futures and FTX orders
github.com/CryptoMF/frostybot-js/wiki/Frostybot-Command-Reference
More Complete Version Soon.


TODO: Comment Functions and annotations from command reference ^^
TODO: Add additional whitelist and symbol mappings.


leverage()

buy()

sell()

cancelall()

closelong()

closeshort()

traillong()

trailshort()

long()

short()

takeprofit()

stoploss()

Notes de version

v2

TYPO: 'symbols' -> 'symbol'

Notes de version

v3

- Fixed 'command' for trade order.

Notes de version

v4
MAJOR overhaul,, Works a treat now.
yet to fill in the parameters and info,
please rely on frosty bot's documentation for usage

TODO: the remaining functions...

Added:
map(_coin, _base, ticker)
  Map a Symbol from Tradingview to your Frostybot (REQUIRED ONCE EVER / SYMBOL)
No automatic way of this yet (to keep function available for MULTI TICKER scripts.)
  Parameters:
    _coin: (string) the left side of a pair " > ______ < / ..... " ( BTCUSDT => BTC)
    _base: (string) the right side of a pair " ...... / > ______ < " ( BTCUSDT => USDT)
    ticker: (string) the built in tickerid for the coin (syminfo.tickerid / input.symbol)

test()

Notes de version

v5
Added References and comments to functions.

Updated:
buy(stub, ticker, _qty, _sizeType, _priceType, _price, _max, postonly)
  buy order alert constructor for frostybot
  Parameters:
    stub: (string) Stub value for your Frostybot server
    ticker: (string) Syminfo.tickerid Value (BINANCE:BTCUSDTPERP)
    _qty: (float ) Quantity (Changes depending on price type)
    _sizeType: (string) "absolute" => Exact Size (Position or Qty.. SEE DOCUMENTATION!)
"factor" => Factor of current Position (1.5 = 150%, .5 = 50%)
"percent" => Percent of Equity
    _priceType: (string) "absolute" => exactly the price input is dollars
"relative" => market + price input is dollars
"percent" => market + price input is percent
    _price: (float ) Price Input (SEE DOCUMENTATION!!)
    _max: (float ) Maximum Position Size Limiter
    postonly: (bool ) Place as "post only"
  Returns: (string) Alert Message in JSON format

sell(stub, ticker, _qty, _sizeType, _priceType, _price, _max, postonly)
  sell order alert constructor for frostybot
  Parameters:
    stub: (string) Stub value for your Frostybot server
    ticker: (string) Syminfo.tickerid Value (BINANCE:BTCUSDTPERP)
    _qty: (float ) Quantity (Changes depending on price type)
    _sizeType: (string) "absolute" => Exact Size (Position or Qty.. SEE DOCUMENTATION!)
"factor" => Factor of current Position (1.5 = 150%, .5 = 50%)
"percent" => Percent of Equity
    _priceType: (string) "absolute" => exactly the price input is dollars
"relative" => market + price input is dollars
"percent" => market + price input is percent
    _price: (float ) Price Input (SEE DOCUMENTATION!!)
    _max: (float ) Maximum Position Size Limiter
    postonly: (bool ) Place as "post only"
  Returns: (string) Alert Message in JSON format

test(_testchoice, _ticker, _stub, _checkalert, _label)
  Parameters:
    _testchoice: (int) Alert to test
    _ticker: (string) Ticker input
    _stub: (string) Stub input
    _checkalert: (bool) Send alerts (3 / minute if activer)
    _label: (bool) Show Alerts on Label
Commentaires
slowcoconut
@kaigouthro are you still using Frosty? Not sure what happened to the bot recently, and I've heard the 'JackRabbit Relay' has replaced it...

btw, wishing you the best, hope all is well -- seen you've been MIA from here for a bit, so all the best to you,and thanks for building this strong foundation of pinecode (especially like the JSON library and other utilityy scripts, brilliant)
digalaxy
dont work help pls
szxyks
Thank you for sharing this amazing, well-written code.
I have the following question: After importing this line -> import kaigouthro/FrostyBot/5
How should I use it to open buy/sell orders? Would you please share a simple example how to use the code?
kaigouthro
@szxyks, line 398-409 have examples of strings generated..

example
sellJSON = sell(frostyBotStub, ticker, _qty, _sizeType, _priceType, _price, _max, postonly)


i'll post a manual soon with deeper explanations... i have an update o do as well, soon...
midaxbot
Gracias por compartir sus conocimientos con todos nosotros, gran aporte felicitaciones.
slowcoconut
the way you title sections of your code -- it is pleasing to mine eye.. lool
Plus