I tried putting this bug in the bug tracker but when I click the button "Report an issue" it gives me this error "compact(): Undefined Variable: issue" at the top of the screen and it does not give me the screen for entering the information. I was going to simply point it at this thread since it has everything including how to recreate the problem.
The following code in one of my scripts is intermittently getting the wrong symbol's screen highest and lowest values.
Code: Select all
ScreenValHighest = GetAppInfo(aiHighestDispValue);
ScreenValLowest = GetAppInfo(aiLowestDispValue);
There are a bunch of variants on the A_Place1TrailUnitText2 function throughout the script but the key point is the file append.
Code: Select all
//START: code to position text on the screen properly
ScreenValHighest = GetAppInfo(aiHighestDispValue);
ScreenValLowest = GetAppInfo(aiLowestDispValue);
TrailUnitSpacing = (ScreenValHighest - ScreenValLowest) / SpacingDivisor; //Reducing the divisor from 26.66 to 26 increases the TrailUnitSpacing value.
//END: code to position text on the screen properly
LastSwingLowPriceID = A_Place1TrailUnitText2(1,Tdate,Ttime,Tool_Black,numtostr(LastSwingLowPriceDiffU,0),LastSwingLowPriceID,LastSwingLowPrice - TrailUnitSpacing);
if realsym = "NGD" and BarSizeType = "15M" then
FileAppend(LogPath,
" RealSym=" + RealSym +
" DoingCode=" +
DoingCode +
" 1A " +
" TrailUnitSpacing=" +
numtostr(TrailUnitSpacing,2) + " ScreenValHighest=" + numtostr(ScreenValHighest,2) + " ScreenValLowest=" + numtostr(ScreenValLowest,2) + " SpacingDivisor=" + numtostr(SpacingDivisor,2) +
NewLine);
It occurs when I use the scanner to change charts. It seems to correct itself after a few displays but sometimes it does not and the bars at the end where the last bar on chart will display the text too far out from the prices. The text is a display of the unit size of the swing. On occasion it actually puts the text right off the screen. If the text has been spaced an incorrect distance from the prices, to get the text the correct distance from the display I have to turn the study off then on again and it is fine. Doing this corrects it every single time without fail and this is probably because the scanner is not switching symbols at that time.RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do3 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do3 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.13 ScreenValHighest=46.74 ScreenValLowest=43.34 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do2 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
RealSym=NGD DoingCode=Do1 1A TrailUnitSpacing=0.02 ScreenValHighest=1.99 ScreenValLowest=1.41 SpacingDivisor=26.00
I can recreate this problem every day without fail. It has been happening a long time and I finally decided to dig in and see if I can fix it.
I probably don't need to mention this but the command to get the symbol is this one. It only executes once during currentbar=1;
RealSym = getsymbolname;
I just checked this if statement throughout the code. It is always the same. So ti should not be displaying prices from the prior symbol.
if realsym = "NGD" and BarSizeType = "15M" then
The bigger prices do match the symbol which I just previously selected on the scanner for chart displaying. So somehow those two statements are not picking up the current symbols screen values quick enough (or at all on occasion).
I have a fileappend statement at the currentbar=1 location so I can see each time I switch symbols. If I switch back and forth between the two symbols over and over and over again pretty much every single time there are at least 10 rows in the fileappend output that have the other symbols prices at the start. So the values are not getting updated for the NGD symbol quick enough. So the randomness in my seeing it on the screen occurs because on random occasions none of the NGD displays get the correct prices even out to the last bar on chart area.
John