TradeStation 2000i example

EasyLanguage example:
If LastBarOnChart then begin
	
  If Close <> close[1] then begin
	Buy("Long") 1 contract Next bar Close limit;
	FileAppend("C:\TradeBullet\order" + numtostr(random(9999999),0) + ".tb", "PLACE,SIMULATOR,ES 09-06,GLOBEX,BUY,1,LIMIT,0," + numtostr(Close,2) + ",DAY,,Long,");
  End;

  If Marketposition = 1 and barssinceentry > 1 then begin
	ExitLong("Cover") all contracts Next bar at Open;
	FileAppend("C:\TradeBullet\order" + numtostr(random(9999999),0) + ".tb", "PLACE,SIMULATOR,ES 09-06,GLOBEX,BUY,1,MARKET,0,0,DAY,,Cover,");
	Sell("Short") 1 contract next bar Close limit;
	FileAppend("C:\TradeBullet\order" + numtostr(random(9999999),0) + ".tb", "PLACE,SIMULATOR,ES 09-06,GLOBEX,SELL,1,LIMIT,0," + numtostr(Close,2) + ",DAY,,Short,");
  End;

  If MarketPosition = -1 and barssinceentry > 1 then begin
	ExitShort("CoverLong") all contracts Next bar at Open;
	FileAppend("C:\TradeBullet\order" + numtostr(random(9999999),0) + ".tb", "CLOSE ALL,SIMULATOR");
	Buy("Long2") 1 contract Next bar Close limit;
	FileAppend("C:\TradeBullet\order" + numtostr(random(9999999),0) + ".tb", "PLACE,SIMULATOR,ES 09-06,GLOBEX,BUY,1,LIMIT,0," + numtostr(Close,2) + ",DAY,,Long2,");
  End;

End;