Vivek Patel
Vivek Patel

Reputation: 43

Unable to understand the following line of code : use of dist = 1.5*ATR(10); and inside for loop it is used as an array

Here dist is a variable but inside the for loop its used as an array in afl programming

dist = 1.5*ATR(10);

for(i = 0;i < BarCount; i++ )
       {
        if( Buy[i] ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist[i], colorGreen );
        if( Sell[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorRed,
        colorYellow );
        }
   
    

Upvotes: 1

Views: 118

Answers (1)

tuan nguyen
tuan nguyen

Reputation: 386

ATR in amibroker to Calculates Average True Range indicator more about atr

ATR function return an array.

dist = 1.5*ATR(10);

this line of code will return an array with each element multiply by 1.5

Upvotes: 0

Related Questions