I need help regarding the text_float function.
Please see attached image.
The text_float function uses the set_textstyle horizontal and vertical parameters centered on the last bar, which, as seen on the chart, lay half the text on top of previous bars.
My idea is to plot the text to the right of the last bar. I thought creating a second function, changing the text_setstyle parameters, but for some reason I'm receiving an error when trying to compile it - assignment is allowed only for variables or array elements which is a strange error when I copy/paste the code. The only change made was the horizontal parameter from 2 to 0.
What am I doing wrong?
Code: Select all
inputs:
TextID( numericsimple ),
TextBarsBack( numericsimple ),
TextPriceValuePercent( numericsimple ) ;
variables:
var0( false ),
var1( 0 ),
var2( 0 ),
var3( 0 ) ;
if LastBarOnChart then
begin
var0 = Text_Exist( TextID ) ;
if var0 then
begin
var1 = GetAppInfo( aiHighestDispValue ) ;
var2 = GetAppInfo( aiLowestDispValue ) ;
var3 = var2 + 0.01 * TextPriceValuePercent *
( var1 - var2 ) ;
Text_SetLocation( TextID, Date[TextBarsBack], Time[TextBarsBack],
var3 ) ;
Text_SetStyle( TextID, 0, 2 ) ;
end
else
RaiseRunTimeError( "TextID does not exist." ) ;
end ;
Text_Float = 1 ;