QuantConnect LEAN signal count in backtesting #148002
Unanswered
Suandrip
asked this question in
Programming Help
Replies: 1 comment 1 reply
-
Hi @Suandrip const el = document.querySelector("div.user-panel:not(.main) input[name='login']"); so const customSelect = document.querySelector('.custom-select');
if (customSelect) { // Check if the element exists
const selectTrigger = customSelect.querySelector('.custom-select__trigger');
const selectDropdown = customSelect.querySelector('.custom-select__dropdown');
const selectOptions = selectDropdown.querySelectorAll('.custom-select__option');
const actualSelect = customSelect.querySelector('select');
if (selectTrigger && selectDropdown && actualSelect) { // Check if all necessary elements exist
selectTrigger.addEventListener('click', () => {
customSelect.classList.toggle('open');
});
selectDropdown.addEventListener('click', (event) => { // Event delegation
if (event.target.classList.contains('custom-select__option')) {
selectTrigger.textContent = event.target.textContent;
actualSelect.value = event.target.dataset.value;
customSelect.classList.remove('open');
}
});
// Basic keyboard navigation (needs more refinement for full accessibility)
selectTrigger.addEventListener('keydown', (event) => {
if (event.key === "ArrowDown") {
selectDropdown.focus(); // Focus on the dropdown
customSelect.classList.add('open');
}
});
selectDropdown.addEventListener('keydown', (event) => {
if (event.key === "Escape") {
customSelect.classList.remove('open');
selectTrigger.focus(); // Return focus to the trigger
}
});
} else {
console.error("Missing required elements within custom-select.");
}
} else {
console.error("Custom select element not found.");
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Hello everyone. I am new to QuantConnect. I have a trading strategy which I want to implement in the LEAN platform. But before I run simulations for my strategy, I wish to know the number of events my signal will generate an alert.
Description:
I have a specific execution criterion. If open price=close price for any instrument on a daily timeframe, my strategy executes orders on the next candle (next day/session). Whether it places buy or sell, that is totally different logic, and I am not interested in that. My problem is, I want LEAN backtesting program to identify the specific candles on which open price=close price, maybe visualize it on a chart by arrows or labels (not mandatory) and then compile those events into a spreadsheet (instrument name, date/time of the signal, price). I am looking for more of a screener, identifying those candles which meet my requirements.
I have tried to implement this into LEAN:
Now, I can identify those candles as the event time is available in the backtesting report. But I want to visualize it on the chart, and if not possible (multiple signals), I want to print the generated signals into a text file. But the core issue is, how do you run this screener (indicator, whatever) on 1500 instruments at the same time? Manually, it's tedious. The parameter optimization feature only allows to configure the parameters in the algorithm and run it on a single instrument. Correct me if I'm wrong. My objective= same parameters, multiple instruments, bulk historical data (20 years). Please share insights on this.
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions