Hi,
I am seeing some weird results from formatPriceNumber.
It seems when you first open esignal, and an efs I've written is already on the chart, while the bars are being loaded, the formatPriceNumber function returns an invalid result when called. Only once the chart is loaded does this function do what it is supposed to do.
I'll post some short code to reproduce this problem when I have a sec, but wanted to see if anyone else is having this problem.
Here is the procedure I am using which causes this issue
I call a rounding routine which returns a valid result
I call formatPriceNumber to convert this value into a value that can be displayed in drawtextXXX.
When I first run esignal, and the above code in already on a chart, during the initialization, the call to formatPriceNumber results in a NULL value and a string size of 0.
If I perform a refresh on the chart, the function call works correctly and the value is converted to a proper value to be displayed in drawtextXXX.
I am speculating that the formatPriceNumber is relying on some internal variable to be set to a value that indicates how the output string should be handle--and when the program is first loaded and loading bars on the chart, this value is not initilized so formatPriceNumber is returning null.
Where this causes problems is if you call drawtextXXX with the string to be displayed on the chart as null--it will generate an error. No problem we just catch that null before it gets there, and say don't display. while this works, it forces the user to manually refresh to chart to get the results, causing someone to thing the script is not working.
Can one of the esignal guys comment on this function, and if this truely is the case? I am currently catching this issue and handling it accordingly, but it's causing my display of values to be different when esignal is first run than on subsequent calls to the efs, for example on the bonds chart it would normally be formatted 111'05, but not it's being formatted 111.0132 as I am not able to call formatPricenumber on the initial loading of esignal.
Thanks
Todd
I am seeing some weird results from formatPriceNumber.
It seems when you first open esignal, and an efs I've written is already on the chart, while the bars are being loaded, the formatPriceNumber function returns an invalid result when called. Only once the chart is loaded does this function do what it is supposed to do.
I'll post some short code to reproduce this problem when I have a sec, but wanted to see if anyone else is having this problem.
Here is the procedure I am using which causes this issue
I call a rounding routine which returns a valid result
I call formatPriceNumber to convert this value into a value that can be displayed in drawtextXXX.
When I first run esignal, and the above code in already on a chart, during the initialization, the call to formatPriceNumber results in a NULL value and a string size of 0.
If I perform a refresh on the chart, the function call works correctly and the value is converted to a proper value to be displayed in drawtextXXX.
I am speculating that the formatPriceNumber is relying on some internal variable to be set to a value that indicates how the output string should be handle--and when the program is first loaded and loading bars on the chart, this value is not initilized so formatPriceNumber is returning null.
Where this causes problems is if you call drawtextXXX with the string to be displayed on the chart as null--it will generate an error. No problem we just catch that null before it gets there, and say don't display. while this works, it forces the user to manually refresh to chart to get the results, causing someone to thing the script is not working.
Can one of the esignal guys comment on this function, and if this truely is the case? I am currently catching this issue and handling it accordingly, but it's causing my display of values to be different when esignal is first run than on subsequent calls to the efs, for example on the bonds chart it would normally be formatted 111'05, but not it's being formatted 111.0132 as I am not able to call formatPricenumber on the initial loading of esignal.
Thanks
Todd
Comment