Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 01-29-2009, 06:36 PM   #1

Join Date: Aug 2008
Location: Denver
Posts: 13
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Buy at Open with Easylanguage

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.
cleon is offline  
Reply With Quote
Old 01-30-2009, 12:31 AM   #2

Join Date: Dec 2008
Location: miami beach
Posts: 12
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Buy at Open with Easylanguage

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.
tradelink is offline  
Reply With Quote
Old 01-30-2009, 02:59 AM   #3

Join Date: Aug 2008
Location: Denver
Posts: 13
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Buy at Open with Easylanguage

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!
cleon is offline  
Reply With Quote
Old 01-31-2009, 04:33 PM   #4

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts

Re: Buy at Open with Easylanguage

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")
Frank is offline  
Reply With Quote
Old 02-01-2009, 03:58 AM   #5

Join Date: Aug 2008
Location: Denver
Posts: 13
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Buy at Open with Easylanguage

Oh cool...didn't know about that 'tomorrow' syntax. I assumed you couldn't look forward that way in the code. Thanks!
cleon is offline  
Reply With Quote
Old 03-02-2011, 11:16 AM   #6

Join Date: Jan 2010
Location: Valencia
Posts: 26
Ignore this user

Thanks: 0
Thanked 2 Times in 1 Post

Re: Buy at Open with Easylanguage

Quote:
Originally Posted by Frank »
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_FunctionsAndReservedWo rds_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"
skan is offline  
Reply With Quote
The Following 2 Users Say Thank You to skan For This Useful Post:
EasyTrader_I (03-03-2011), Tams (03-02-2011)

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help With Easylanguage Asap cramerwilliams Coding Forum 4 04-04-2011 09:43 PM
Regards As Candlesticks in Easylanguage pencil2 Coding Forum 3 08-22-2009 06:22 PM
Some EasyLanguage Help Please jjthetrader Coding Forum 8 06-02-2008 04:20 PM
Easylanguage and Script Help darknite999 Coding Forum 49 04-15-2008 07:37 AM
Labels in EasyLanguage keymoo Coding Forum 7 03-24-2007 02:37 PM

All times are GMT -4. The time now is 12:24 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.