Thebattlefront Posted October 16, 2022 Report Share Posted October 16, 2022 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. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted October 16, 2022 Report Share Posted October 16, 2022 there shouldn't be any glitches or anything else with advanced paintbars. The most likely issue is in the paintbar code itself. Please give specifics (sorry, "wonky results" not quite descriptive ) Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 16, 2022 Author Report Share Posted October 16, 2022 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. 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. Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 16, 2022 Author Report Share Posted October 16, 2022 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. Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 16, 2022 Author Report Share Posted October 16, 2022 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 Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted October 16, 2022 Report Share Posted October 16, 2022 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. Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 16, 2022 Author Report Share Posted October 16, 2022 Ok I sent it. The scan is called "Better MomCyc" that I'm referring to. Not the "Better MomCyc vCurr" one. That is like a copy of the other one but I think i pasted one of the older codes onto that scan so don't use that one at the moment. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted October 16, 2022 Report Share Posted October 16, 2022 got it. will check Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 16, 2022 Author Report Share Posted October 16, 2022 (edited) ok Edited October 16, 2022 by Thebattlefront Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted October 17, 2022 Report Share Posted October 17, 2022 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. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted October 17, 2022 Report Share Posted October 17, 2022 and one more note - MT now lets you do multiple results per scan, that can be shown in separate scan result columns, and you can give each column your own name Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 17, 2022 Author Report Share Posted October 17, 2022 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? Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 17, 2022 Author Report Share Posted October 17, 2022 Or actually, do you happen to have the version of medved trader from just before July 30, 2022? I just wanna check that version of MT to see if my old scans will work on that one as compared to the new MT to see if there is any difference there. Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 17, 2022 Author Report Share Posted October 17, 2022 I have this paintbar that doesnt work: It's my 5m MACD exit strategy and its really short. But the setscanresult on this one doesn't line up with the chart either. Maybe you can have a look: 5m MACD Exit.PBExport Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 17, 2022 Author Report Share Posted October 17, 2022 (edited) edit out Edited October 17, 2022 by Thebattlefront Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 17, 2022 Author Report Share Posted October 17, 2022 Nevermind i will try and debug my program and see if i can fix it. Maybe if i shorten it it will be easier for me to figure things out. Thank you guys for the help Quote Link to comment Share on other sites More sharing options...
Thebattlefront Posted October 17, 2022 Author Report Share Posted October 17, 2022 For anyone interested, i was accidentally using the intraday scan instead of the historical scan when i ran the scan on the portfolio window. So.... yeah make sure to check that first lol 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.