I take the pre-built indicator Moving Average 1 line and put it in the chart. It obviously doesn’t repaint.
Code: Select all
inputs: Price( Close ), Length( 9 ), Displace( 0 ) ;
variables: var0( 0 ) ;
var0 = AverageFC( Price, Length ) ;
condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
begin
Plot1[Displace]( var0, "Avg" ) ;
if Displace <= 0 then
begin
condition1 = Price crosses over var0 ;
if condition1 then
Alert( "Price crossing over average" )
else
begin
condition1 = Price crosses under var0 ;
if condition1 then
Alert( "Price crossing under average" ) ;
end ;
end;
end ;
var0 = WAverage( Price, Length ) ;
in place of
var0 = AverageFC( Price, Length ) ;
Code: Select all
inputs: Price( Close ), Length( 9 ), Displace( 0 ) ;
variables: var0( 0 ) ;
var0 = WAverage( Price, Length ) ;
[code]condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
begin
Plot1[Displace]( var0, "Avg" ) ;
if Displace <= 0 then
begin
condition1 = Price crosses over var0 ;
if condition1 then
Alert( "Price crossing over average" )
else
begin
condition1 = Price crosses under var0 ;
if condition1 then
Alert( "Price crossing under average" ) ;
end ;
end;
end ;
var0 = AverageFC( Price, Length )
in my PersonalMa indicator so now the two indicators are identical. I inserted even the same period lenght. Result: My indicator repaints, the original not!! I don't know what is the problem.