How is it possible to set a variable equal to the last swing high (price and # of bars back)?
I've tried:
Opening = Bars.BarsSinceSession;
HI_PERIOD = Swing(4).SwingHighBar(0, 1, Opening);
I've tried using a dataseries:
Opening = Bars.BarsSinceSession;
HI_PERIOD.Set(Swing(4).SwingHighBar(0, 1, Opening));
When I have variables then I can use them to reference other commands, such as Stochastics and Momentum...
double StochHI_K = Stochastics(14, 3, 3).K[HI_PERIOD];
double HI_MOM = Momentum(14)[HI_PERIOD];

Comment