Closed stefantabakovq closed 10 months ago
Have you tried reproducing this error?
@stefantabakovq thank you, I'll try today
Yes, I reproduced. Extension start with default parameter for deepbacktesting for me for some strategies. The problem there that the best start parameters that tested in standard mode before deep mode backtesting is different for deepmode. I'll think how to solve it. There two options exactly. First - for deep backtesting use only last best parameters. The second recheck best parameters in deepmode.
The only random method - is not reproduced for me. It's working for me in another methods too
It was already implemented, I forgot. The init stage contained an error, I fixed it. New version have sent to review to google webstore and will published after that. Thank you for this issue.
@akumidv It seems to have started happening again, :( It was working for about a month and now started getting random values for initial parameters.
@akumidv Any ideas? Basically, most of the time deep backtesting starts with 0 for the performance param I want to optimize for, or takes some random values for the params.. Like last time, I am guessing TV changed something in the UI again, but I don't see any errors
@akumidv Any ideas? Basically, most of the time deep backtesting starts with 0 for the performance param I want to optimize for, or takes some random values for the params.. Like last time, I am guessing TV changed something in the UI again, but I don't see any errors
Didn't reprodduce it yet. Can you attach the part of log in browser console - before backtesting iteration. That part where is checking best start condition (from current parameters, previous best found)?
www.tradingview.com-1696689433254.log
and a video of the error: https://we.tl/t-CwRvifaeFK
@akumidv Have you had the chance to look at this issue? I still can't get deep backtesting to run... The previous WeTransfer video expired; I'm uploading it again. https://we.tl/t-KapKyAmZA5
@akumidv I found a solution. TradingView has updated their UX so that the first iteration on clicking enable DeepBacktesting switch auto-generates the report; This then disables the generate report button and it does not allow it to get the correct data.
The way I've solved it for now is adding a global counter, of how many times we run tv.getPerformance
and if it is the first time, skip looking for the Generate Report button.
let getPerformanceCallCount = 0;
tv.getPerformance = async (testResults, isIgnoreError=false) => {
getPerformanceCallCount++; // Increment the counter
let reportData = {}
// let isProcessStart = await page.waitForSelector(SEL.strategyReportInProcess, 2500)
let isProcessStart = false
let isProcessEnd = false
let isProcessError = null
if (testResults.isDeepTest) {
isProcessEnd = await tv.generateDeepTestReport(testResults.dataLoadingTime * 2000, getPerformanceCallCount)
isProcessStart = isProcessEnd
isProcessError = !isProcessEnd
} else .......
and for generateDeepTestReport
:
tv.generateDeepTestReport = async (loadingTime = 60000, callCount) => {
const generateBtnEl = await page.waitForSelector(SEL.strategyDeepTestGenerateBtn)
if (generateBtnEl) {
if (callCount > 1){
page.mouseClick(generateBtnEl)
}
const reportHeader = await page.waitForSelector(SEL.strategyReportHeader, loadingTime)
..........
When running deep backtesting optimization, the first run "getting initial parameters" appears to get incorrect parameters, and sets the optimization parameter to a random value.
Any idea of the idea why that is? I think deep optimization is broken...
This is pre-optimization params of deep-backtesting
This is first run of deep-optimization
As you can see, when running the deep-opti, it seems to set random params at start....
@akumidv