PureBytes Links
Trading Reference Links
|
At 9:39 AM -0400 5/17/99, Lincoln Fiske wrote:
>I'm having trouble coding a reversal for a system which trades intraday
>data and uses a multidata stream of 5 minute bars over 60 minute. Once in
>a position, I want to reverse at the opposite extreme of the 60min bar
>preceding entry (this is a static stop through the day). So if I'm long, I
>want to reverse and go short only at the low of the 60min bar preceding
>entry. I know I can use at$ to stop out at that point, but I haven't
>figured how to reverse. I've tried using "if marketposition crosses above
>.5 then sellreverse=low of data2; sell at sellreverse stop," but this
>doesn't work. Does anyone have a suggestion?
It sounds as if you are entering only as the result of something occurring
on both the 5 min and 60 min bars but only at the time of the 60 min bars.
So if you are long you want to reverse to short at the low of the 60min bar
of data2 that signaled the entry.
Something like the attached might work. This gets the initial reversal. You
need to decide what happens then.
Bob Fulks
-------
Vars: BothBars(FALSE), MP(0), High2(High of data2), Low2(Low of data2);
BothBars = Time of data1 = Time of data2;
MP = MarketPosition;
if BothBars then begin
High2 = High of data2;
Low2 = Low of data2;
{Entrys}
if <something> then Buy next bar at ...
if <something> then Sell next bar at ...
end;
{Reversals}
if MP = +1 then Sell next bar at Low2 stop;
if MP = -1 then Buy next bar at High2 stop;
|