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

Re: Code Help!



PureBytes Links

Trading Reference Links

Try this. (Untested)

------------------------------------------------------

Input: N(20), M(3);

Vars: Count(0);

Condition1 = ...;

if Condition1 then Count = Count + 1;

if Count - Count[N] > M then begin
   Buy next bar at Highest(High, N) stop;
   Sell next bar at Lowest(Low, N) stop;
end;

-----------------------------------------------------

Check to determine which of these you want for the if condition:

if Count - Count[N] > M then begin
if Count - Count[N-1] > M then begin

Bob Fulks

====================================================

At 11:36 PM 2/26/2005, ericzh2003 wrote:

>I'm coding a strategy and I need some help in coding:
>
>If within N bars, { ...} occurs more than M times, then
>buy stop Highest (High, N)
>Sell stop Lowest (Low, N)
>
>is there a built-in function similar to MRO?