PureBytes Links
Trading Reference Links
|
Barry -
It looks like what you need is a counter which allows entry for
3 bars and then turns off, something like this:
var:count(-1),bstop(0),y(0);
if (test for x condition = true goes here) and count=-1 then begin
y= {calc y here};
bstop= H[1] + y;
count=0; {turn on bar counter}
end;
if count > -1 then count=count+1; {inc. counter only if it is turned on}
if count > 3 then count=-1 {turn off counter after 3 bars have passed}
if marketposition=1 then count=-1; {turn off counter if already long}
if count > 0 then buy at bstop stop; {allow entry for 3 bars}
I think that Phil's idea below will not not work if your x cond remains
true for several bars in a row, since it will recalc & move the stop
each day which is what you are trying to avoid.
regards,
rich
At 08:04 AM 7/27/00 -0700, Phil Lane wrote:
>try saving it in a variable
>
>if whatever then condition99=true
> else condtion99=false;
>if condition99 then value99 = h[1] + y
> else value99=999999999;
>
>buy 237 shares value 99 stop;
>
>good luck
>Phil
>
>----- Original Message -----
>From: bkmk <bkmk@xxxxxxxxxxxx>
>To: <omega-list@xxxxxxxxxx>
>Sent: Thursday, July 27, 2000 7:50 AM
>Subject: Problems with stops
>
>
>> I hop I can state this so my problem is understood.
>>
>> I trade stocks using a signal such as this:
>>
>> If x then buy at H[1] + y stop:
>>
>> y is a percentage of the stock price that I optimized on past data.
>>
>> The problem I'm having is this. If the conditions(x) are met but the
>> stop(y)isn't reached, the long position is not entered and a new stop is
>> recalculated based on that current bar which becomes H[1]. Sometimes I
>find
>> myself chasing a stock while its going up and the stop is never hit or its
>> hit after the stock has gone up several points. A smaller stop would
>> obviously help but it doesn't work in backtesting. Is there any way of
>> writing the system using a stop based on the first or second bar after the
>> buy signal is given? (Did I make myself clear?) Is this workable or is it
>> just wishful thinking?
>>
>> Thanks,
>>
>> Barry
>>
>>
>
>
|