PureBytes Links
Trading Reference Links
|
The requirement is not totally clear but maybe something like this is what you need.
Ave = <some moving average>;
if Ave > Highest(Ave, Length)[1] then Trend = +1;
if Ave < Lowest (Ave, Length)[1] then Trend = -1;
if <some condition> and Trend > 0 then Buy;
if <other condition> and Trend < 0 then Sell;
Bob Fulks
At 1:48 PM -0500 11/15/00, Tom wrote:
>I am trying to write a signal whereby:
>
>I want to trade with the trend which I define as UP when the High has
>penetrated the upperenvelope of a moving average envelopw and remains UP
>until the lower envelope is penetrated, even if the price is trading between
>the upper and lower. The trend is DOWN when the lower envelope has been
>penetrated by the low and stays down until the upper envelope is penetrated
>by the high. These are my conditions 1 & 2.
>
>I then have a trigger condition nested under each condition for my long and
>short positions so that only long positions can be signaled in the UP trend
>and short in the down.
>
>My problem is that the trigger will not activate if the price is between the
>two envelopes.
>
>How can I set a switch when each penetration takes place so that the trades
>take place as I want them to?
>
>Thanks for your help.
|