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提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。