Hi, I'm trying to figure out how to plot a frequency spectrum in bars. While reading TFH Build Better Strategies Part 3 and trying to follow along I got stuck real quick, on step #2 he plots a frequency spectrum of cycle amplitude vs cycle length in bars. I've tried doing something like this to replicate the result:

Code
function run()
{
  vars Price = series(price());
  var Phase = DominantPhase(Price,10);
  vars Dominant = series(rDominantPeriod);
  
  plotBar("Spectrum",Amplitude(Dominant, rDominantPeriod),Amplitude(Dominant, rDominantPeriod),rDominantPeriod,BARS|AVG,RED);
}

to no success. I just get " Error 047: No bars to plot" Any help would be much appreciated. Thanks in advance.