@@ -259,8 +259,8 @@ def _prepare_html(self):
259259 }}
260260 const pos = v.size > 0 ? 'Long' : 'Short';
261261 _html += `<tr><td>${{v.ref}}</td> <td>${{pos}}</td><td>${{v.tradeid}}</td>`
262- +`<td>${{v.dateopen}}</td><td>${{v.priceopen}}</td>`
263- +`<td>${{v.dateclose}}</td><td>${{v.priceclose}}</td>`
262+ +`<td class="dt0" >${{v.dateopen}}</td><td>${{v.priceopen}}</td>`
263+ +`<td class="dt1" >${{v.dateclose}}</td><td>${{v.priceclose}}</td>`
264264 +`<td>${{v.pnlcomm}}</td><td>${{v.return_pct}}</td><td>${{v.commission}}</td>`
265265 +`<td>${{v.barlen}}</td></tr>`;
266266 }}
@@ -274,7 +274,7 @@ def _prepare_html(self):
274274 state = 1;
275275 }}
276276 const pos = v.o_ordtype===0 ? 'Buy' : 'Sell';
277- _html += `<tr><td>${{v.o_ref}}</td><td>${{v.o_datetime}}</td><td>${{pos}}</td>`
277+ _html += `<tr><td>${{v.o_ref}}</td><td class="dt" >${{v.o_datetime}}</td><td>${{pos}}</td>`
278278 +`<td>${{v.o_price}}</td><td>${{v.o_size}}</td></tr>`;
279279 }}
280280 }}
@@ -314,6 +314,25 @@ def _prepare_html(self):
314314 }}
315315 }}
316316 document.querySelectorAll('#slist a')[0]?.click()
317+
318+ document.querySelector('#trades tbody').ondblclick = (e) => {{
319+ const n = e.target;
320+ const chart = { self .id } .chart;
321+ if (n.nodeName==='TD' && n.classList.contains('dt0')) {{
322+ const dt0 = n.innerText
323+ const dt1 = n.parentNode.querySelector('td.dt1')?.innerText
324+ scrollToTime(chart, dt0, dt1)
325+ }}
326+ else if (n.nodeName==='TD' && n.classList.contains('dt1')) {{
327+ const dt1 = n.innerText
328+ const dt0 = n.parentNode.querySelector('td.dt0')?.innerText
329+ scrollToTime(chart, dt0, dt1)
330+ }}
331+ else if (n.nodeName==='TD' && n.classList.contains('dt')) {{
332+ const dt0 = n.innerText
333+ scrollToTime(chart, dt0)
334+ }}
335+ }}
317336 \n </script></body></html>
318337 '''
319338 return html_code
0 commit comments