When I use this line, I get an error:
tradesThisBar=new List<Traid>;
error:
A new expression requires (), [], or {} after type
How do I initialize it? I initialize it in the declaration but I need to reset it.
also, will this line work?:
if (tradesThisBar!=null){}
As the error has specified, add
()after your type:Regarding the 2nd snippet of code, the code you enter into the
{}will only be ran iftradesThisBaris notnull.In terms of whether it will “work” depends on what you wish for it to do. But it will compile.