Easylanguage code help

intradaybill

Well-known member
Messages
358
Likes
14
Hello,

Just reading about EL, haven't tried it yet.

How would you write easlylanguage code for a simple system that enters at the close of today is it is higher than the open of today and exits at the close of tomorrow? Will something like this work?

if C[0] > O[0] then
Buy this Bar at close;
if marketposition= 1 then
sell next bar at close;

Thanks

Bill
 
This should work depending on syntax (which is different depending on version). For me it would be

If CloseD(0) > OpenD(0) then begin
Buy this bar at Close;
End;

If marketposition = 1 then begin
Exitlong ("Exit_Long") this bar at close;
End;


Paul
 
This should work depending on syntax (which is different depending on version). For me it would be

If CloseD(0) > OpenD(0) then begin
Buy this bar at Close;
End;

If marketposition = 1 then begin
Exitlong ("Exit_Long") this bar at close;
End;


Paul

Thanks Paul for being to kind to help. I wonder if I change the entry point to the open of tomorrow whether the following will work:

If CloseD(0) > OpenD(0) then begin
Buy next bar at Open;
End;

If marketposition = 1 then begin
Exitlong ("Exit_Long") this bar at close;
End;

Thanks

Bill
 
If all you are doing is going long on open and selling on close then remove lines

If marketposition = 1 then begin
End;

The Exitlong (TS2000) or Sell (TS8) command will only be triggered if you already have position. But if you check marketposition on daily bars it will only recognise position on next bar unless you have intrabarorder persist.

I suggest you check out the TS forums for this stuff.
 
If all you are doing is going long on open and selling on close then remove lines

If marketposition = 1 then begin
End;

The Exitlong (TS2000) or Sell (TS8) command will only be triggered if you already have position. But if you check marketposition on daily bars it will only recognise position on next bar unless you have intrabarorder persist.

I suggest you check out the TS forums for this stuff.

Thanks TWI, what you say makes sense. I will open an account with Tradestation and try the real thing. Easylanguage seems very intuitive and user friendly for people like me with no programming experience.

Bill
 
Top