I have been working on some code that uses drawtextabsolute.
I've run into a weird circumstance that I can't figure out.
I keep getting a parameter 3 of drawtextabsolute is invalid error when I first launch esignal and have this study on my charts. It appears to get this error when the bars are first loaded on the chart. If I add the efs to an existing chart, this does not happen.
it seems to have something to do with the formatPricenumber function.
I call this function to convert my number to a string for printing on the chart. This helps especially in bonds.
If I remove this function and just print the raw value, then I do not get the above error, but then I loose the functionality of formatpricenumber.
Can anyone help me figure this one out?
It seems that formatpricenumber might have a bug in it that returns a weird value during the first bar load on a new run of esignal? I tried to put a debugprintln in there to see what it was but it does not print it to the output window.
Any suggestions.
here's the line that is being printed.
drawTextAbsolute(2, stopplot, pround(stopplot), Color.black, z, Text.BOLD | Text.FRAME | Text.VCENTER | Text.ONTOP, null, 10, "Pivot");
the pround function is as follows:
function pround(price)
{var a,t;
a=roundit(price);
t=formatPriceNumber(a);
return t;
}
roundit is my own rounding routine to round to the nearest tick, it returns a correct number so it is not the issue.
thx
I've run into a weird circumstance that I can't figure out.
I keep getting a parameter 3 of drawtextabsolute is invalid error when I first launch esignal and have this study on my charts. It appears to get this error when the bars are first loaded on the chart. If I add the efs to an existing chart, this does not happen.
it seems to have something to do with the formatPricenumber function.
I call this function to convert my number to a string for printing on the chart. This helps especially in bonds.
If I remove this function and just print the raw value, then I do not get the above error, but then I loose the functionality of formatpricenumber.
Can anyone help me figure this one out?
It seems that formatpricenumber might have a bug in it that returns a weird value during the first bar load on a new run of esignal? I tried to put a debugprintln in there to see what it was but it does not print it to the output window.
Any suggestions.
here's the line that is being printed.
drawTextAbsolute(2, stopplot, pround(stopplot), Color.black, z, Text.BOLD | Text.FRAME | Text.VCENTER | Text.ONTOP, null, 10, "Pivot");
the pround function is as follows:
function pround(price)
{var a,t;
a=roundit(price);
t=formatPriceNumber(a);
return t;
}
roundit is my own rounding routine to round to the nearest tick, it returns a correct number so it is not the issue.
thx
Comment