[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plotting an indicator only on the last x bars of a chart?


  • To: omega List <omega-list@xxxxxxxxxx>
  • Subject: Re: plotting an indicator only on the last x bars of a chart?
  • From: Jim Johnson <jejohn@xxxxxxxxx>
  • Date: Fri, 2 Feb 2001 06:18:28 -0800

PureBytes Links

Trading Reference Links

Ooops--forgot to include the code of Phil Lane's indicator.

{SP Shorter #17--Phil Lane, patterntrader@xxxxxxxxxx, 7/28/2000, Omega List}
{set TS to exit trades on the close}

Inputs: Price(typicalprice);

Vars: FstBarNum(0),  BarsToday(0), PriceTotal(0), IntraDayAvg(0), OpenPrice(0), YestClose(0);

if date<>date[1] then begin
FstBarNum=barnumber;
PriceTotal = Price;
YestClose = Close[1];

if  OpenPrice < YestClose then condition99=true else condition99=false;  {down open}
 end

 else begin

{determine number of bars since open}

BarsToday=currentbar-FstBarNum;

 {average price since open}
PriceTotal=PriceTotal+Price;
IntraDayAvg=PriceTotal/(BarsToday+1);

Plot1(IntraDayAvg, "idAvg");

end;


  

-- 
Best regards,
 Jim Johnson                        mailto:jejohn@xxxxxxxxx