Overhead supply basic measurement

Hello guys,

I have searched the forum quite intensively but can't find what I need.

I want to create a very basic indicator of existing overhead supply that I would compute like this:

  • Take the "latest Close"
  • Count how many days in the last X months the price closed above the "latest close"

I would think it could be done with Cum or Sum like in the remark on this page https://www.amibroker.com/guide/afl/sum.html but I don't see how I can "fix / make permanent" the value of the "latest close" in the evaluation below:

IsOverhead = C > "latest close / fixed value when the exploration is run";
OverheadDayCount = Sum(IsOverhead,120);

It's probably dead simple but I can't find the solution.

Thanks for the help,

Jez, it was simple but somehow hard to find:

// Overhead supply
IsOverhead = C > LastValue(C,false);
OverheadDayCount = Sum(IsOverhead,120);

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