PINE LIBRARY
已更新 ToolsPos

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
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
版本注释
v2Added:
method enter(this, state, price, when, index, info)
modifies PosInfo object for new position entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
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
info (Fluent type from aybarsm/ToolsFluent/3): <Fluent> Info holder fluent object. Default: na
method action(this, type, price, when, index, info)
modifies PosInfo object for action take-profit/re-entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
type (series PosActionType): <PosActionType> Pos ActionType
price (float): float Action price
when (int): int Action bar time UNIX. Default: time
index (int): int Action bar index. Default: bar_index
info (Fluent type from aybarsm/ToolsFluent/3): <Fluent> Info holder fluent object. Default: na
PosAction
PosTPInfo - Position Take Profit info object
Fields:
type (series PosActionType)
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 (Fluent type from aybarsm/ToolsFluent/3)
Updated:
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<PosAction>): PosAction[] Take profit info. Default: na
re (array<PosAction>): PosAction[] Re-entry info. Default: na
info (Fluent type from aybarsm/ToolsFluent/3): <Fluent> Info holder fluent object. Default: na
Removed:
new_pos(state, price, when, index)
Returns new PosInfo object
new_tp(pos, price, when, index, info)
Returns PosInfo object with new take profit info object
new_re(pos, price, when, index, info)
Returns PosInfo object with new re-entry info object
PosTPInfo
PosTPInfo - Position Take Profit info object
PosREInfo
PosREInfo - Position Re-Entry info object
版本注释
v3Updated:
method action(this, actionType, price, when, index, info)
modifies PosInfo object for action take-profit/re-entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
actionType (series PosActionType)
price (float): float Action price
when (int): int Action bar time UNIX. Default: time
index (int): int Action bar index. Default: bar_index
info (Fluent type from aybarsm/ToolsFluent/3): <Fluent> Info holder fluent object. Default: na
版本注释
v4Updated:
PosInfo
PosInfo - Position info object
Fields:
state (series PosState): <PosState> Position state. Default: na
price (series float): float Entry price. Default: na
when (series int): int Entry bar time UNIX. Default: time
index (series int): int Entry bar index. Default: bar_index
tp (array<PosAction>): PosAction[] Take profit info. Default: na
re (array<PosAction>): PosAction[] Re-entry info. Default: na
info (Fluent type from aybarsm/ToolsFluent/3): <Fluent> Info holder fluent object. Default: na
版本注释
v5版本注释
v6Updated:
method enter(this, state, price, when, index, info)
modifies PosInfo object for new position entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
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
info (Fluent type from aybarsm/ToolsFluent/4): <Fluent> Info holder fluent object. Default: na
method action(this, actionType, price, when, index, info)
modifies PosInfo object for action take-profit/re-entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
actionType (series PosActionType)
price (float): float Action price
when (int): int Action bar time UNIX. Default: time
index (int): int Action bar index. Default: bar_index
info (Fluent type from aybarsm/ToolsFluent/4): <Fluent> Info holder fluent object. Default: na
PosAction
PosTPInfo - Position Take Profit info object
Fields:
type (series PosActionType)
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 (Fluent type from aybarsm/ToolsFluent/4)
PosInfo
PosInfo - Position info object
Fields:
state (series PosState): <PosState> Position state. Default: na
price (series float): float Entry price. Default: na
when (series int): int Entry bar time UNIX. Default: time
index (series int): int Entry bar index. Default: bar_index
tp (array<PosAction>): PosAction[] Take profit info. Default: na
re (array<PosAction>): PosAction[] Re-entry info. Default: na
info (Fluent type from aybarsm/ToolsFluent/4): <Fluent> Info holder fluent object. Default: na
版本注释
v7Updated:
method enter(this, state, price, when, index, info)
modifies PosInfo object for new position entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
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
info (Fluent type from aybarsm/ToolsFluent/6): <Fluent> Info holder fluent object. Default: na
method action(this, actionType, price, when, index, info)
modifies PosInfo object for action take-profit/re-entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
actionType (series PosActionType)
price (float): float Action price
when (int): int Action bar time UNIX. Default: time
index (int): int Action bar index. Default: bar_index
info (Fluent type from aybarsm/ToolsFluent/6): <Fluent> Info holder fluent object. Default: na
PosAction
PosTPInfo - Position Take Profit info object
Fields:
type (series PosActionType)
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 (Fluent type from aybarsm/ToolsFluent/6)
PosInfo
PosInfo - Position info object
Fields:
state (series PosState): <PosState> Position state. Default: na
price (series float): float Entry price. Default: na
when (series int): int Entry bar time UNIX. Default: time
index (series int): int Entry bar index. Default: bar_index
tp (array<PosAction>): PosAction[] Take profit info. Default: na
re (array<PosAction>): PosAction[] Re-entry info. Default: na
info (Fluent type from aybarsm/ToolsFluent/6): <Fluent> Info holder fluent object. Default: na
版本注释
v8Updated:
PosAction
PosTPInfo - Position Take Profit info object
Fields:
actionType (series PosActionType)
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 (Fluent type from aybarsm/ToolsFluent/6)
版本注释
v9Updated:
method enter(this, state, price, when, index, markPrice, markWhen, markIndex)
modifies PosInfo object for new position entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
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
markPrice (float): float Mark price. Default: na
markWhen (int): int Mark bar time UNIX. Default: na
markIndex (int): int Mark bar index. Default: na
method action(this, actionType, price, when, index, markPrice, markWhen, markIndex)
modifies PosInfo object for action take-profit/re-entry
Namespace types: PosInfo
Parameters:
this (PosInfo)
actionType (series PosActionType)
price (float): float Action price
when (int): int Action bar time UNIX. Default: time
index (int): int Action bar index. Default: bar_index
markPrice (float): float Mark price. Default: na
markWhen (int): int Mark bar time UNIX. Default: na
markIndex (int): int Mark bar index. Default: na
PosAction
PosTPInfo - Position Action info object
Fields:
actionType (series PosActionType)
price (series float): float Action price
when (series int): int Action bar time UNIX. Default: time
index (series int): int Action bar index. Default: bar_index
markPrice (series float): float Action mark price. Default: na
markWhen (series int): int Action mark bar time UNIX. Default: na
markIndex (series int): int Action mark bar index. Default: na
PosInfo
PosInfo - Position info object
Fields:
state (series PosState): <PosState> Position state. Default: na
price (series float): float Entry price. Default: na
when (series int): int Entry bar time UNIX. Default: time
index (series int): int Entry bar index. Default: bar_index
tp (array<PosAction>): PosAction[] Take profit info. Default: na
re (array<PosAction>): PosAction[] Re-entry info. Default: na
markPrice (series float): float Mark price. Default: na
markWhen (series int): int Mark bar time UNIX. Default: na
markIndex (series int): int Mark bar index. Default: na
版本注释
v10Added:
method reset(this)
resets PosInfo object exit
Namespace types: PosInfo
Parameters:
this (PosInfo)
method exit(this)
resets PosInfo object exit
Namespace types: PosInfo
Parameters:
this (PosInfo)
Pine脚本库
本着真正的TradingView精神,作者将此Pine代码发布为开源库,以便我们社区的其他Pine程序员可以重复使用它。向作者致敬!您可以私密或在其他开源出版物中使用此库,但在出版物中重复使用此代码受网站规则约束。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
Pine脚本库
本着真正的TradingView精神,作者将此Pine代码发布为开源库,以便我们社区的其他Pine程序员可以重复使用它。向作者致敬!您可以私密或在其他开源出版物中使用此库,但在出版物中重复使用此代码受网站规则约束。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。