PINE LIBRARY
מעודכן LiveTracker by N&M

LiveTracker is a real-time trade execution and accounting engine built on top of statistically validated backtest states.
It mirrors live trading conditions with precise fee modeling, partial take-profits, trailing stops, and liquidation logic.
Each trade is tracked with both mark-to-market PnL and “net if closed now” metrics for full transparency.
Designed as a modular Pine Script® library, it enables reliable, state-driven live execution without repainting.
It mirrors live trading conditions with precise fee modeling, partial take-profits, trailing stops, and liquidation logic.
Each trade is tracked with both mark-to-market PnL and “net if closed now” metrics for full transparency.
Designed as a modular Pine Script® library, it enables reliable, state-driven live execution without repainting.
הערות שחרור
v2Mis à jour:
getCurrentState(currentBar, previousHash, backtestResult, config)
Parameters:
currentBar (BarSnapshot type from N_M_/historicalEngine/2)
previousHash (int)
backtestResult (BacktestResult type from N_M_/historicalEngine/2)
config (LiveConfig)
openTrade(currentBar, entryPrice, btConfig, liveConfig, currentState, currentCapital)
Parameters:
currentBar (BarSnapshot type from N_M_/historicalEngine/2)
entryPrice (float)
btConfig (BacktestConfig type from N_M_/historicalEngine/2)
liveConfig (LiveConfig)
currentState (LiveState)
currentCapital (float)
updateTrade(trade, currentPrice, currentHigh, currentLow, currentATR, btConfig, liveConfig, currentBarIndex, forceClose, forceCloseReason)
Parameters:
trade (LiveTrade)
currentPrice (float)
currentHigh (float)
currentLow (float)
currentATR (float)
btConfig (BacktestConfig type from N_M_/historicalEngine/2)
liveConfig (LiveConfig)
currentBarIndex (int)
forceClose (bool)
forceCloseReason (string)
updateSession(liveSession, currentBar, currentPrice, currentHigh, currentLow, backtestResult, btConfig, liveConfig)
Parameters:
liveSession (LiveSession)
currentBar (BarSnapshot type from N_M_/historicalEngine/2)
currentPrice (float)
currentHigh (float)
currentLow (float)
backtestResult (BacktestResult type from N_M_/historicalEngine/2)
btConfig (BacktestConfig type from N_M_/historicalEngine/2)
liveConfig (LiveConfig)
LiveState
Fields:
currentHash (series int)
stats (StatePerformance type from N_M_/historicalEngine/2)
hasStats (series bool)
isValid (series bool)
shouldEnter (series bool)
entryReason (series string)
confidence (series float)
tier (series string)
hasChanged (series bool)
previousHash (series int)
הערות שחרור
v3הערות שחרור
v4הערות שחרור
v5Ajouté:
showDebugTable(liveSession, totalStates, liveConfig)
Parameters:
liveSession (LiveSession)
totalStates (int)
liveConfig (LiveConfig)
Mis à jour:
openTrade(currentBar, entryPrice, btConfig, currentState, currentCapital)
Parameters:
currentBar (BarSnapshot type from N_M_/historicalEngine/2)
entryPrice (float)
btConfig (BacktestConfig type from N_M_/historicalEngine/2)
currentState (LiveState)
currentCapital (float)
הערות שחרור
v6הערות שחרור
v7הערות שחרור
v8ספריית Pine
ברוח האמיתית של TradingView, המחבר לפרסם את הקוד של Pine הזה כספרייה בקוד פתוח, כך שמתכנתים אחרים בקהילתנו יעשו שימוש חוזר. כל הכבוד למחבר! ניתן להשתמש בספרייה הזו באופן פרטי או בומים בקוד פתוח, אך השימוש בחוזר בקוד הזה בפרסומים כפוף ל-כללי הבית.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
ספריית Pine
ברוח האמיתית של TradingView, המחבר לפרסם את הקוד של Pine הזה כספרייה בקוד פתוח, כך שמתכנתים אחרים בקהילתנו יעשו שימוש חוזר. כל הכבוד למחבר! ניתן להשתמש בספרייה הזו באופן פרטי או בומים בקוד פתוח, אך השימוש בחוזר בקוד הזה בפרסומים כפוף ל-כללי הבית.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.