Journal actions / fillData
Fill data actions
Fill data actions read values from the broker page using CSS selectors and populate the journal trade form.
Content shape
Use a flat JSON object. Each key is a form field (symbol, direction, entryPrice, favorableExcursion, adverseExcursion, and so on). Each value is either a CSS selector string or an object with selector and an optional map for enum translation.
Site pattern
The site field must match an extension enabled-site entry exactly (for example *.tradingview.com). The extension loads actions with GET /api/journal-actions?site= plus encodeURIComponent so * becomes %2A.
Field mappers
Text fields are trimmed. Numbers are parsed from cell text. direction, entryMethod, and exitMethod accept a map from raw page text to model enum values. profitLoss, favorableExcursion, and adverseExcursion map to optional close-form numbers. Timestamps map to openedAtLocal or closedAtLocal.
Examples
Reads entry price and side from the TradingView positions table, mapping buy/sell to long/short. Import this as a full journal action, or copy the content object into an existing fillData action.
{
"name": "Positions entry price and direction",
"site": "*.tradingview.com",
"location": "openPosition",
"action": "fillData",
"iconId": "text",
"content": {
"entryPrice": "[data-account-manager-page-id=\"positions\"] td[data-label=\"Avg Fill Price\"]",
"direction": {
"selector": "td[data-label=\"Side\"]",
"map": {
"buy": "long",
"sell": "short"
}
}
},
"enabled": true,
"sortOrder": 0
}Reads the symbol from a positions table cell using a plain CSS selector string. Import this as a full journal action, or copy the content object into an existing fillData action.
{
"name": "Positions symbol",
"site": "*.tradingview.com",
"location": "openPosition",
"action": "fillData",
"iconId": "text",
"content": {
"symbol": "[data-account-manager-page-id=\"positions\"] td[data-label=\"Symbol\"]"
},
"enabled": true,
"sortOrder": 0
}Reads the latest row from the bar-replay list-of-trades table and maps open/close cells into journal form fields. Import this as a full journal action, or copy the content object into an existing fillData action.
{
"name": "Replay open position",
"site": "*.tradingview.com",
"location": "openPosition",
"action": "fillData",
"iconId": "forward",
"content": {
"symbol": {
"selector": "div[class*=\"searchButton\"] button[title^=\"Symbol\"] span"
},
"timeframe": {
"selector": "div[data-is-fake-main-panel=\"true\"] div[role*=\"radiogroup\"] button[aria-checked=true] div[class^=value]"
},
"direction": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td[class*=\"tradeNumber\"] span:nth-child(2)",
"map": {
"long": "long",
"short": "short"
}
},
"positionSize": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td div[class*=\"positionSize\"] div:nth-child(1)"
},
"entryPrice": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(6) div[data-part=\"1\"] div[class*=\"value-\"]"
},
"entryMethod": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(5) div[data-part=\"1\"] div[class*=\"rowContent\"]",
"map": {
"Buy market order": "marketorder",
"Sell market order": "marketorder",
"Buy limit order": "limitorder",
"Sell limit order": "limitorder",
"Buy stop order": "stoporder",
"Sell stop order": "stoporder",
"Buy stop-limit order": "stoplimitorder",
"Sell stop-limit order": "stoplimitorder"
}
},
"entryTimestamp": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(4) div[data-part=\"1\"]"
}
},
"enabled": true,
"sortOrder": 0
}Reads the latest row from the bar-replay list-of-trades table and maps exit price, P/L, run-up (MFE), and drawdown (MAE) into the close-position journal form. Import this as a full journal action, or copy the content object into an existing fillData action.
{
"name": "Replay close position",
"site": "*.tradingview.com",
"location": "closePosition",
"action": "fillData",
"iconId": "forward",
"content": {
"exitPrice": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(6) div[data-part=\"0\"] div[class*=\"value-\"]"
},
"exitTimestamp": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(4) div[data-part=\"0\"]"
},
"exitMethod": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(5) div[data-part=\"0\"] div[class*=\"rowContent\"]",
"map": {
"Bracket Stop Loss": "stoploss",
"Bracket Take Profit": "takeprofit",
"Sell market order": "manual",
"Buy market order": "manual"
}
},
"profitLoss": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(8) div[class*=value]"
},
"favorableExcursion": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(10) div[class*=value]"
},
"adverseExcursion": {
"selector": "#bottom-area .replay_trading table.ka-table tbody tr[class*=\"ka-row\"] td:nth-child(11) div[class*=value]"
}
},
"enabled": true,
"sortOrder": 0
}