Jump to content
Medved Trader Forums

SetScanResult is producing unexpected results in the setscanresult column as of a couple patches ago.


Recommended Posts

Hello,

Has anyone else noticed glitched results when they run their scan using advanced paintbar? It would seem even older versions of the code I run are producing very wonky results as of a few weeks ago. I didn't post about it back then because I wasn't sure if it would be fixed in the next patch but it would appear the problem is persisting. I think it's related to the currentstate variables or something along those lines.

Just wanted to know if anyone else has been having this problem recently.

Link to comment
Share on other sites

Yea sorry for the wonky part, I wasn't very descriptive in my post because I just wanted to see if anyone else noticed anything out of the ordinary. Here's a screenshot of the results I'm getting currently to explain what I mean:

These values for %/b used to be above 1 for every result. But after a certain patch I started getting a bunch of zeroes ( as you can see in the screenshot). In order to double-check this, I ran an older code that I know had previously worked and gave positive values for the %/b column, but that code also produces a bunch of zeroes and strange values for the number of trades per stock (the #T column). So this is why I brought it up, it would appear something maybe changed in the advance paintbar scanner in some way but I'm not exactly sure what it could have been. I have no idea if its actually related to the currentstate variables.

f1988e7c9527b5f2d15aacf0eeab83b0.png

Or maybe it somehow is my code going wrong but, it sort of seems unlikely since the older codes that did work for me no longer produce the results I was expecting either? If you want i can send you my code and you can take a look and i can show you the parts where the setscanresult calculates these values.

Link to comment
Share on other sites

I keep all my older scans in a folder just in case i need to revert back to a previous version. But as i said, it would appear none of those older codes work anymore. Here's an example of a previous code I made that I marked as being "greatly improved winrate" but it now shows as having a bunch of zeros in the left most column - meaning there's no profit to be had on any trade i make on those stocks when its still the same set of stocks I'm running the scans on - something that shouldnt be occurring.

9a884166c332c35b445a21d30fef9869.png

Link to comment
Share on other sites

That previous code i posted was saved on July 30, 2022. So i think the change must have been in between that time and today (October 16, 2022). Although I think it's more maybe like a month or two ago. So possible around August or September. Again maybe my code is no longer valid with the current way things are done in advanced paintbar

Link to comment
Share on other sites

there was no breaking changes done.  Would need to know what the computation is that you are using to come up with the #s.  Yes, please send the settings and name of the scan and we can check it out and go from there. 

Go to FILE / HELP => Send Log/Settings to support menu (from Dashboard or Portfolio)

And add this Post’s URL in the comment. 

Link to comment
Share on other sites

Ok first - that's a huge paintbar.

Second - yes, it is pretty hard to figure out what/why is happening... We do have a method for debugging - you would use the LogString() function which would output a string to the debug stream. See https://www.medvedtrader.com/trader/WebHelp/debugging_paintbars_scans.htm

Third - I do have to note that you seem to be accumulating sums and their averages but they seem to be over the WHOLE data space. Is that what you really want? Usually the averages (or highest highs or lowest lows) are done over some period. MT has a perfect class to do that - it is StateFIFOQueue.  It is set for a particular period and keeps track of sums, averages, stdevs, highest highs etc for you.

Link to comment
Share on other sites

Yea the paintbar is huge, apologies for that. Most of it is just data storing for the different candlestick data  (at the end of the paintbar) so it's larger than it actually is i think. Maybe like 3000-4000 lines of actual coding but yeah It's still kinda confusing. Maybe I can make an example paintbar that is shorter that you can look at that has the same issue with setscanresult.

As for the calculation of the %/b and the total winrate of the paintbar over the period, yeah it takes the average sum over the total range. I'm not too familiar with StateFIFOQueue and how it works, although I do remember you telling me to use that to get the highest high and lowest low for the yearly range a few months back and I just copy pasted what you gave me and it seemed to work just fine so I'm continuing to use that.

I think I have another paintbar that has issues with the setscanresult and its much, much shorter. Just a few hundred lines of code. Maybe I can send that one instead for you to see?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...