I have a code finding flat parts of an indicator, which then makes List with. My question is, for the best script performance, should I use the first code, or the second?
Thank you
// Variant 1
if (Math.Abs(DMI1[1] - DMI1[2]) < 0.0001)
{
FlatDMI.Add(DMI1[1]);
// Variant 2
if (!FlatInd && Math.Abs(DMI1[1] - DMI1[2]) < 0.0001)
{
flat = DMI1[1]
FlatDMI.Add(flat);

Comment