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

Re: basic el question



PureBytes Links

Trading Reference Links

vars:sv(0);

If (close of data1) > highest(high of data1,15)[1]
and sv<>-1 then begin
  sell on close;sv = -1;
end;
If (close of data1) < lowest(low of data1,15)[1]
and sv<>1 then begin
  buy on close;sv = 1;
end;



Sethw2@xxxxxxx wrote:

> I am using ts4.0 and trying to write a simple model that does not do 2 buys or 2 sells in a row. The basic model is as follows:
>
> If (close of data1) > highest(high of data1,15)[1] then sell on close;
> If (close of data1) < lowest(low of data1,15)[1] then buy on close;
>
> I wish to adapt this system to use the built in stops in ts4.0, but if a trade is stopped out, I don't want to enter another trade in the same direction until a trade in the opposite direction has been executed. I want to trade long, short, long, short etc...
>
> Thanks,
>
> Seth