I have two questions to the code of the standard NT Swing indicator.
1) In what situations will the code in the "else branch" be executed, that is when (saveCurrentBar == CurrentBar) ? Why does it exist? The only situation I have figured out is when you loop through the indicator on historical bars, but I still don't understand the reason for the code in this situation, since the historical output values are stored in DataSeries.
protected override void OnBarUpdate() { if (saveCurrentBar != CurrentBar) { /.../ saveCurrentBar = CurrentBar; } [COLOR=Red]else { /.../ }[/COLOR] }
public DataSeries SwingLow { get { [COLOR=Red] Update();[/COLOR] return swingLowSeries; } }
Comment