PINE LIBRARY

PineHelper

Updated
Library "PineHelper"
This library provides various functions to reduce your time.

recent_opentrade_entry_bar_index()
  get a recent opentrade entry bar_index
  Returns: (int) bar_index

recent_closedtrade_entry_bar_index()
  get a recent closedtrade entry bar_index
  Returns: (int) bar_index

recent_closedtrade_exit_bar_index()
  get a recent closedtrade exit bar_index
  Returns: (int) bar_index

all_opnetrades_roi()
  get all aopentrades roi
  Returns: (float) roi

bars_since_recent_opentrade_entry()
  get bars since recent opentrade entry
  Returns: (int) number of bars

bars_since_recent_closedtrade_entry()
  get bars since recent closedtrade entry
  Returns: (int) number of bars

bars_since_recent_closedtrade_exit()
  get bars since recent closedtrade exit
  Returns: (int) number of bars

recent_opentrade_entry_id()
  get recent opentrade entry ID
  Returns: (string) entry ID

recent_closedtrade_entry_id()
  get recent closedtrade entry ID
  Returns: (string) entry ID

recent_closedtrade_exit_id()
  get recent closedtrade exit ID
  Returns: (string) exit ID

recent_opentrade_entry_price()
  get recent opentrade entry price
  Returns: (float) price

recent_closedtrade_entry_price()
  get recent closedtrade entry price
  Returns: (float) price

recent_closedtrade_exit_price()
  get recent closedtrade exit price
  Returns: (float) price

recent_opentrade_entry_time()
  get recent opentrade entry time
  Returns: (int) time

recent_closedtrade_entry_time()
  get recent closedtrade entry time
  Returns: (int) time

recent_closedtrade_exit_time()
  get recent closedtrade exit time
  Returns: (int) time

time_since_recent_opentrade_entry()
  get time since recent opentrade entry
  Returns: (int) time

time_since_recent_closedtrade_entry()
  get time since recent closedtrade entry
  Returns: (int) time

time_since_recent_closedtrade_exit()
  get time since recent closedtrade exit
  Returns: (int) time

recent_opentrade_size()
  get recent opentrade size
  Returns: (float) size

recent_closedtrade_size()
  get recent closedtrade size
  Returns: (float) size

all_opentrades_size()
  get all opentrades size
  Returns: (float) size

recent_opentrade_profit()
  get recent opentrade profit
  Returns: (float) profit

all_opentrades_profit()
  get all opentrades profit
  Returns: (float) profit

recent_closedtrade_profit()
  get recent closedtrade profit
  Returns: (float) profit

recent_opentrade_max_runup()
  get recent opentrade max runup
  Returns: (float) runup

recent_closedtrade_max_runup()
  get recent closedtrade max runup
  Returns: (float) runup

recent_opentrade_max_drawdown()
  get recent opentrade maxdrawdown
  Returns: (float) mdd

recent_closedtrade_max_drawdown()
  get recent closedtrade maxdrawdown
  Returns: (float) mdd

max_open_trades_drawdown()
  get max open trades drawdown
  Returns: (float) mdd

recent_opentrade_commission()
  get recent opentrade commission
  Returns: (float) commission

recent_closedtrade_commission()
  get recent closedtrade commission
  Returns: (float) commission

qty_by_percent_of_equity(percent)
  get qty by percent of equtiy
  Parameters:
    percent: (series float) percent that you want to set
  Returns: (float) quantity

qty_by_percent_of_position_size(percent)
  get size by percent of position size
  Parameters:
    percent: (series float) percent that you want to set
  Returns: (float) size

is_day_change()
  get bool change of day
  Returns: (bool) day is change or not

is_in_trade()
  get bool using number of bars
  Returns: (bool) allowedToTrade

discord_message(name, message)
  get json format discord message
  Parameters:
    name: (string) name of bot
    message: (string) message that you want to send
  Returns: (string) json format string

telegram_message(chat_id, message)
  get json format telegram message
  Parameters:
    chat_id: (string) chatId of bot
    message: (string) message that you want to send
  Returns: (string) json format string
Release Notes
v2
Change comparision operation ">0" to "!="
Release Notes
v3

Add helper functions

is_first_day()
  Check if today is the first day
  Returns: (bool) true if today is the first day, false otherwise

is_last_day()
  Check if today is the last day
  Returns: (bool) true if today is the last day, false otherwise

is_trade_open()
  Check if trade is open
  Returns: (bool) true if trade is open, false otherwise

is_trade_closed()
  Check if trade is closed
  Returns: (bool) true if trade is closed, false otherwise
Release Notes
v4

Add helper functions.
is_trade_win()
  Check if trade is win
  Returns: (bool) true if trade is win, false otherwise

is_trade_loss()
  Check if trade is loss
  Returns: (bool) true if trade is loss, false otherwise
Release Notes
v5

더해짐
real_qty(qty)
  Get exchange specific real qty
  Parameters:
    qty: (float) qty
Release Notes
change function name.
alertsformattinghelperhelperfunctionpinehelperstrategies

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.


알고리즘 트레이딩, 파인스크립트, 자동매매를 다루고 있습니다

[파인스크립트 무료강의]
gojdk.com/pinescript-start

[파인스크립트 with 자동매매]
gojdk.com/pinescript-tradinghook

[유튜브]
gojdk.com/youtube

[디스코드]
gojdk.com/discord

Disclaimer