Library "ToolsPos"
Library for general purpose position helpers
new_pos(state, price, when, index)
Returns new PosInfo object
Parameters:
state (series PosState): <PosState> Position state
price (float): float Entry price
when (int): int Entry bar time UNIX. Default: time
index (int): int Entry bar index. Default: bar_index
Returns: PosInfo
new_tp(pos, price, when, index, info)
Returns PosInfo object with new take profit info object
Parameters:
pos (PosInfo): PosInfo object
price (float): float Entry price
when (int): int Entry bar time UNIX. Default: time
index (int): int Entry bar index. Default: bar_index
info (Info type from aybarsm/Tools/14): <Info> Info holder object. Default: na
Returns: PosInfo
new_re(pos, price, when, index, info)
Returns PosInfo object with new re-entry info object
Parameters:
pos (PosInfo): PosInfo object
price (float): float Entry price
when (int): int Entry bar time UNIX. Default: time
index (int): int Entry bar index. Default: bar_index
info (Info type from aybarsm/Tools/14): <Info> Info holder object. Default: na
Returns: PosInfo
PosTPInfo
PosTPInfo - Position Take Profit info object
Fields:
price (series float): float Take profit price
when (series int): int Take profit bar time UNIX. Default: time
index (series int): int Take profit bar index. Default: bar_index
info (Info type from aybarsm/Tools/14): <Info> Info holder object
PosREInfo
PosREInfo - Position Re-Entry info object
Fields:
price (series float): float Re-entry price
when (series int): int Re-entry bar time UNIX. Default: time
index (series int): int Take profit bar index. Default: bar_index
info (Info type from aybarsm/Tools/14): <Info> Info holder object
PosInfo
PosInfo - Position info object
Fields:
state (series PosState): <PosState> Position state
price (series float): float Entry price
when (series int): int Entry bar time UNIX. Default: time
index (series int): int Entry bar index. Default: bar_index
tp (array<PosTPInfo>): PosTPInfo[] Take profit info. Default: na
re (array<PosREInfo>): PosREInfo[] Re-entry info. Default: na
info (Info type from aybarsm/Tools/14): <Info> Info holder object
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the
Terms of Use.