Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

cleon

Buy at Open with Easylanguage

Recommended Posts

Hello,

 

I am playing around with a simple gap strategy to learn basic EL and was wondering if it was possible to assess the gap condition, then buy or sell the market at open, when the opening price was a condition to be evaluated?

 

It looks like TS will only let me buy/sell the NEXT bar, which doesn't work on a daily chart when I am trying to look at a particular condition to buy/sell THAT bar at the open.

 

In layman's terms:

 

I look at yesterday's close relative to that day's range,

then I look at today's open relative to yesterday's close,

then I want to buy or sell today's open based on a condition.

 

Hope that makes sense. I basically want to 'buy/sell this bar at open' on a daily chart, and don't seem to have that option ?

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites

tradestation doesn't have a market on open or opening limit order type (opg), I don't believe.... although since you want to trade the gaps I'm guessing you mean after the open.

 

there is a 'buy this bar at close'

 

there is no 'buy this bar at market', only 'buy next bar at market'.

 

I believe this is just terminology that fits with the easylanguage 'bar' programming concepts. My understanding is if you place a buy this bar at close, it will get filled anywhere between the time you place it and the close.

 

if you are trading the first bar of the market, you might also need to set MaxBarsBack to zero.

Share this post


Link to post
Share on other sites

I found that the answer was to set the intrabarordergeneration flag to 'true'. On a daily chart, this would send the order for the 'next bar', on the first tick after the open, which is close enough.

 

Thanks!

Share this post


Link to post
Share on other sites

can play around with this:

 

"if ____ then buy next bar at open of tomorrow" or

"if ____ then buy next bar at open of tomorrow+2 stop" (buy stop 2 pts above OP)

"if ____ then buy next bar at open of tomorrow-4 limit" (buy 4 pts below OP limit order)

 

enjoy your weekend, d-bag.

 

frank

 

(btw, there are a bunch of EL coding tips like this in Art Collins book 'Beating the Financial Futures Market")

Share this post


Link to post
Share on other sites
can play around with this:

 

"if ____ then buy next bar at open of tomorrow" or

"if ____ then buy next bar at open of tomorrow+2 stop" (buy stop 2 pts above OP)

"if ____ then buy next bar at open of tomorrow-4 limit" (buy 4 pts below OP limit order)

 

enjoy your weekend, d-bag.

 

frank

 

(btw, there are a bunch of EL coding tips like this in Art Collins book 'Beating the Financial Futures Market")

 

 

From EL_FunctionsAndReservedWords_Ref.pdf

 

Tomorrow (Reserved Word)

Disclaimer

This word is retained for backward compatibility. Replaced by Next Bar.

Remarks

Tomorrow references the next bar, even when analyzing intraday bars.

Tomorrow is no longer necessary as the following are equivalent:

Buy at Open Tomorrow + Range Stop;

Buy at Open Next Bar + Range Stop;

Buy at Open[-1] + Range Stop;

 

 

 

That means that if you are working on an intraday basis tomorrow doesn't mean "tomorrow" but "next bar"

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.