PINE LIBRARY
업데이트됨 libKageBot

Library "libKageBot"
Library of function to generate command strings for bots FrostyBot and Zignally. This version ONLY WORKS WITH FROSTYBOT.
strSize(_sizePercent, _sizeCurrency)
Converts a float to a formated string suitable to position size in percentage or currency. At leaste one parameter must be given
Parameters:
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A formated string containing the position size
entry(_bot, _direction, _sizePercent, _sizeCurrency)
Generates a simple entry command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_direction: (string) Flag to opena long or a short position. Must be either DIRECTION_LONG or DIRECTION_SHORT constant
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a simple open position command
exit(_bot, _sizePercent, _sizeCurrency, _reduce)
Generates a simple exit command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
_reduce: (bool) Flag to use Ruce Only option on Binance positions. Optional. Default = true
Returns: (string) A string of a simple close position command
cancelAll(_bot)
Generates a command string for a bot that cancels all open orders
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
Returns: (string) A string of a command to cancel all open orders
leverage(_bot, _leverage, _type)
Generates a command string for a bot to set leverage
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_leverage: (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_type: (string) Type of leverage. Must be either LEVERAGE_CROSS or LEVERAGE_ISOLATED. Optional. Default is LEVERAGE_CROSS.
Returns: (string) A string of a simple leverage command
entryLong(_bot, _leverage, _leverageType, _sizePercent, _sizeCurrency)
Generates a complete long entry command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_leverage: (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_leverageType: (string) Type of leverage. Must be either LEVERAGE_CROSS or LEVERAGE_ISOLATED. Optional. Default is LEVERAGE_CROSS.
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a complete open long position command
entryShort(_bot, _leverage, _leverageType, _sizePercent, _sizeCurrency)
Generates a complete short entry command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_leverage: (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_leverageType
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a complete open short position command
exitPosition(_bot, _sizePercent, _sizeCurrency, _reduce)
Generates a complete close position command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
_reduce: (bool) Flag to use Ruce Only option on Binance positions. Optional. Default = true
Returns: (string) A string of a comlete close position command
printBot(_bot, _command)
Print bot's information for debug purposes
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_command: (string) A command string to be debugged
Returns: Nothing.
Constants
Constants to be used in both in internal and external code
Fields:
SERVER_FROSTBOT: (string) Identifier to FrostyBot
SERVER_ZIGNALY: (string) Identifier to Zignaly
DIRECTION_LONG: (string) Flag to open a long position
DIRECTION_SHORT
LEVERAGE_CROSS: (string) Flag to set leverage to cross
LEVERAGE_ISOLATED: (string) Flag to set leverage to isolated
TradeBot
Bot type to handle its essential information
Fields:
server: (string) Type o server. Must me one of the SERVER_* constant values
id: (string) Id of the account in the server (Stub for FrostyBot or Key to Zignally)
symbol: (string) Symbol of the pair to be negotiated (example: ETH/USDT)
leverage: (int) Leverage coeficient. Default is 1
Library of function to generate command strings for bots FrostyBot and Zignally. This version ONLY WORKS WITH FROSTYBOT.
strSize(_sizePercent, _sizeCurrency)
Converts a float to a formated string suitable to position size in percentage or currency. At leaste one parameter must be given
Parameters:
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A formated string containing the position size
entry(_bot, _direction, _sizePercent, _sizeCurrency)
Generates a simple entry command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_direction: (string) Flag to opena long or a short position. Must be either DIRECTION_LONG or DIRECTION_SHORT constant
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a simple open position command
exit(_bot, _sizePercent, _sizeCurrency, _reduce)
Generates a simple exit command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
_reduce: (bool) Flag to use Ruce Only option on Binance positions. Optional. Default = true
Returns: (string) A string of a simple close position command
cancelAll(_bot)
Generates a command string for a bot that cancels all open orders
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
Returns: (string) A string of a command to cancel all open orders
leverage(_bot, _leverage, _type)
Generates a command string for a bot to set leverage
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_leverage: (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_type: (string) Type of leverage. Must be either LEVERAGE_CROSS or LEVERAGE_ISOLATED. Optional. Default is LEVERAGE_CROSS.
Returns: (string) A string of a simple leverage command
entryLong(_bot, _leverage, _leverageType, _sizePercent, _sizeCurrency)
Generates a complete long entry command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_leverage: (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_leverageType: (string) Type of leverage. Must be either LEVERAGE_CROSS or LEVERAGE_ISOLATED. Optional. Default is LEVERAGE_CROSS.
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a complete open long position command
entryShort(_bot, _leverage, _leverageType, _sizePercent, _sizeCurrency)
Generates a complete short entry command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_leverage: (int) The amount of leverage to be used when opening a position. Optional. If does not given, the bot's default will be used
_leverageType
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
Returns: (string) A string of a complete open short position command
exitPosition(_bot, _sizePercent, _sizeCurrency, _reduce)
Generates a complete close position command string for a bot
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_sizePercent: (float) Position size in percent value. Optional. Default = na. Mandatory if _sizeCurrency is not given.
_sizeCurrency: (float) Position size in currency value. Optional. Default = na. Mandatory if _sizePercent is not given.
_reduce: (bool) Flag to use Ruce Only option on Binance positions. Optional. Default = true
Returns: (string) A string of a comlete close position command
printBot(_bot, _command)
Print bot's information for debug purposes
Parameters:
_bot: (TradeBot) Previously instancied bot type variable
_command: (string) A command string to be debugged
Returns: Nothing.
Constants
Constants to be used in both in internal and external code
Fields:
SERVER_FROSTBOT: (string) Identifier to FrostyBot
SERVER_ZIGNALY: (string) Identifier to Zignaly
DIRECTION_LONG: (string) Flag to open a long position
DIRECTION_SHORT
LEVERAGE_CROSS: (string) Flag to set leverage to cross
LEVERAGE_ISOLATED: (string) Flag to set leverage to isolated
TradeBot
Bot type to handle its essential information
Fields:
server: (string) Type o server. Must me one of the SERVER_* constant values
id: (string) Id of the account in the server (Stub for FrostyBot or Key to Zignally)
symbol: (string) Symbol of the pair to be negotiated (example: ETH/USDT)
leverage: (int) Leverage coeficient. Default is 1
릴리즈 노트
v2Updated:
Constants
Constants to be used in both in internal and external code
Fields:
SERVER_FROSTBOT: (string) Identifier to FrostyBot
SERVER_ZIGNALY: (string) Identifier to Zignaly
DIRECTION_LONG: (string) Flag to open a long position
DIRECTION_SHORT: (string) Flag to open a short position
LEVERAGE_CROSS: (string) Flag to set leverage to cross
LEVERAGE_ISOLATED: (string) Flag to set leverage to isolated
TradeBot
Bot type to handle bot's essential information
Fields:
server: (string) Type o server. Must me one of the SERVER_* constant values
id: (string) Id of the account in the server (Stub for FrostyBot or Key to Zignally)
symbol: (string) Symbol of the pair to be negotiated (example: ETH/USDT)
leverage: (int) Leverage coeficient. Default is 1
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.