Forums ProRealTime English forum ProOrder support Why Does Removing ONE Line of Unused Space Cause Profits to Reappear? Reply To: Why Does Removing ONE Line of Unused Space Cause Profits to Reappear?

#131197

I can’t imagine that without the use of magic that a sentence of code that effects strategy performance can be in the code but you can’t see it and the code checker can’t see it either

And yet it did in the case I’ve described above — I actually tapped on the blue do/undo buttons using “backtest” strategy after each tap, to add and remove that unused blank line and did that many times because I could not believe what I was seeing after hours of investigation, and looking at the code in the ML machine learning version (on the left in my screenshots). Profits, no profits, profits, no profits…

…and something very similar occurred here a few weeks back but this time text-compare .com spotted the subtle difference of space between lines that caused a big difference in profits in otherwise identical code in two systems: https://www.prorealcode.com/topic/machine-learning-in-proorder/page/9/#post-126323

What happened here was that I had two different profits for the same “identical” systems £21k v’s £63k.

That code that created £21k in profits, I knew this was too low from previous tests, so I cleaned up the text compare blue highlighted code to make it look like the code on the right hand side of the image (which had produced £63k). Text compare found  — on the left hand side of the second white image — a messy amount of spacing between sections of code, lots of “////////” above the “Elsif HeuristicsAlgo2” line of code. I removed the “/////////” and the two codes looked “identical” in PRT but somehow one still produced £63k (the juanj version, blue equity curve and top code in first screenshot) and the other £21k (juanj version but without his name on the system).

Referring to the left hand code again in the second (white) image: I investigated further. If you look at the left hand side of that white code image screenshot you can also see two separate “one space” indents above and below the “Elsif HeuristicsAlgo2” and also highlighted in blue.  That difference is not evident when comparing the codes in the two versions of PRT. PRT doesn’t red flag these indent differences. The spacing (highlighted by text compare in blue) was what was causing the difference in profits because once I removed the two blue spacings/indents above and below the “Elsif HeuristicsAlgo2” the two codes then became perfectly identical and only then did the profits of the two identical systems match, both at £63k.

Question: Can you see the fact that there is a one space bar indent above and below the line “Elsif HeuristicsAlgo2” in the first image of the system in the lower bottom right that produces the wobbly equity chart in the top of the image? I can’t and if it wasn’t for GraHal’s suggestion to use text compare I’d never have figured it out. In fact I went on to add a few more months to the backtest of the non juanj named system (brown equity curve) and it surpassed the £63k profit to make £84k but this was before we realised the true spread on coffee was something astronomical like 60 ticks… (pls see image below).

Something, in terms of characters and spacing, is most definitely causing an issue with PRT’s results. I also don’t feel its unreasonable for a user to copy text from one app into PRT I just didn’t know I need x-ray vision to determine any differences!