Ultimate Oscillator

This script implements Larry William's Ultimate Oscillator.  Used by permission obtained from Larry Williams.

var
  ta7,ta14,ta28,osc:real;

procedure Ultimate;
var
  i,k: integer;
  Sum7,Sum14,Sum28: real;
begin
  if BarBegin<28 then begin    {initialize}
    SetUser(ePercent,True);
    SetUser(ePlot1,True);
    SetUser(eShow1,True);
    SetUser(eSpread,0);
    SetUser(eClose,False);
    k:=28;
  end
  else
    k:=BarBegin;

  for i:=BarBegin to BarEnd do SetUser(2,Last(i)-Bar(eTrueLow,i),i);

  for i:=k to BarEnd do begin
    Sum7:=Summation(2,i,7); ta7:=Summation(eTrueRange,i,7);
    Sum14:=Sum7+Summation(2,i-7,7); ta14:=ta7+Summation(eTrueRange,i-7,7);
    Sum28:=Sum14+Summation(2,i-14,14); ta28:=ta14+Summation(eTrueRange,i-14,14);
    Osc:=(Sum7/ta7)*4+(Sum14/ta14)*2+(Sum28/ta28);
    SetUser(1,Osc*10,i);
  end;
end;

{*********Main Program***********}
begin
  if ESPL=51 then Ultimate;
end;

You can cut a script from an e-mail using standard Windows cut and paste controls.   Click the left mouse button down at the top of the script and while holding down drag downward to include the entire script.   The text becomes highlighted.   Cut by pressing   Ctrl - C  keys.

Now in Ensign Windows, click on the Editor button.  Click the mouse in the left hand panel, and press Ctrl - V  to paste from the clipboard.   The script will appear.  To save the script, click on the menu Script | Save As and enter a file name, such as Ultimate.