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

Re: Anybody have example cycle code



PureBytes Links

Trading Reference Links

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));
Vars: DegShift (Iff(Bars2Shift<>0,360/Bars2Shift,0));


Plot1(CycleAmpl*Cosine(CurrentBar*DegPerBar+DegShift)+PlotPrice,"Wave");
Plot2(PlotPrice,"Zero");



----- Original Message ----- From: "Bob Fulks" <bfulks@xxxxxxxxxxxx>
To: "John Corrion" <corrion@xxxxxxxxxxx>; <omega-list@xxxxxxxxxx>
Sent: Tuesday, September 27, 2005 06:12 PM
Subject: Re: Anybody have example cycle code


At 06:47 PM 9/27/2005, John Corrion wrote:

Does anybody have example cycle code that they can share?  Just drawing a
Plot1(Sine(10*CurrentBar), "Sine";

Bob Fulks