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

Re: EasyLanguage Code for absolute price



PureBytes Links

Trading Reference Links

At 1:47 PM -0800 1/3/02, Todd Hanson wrote:

>Could someone tell me the correct way to have easylanguage generate a
>buy or sell signal at a absolute price? I have tried with the code
>below but it does not generate the buy signal at the correct entry
>point. Thank you.
>
>Inputs: Price(0);
>If Currentbar > Price then buy this bar;

You cannot buy on "this bar" at a value. You basically have to prepare an order for the next bar.

And TradeStation has only two kinds of such orders "stop" and "limit". One buys when the price is the value or higher and one when the price is the value or lower.

So you need to use different orders depending upon whether the open of the next bar is above or below your buy point. This should work (not tested):

---

Inputs: Price(1140);

if Open of next bar < Price
   then Buy next bar at Price stop
   else Buy next bar at Price limit;

---

Bob Fulks