Addcolumn show only values for certain symbols

I would like to see only in the Columns of certain symbols the Pos Size the other columns should be empty? Any idea?

sym1 = ParamStr("1st Symbol", "AAPL");
sym2 = ParamStr("2st Symbol", "ZM");
sym3 = ParamStr("3st Symbol", "JD");
sym4 = ParamStr("4st Symbol", "AMD");
sym5 = ParamStr("5st Symbol", "TSLA");

PozSize = 1000/ATR(5);
Filter =1;
AddTextColumn( FullName(), "Full name", 1, colorDefault, bk_color ); 
 
AddColumn( Close, "Close", 1.2 );
AddColumn( PosSize, "posSize", 77 , colorDefault, IIf(FullName()=! sym1,sym2,sym3,sym4,sym5,colorblack,IIf(FullName()== sym1,sym2,sym3,sym4,sym5, show my Poz Size????
//AddColumn(PosSize, "Pos", 1.2 );ype or paste code here

Above PozSize should be PosSize

sym1 = ParamStr("1st Symbol", "AAPL");
PosSize = 1000/ATR(5);
Filter = 1;
AddColumn( Close, "Close", 1.2 );
AddColumn(IIf(FullName() ==sym1,PosSize ,0),"PosSize",1.2); 

but this one is not working either - it should only write down in the AAPL cell the positionsize. If not zero or blank. Can someone help.

I got it. Not fullname instead name().

You should use Null if you want EMPTY cell.

sym1 = ParamStr( "1st Symbol", "AAPL" );
PosSize = 1000 / ATR( 5 );
Filter = 1;
AddColumn( Close, "Close", 1.2 );
AddColumn( IIf( Name() == sym1, PosSize , Null ), "PosSize", 1.2 );

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.