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

Re: Anybody have example cycle code



PureBytes Links

Trading Reference Links

See changes below.

----- Original Message ----- From: "Clyde Lee(clc)" <clydelee@xxxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Thursday, September 29, 2005 10:11 PM
Subject: Re: Anybody have example cycle code


Bob's solution certainly does the job. However, if you want a bit more control
over the amplitude and period of the wave you are plotting and the location
within subparagraph1 where it appears, try this:

{ Indicator: Cosine_Wave
Purpose: Plot a cosine wave in subparagraph1 around a given
price line using a specified period and time shift.
Author: Clyde Lee, Copyright SYTECH Corporation, 2005

Permission: With credit may be copied/modified.
}

Input: BarsNPeriod(121), {Number of bars in selected period }
Bars2Shift(0), {Number of bars to shift the cycle }
CycleAmpl(20), {Amplitude of selected cycle }
PlotPrice(1200); {Selected line for plotting }

Vars: DegPerBar(Iff(BarsNPeriod<>0,360/BarsNPeriod,360/51));


Plot1(CycleAmpl*Cosine((CurrentBar+Bars2Shift)*DegPerBar)+PlotPrice,"Wave");
  {changes in above line are all that is necessary}
Plot2(PlotPrice,"Zero");