How to enter long buy on a bar immediately before it closes. - EasyLanguage Programming | futures io social day trading
futures io futures trading


How to enter long buy on a bar immediately before it closes.
Updated: Views / Replies:2,743 / 19
Created: by bmtfken Attachments:3

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 3  
 
Thread Tools Search this Thread
 

How to enter long buy on a bar immediately before it closes.

  #1 (permalink)
Trading Apprentice
boca ration,fl/usa
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: options
 
Posts: 6 since Jul 2014
Thanks: 6 given, 0 received

How to enter long buy on a bar immediately before it closes.

Hi all, requesting help in EasyLanguage:

I've looked all over google and the
forums and no one can answer this.
And turning on intrabarordergeneration
does NOT help, it only buys at the end
of the current bar (missing the move)

See attached pic,
I want to buy a CURRENT bar as soon as
it crosses the previous bars range high,
immediately.
EDIT: That is to say that on a Daily chart, when the current bar crosses the last daily bar high, that I need a long entry immediately.

NOT at the close of the current bar.
NOT at the open of the next bar.

Easylanguage code seems so powerful that
it is hard to believe that E.L. can't do this.

If "(a current value)" > range[1] then
buy this bar at market; does NOT work.

Is that possible using separate conditions1 ,2 etc. using a Daily bar as the trigger and then a 1 tick bar for a long entry?
??

Ken

Attached Thumbnails
How to enter long buy on a bar immediately before it closes.-strat.jpg  
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,139 given, 4,387 received
Forum Reputation: Legendary


In your picture, on the red bar shown, you'd have the code:

buy next bar at high stop;



That will send an order, good for the entire next bar (the green bar where you want to enter).

So, your logic has to be setup so you know at the close of the red bar, what your plan is for the next (green) bar.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
The following 2 users say Thank You to kevinkdog for this post:
 
  #4 (permalink)
Elite Member
Texas, USA
 
Futures Experience: Intermediate
Platform: X_TRADER Pro, Custom
Broker/Data: NxCore
Favorite Futures: Futures, Spreads
 
Hulk's Avatar
 
Posts: 215 since May 2014
Thanks: 509 given, 474 received


bmtfken View Post
Hi all, requesting help in EasyLanguage:

I've looked all over google and the
forums and no one can answer this.
And turning on intrabarordergeneration
does NOT help, it only buys at the end
of the current bar (missing the move)

See attached pic,
I want to buy a CURRENT bar as soon as
it crosses the previous bars range high,
immediately.
EDIT: That is to say that on a Daily chart, when the current bar crosses the last daily bar high, that I need a long entry immediately.

NOT at the close of the current bar.
NOT at the open of the next bar.

Easylanguage code seems so powerful that
it is hard to believe that E.L. can't do this.

If "(a current value)" > range[1] then
buy this bar at market; does NOT work.

Is that possible using separate conditions1 ,2 etc. using a Daily bar as the trigger and then a 1 tick bar for a long entry?
??

Ken

Basically, what Kevin said. You need to do 2 things:

1. Use IntraBarOrderGeneration=True in your code.
2. You need a stop order to be placed when the current bar closes.

So, lets assume the current bar range high is 1960 and you want to buy 1 tick above this high on the next bar (assuming 1 tick=0.25), you need to place a buy stop order at 1960.25 using this kind of syntax when the current bar closes.

 
Code
Buy next bar at 1960.25 stop;
By doing so, as soon as the current bar closes, you will see a buy stop market order is placed at 1 tick above the high and if the next bar gets to this high, it should get filled.

Reply With Quote
The following user says Thank You to Hulk for this post:
 
  #5 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,139 given, 4,387 received
Forum Reputation: Legendary


Hulk View Post
Basically, what Kevin said. You need to do 2 things:

1. Use IntraBarOrderGeneration=True in your code.
2. You need a stop order to be placed when the current bar closes.

So, lets assume the current bar range high is 1960 and you want to buy 1 tick above this high on the next bar (assuming 1 tick=0.25), you need to place a buy stop order at 1960.25 using this kind of syntax when the current bar closes.

 
Code
Buy next bar at 1960.25 stop;
By doing so, as soon as the current bar closes, you will see a buy stop market order is placed at 1 tick above the high and if the next bar gets to this high, it should get filled.


You don't need IntraBarOrderGeneration=True. I always keep it to False.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
 
  #6 (permalink)
Elite Member
Texas, USA
 
Futures Experience: Intermediate
Platform: X_TRADER Pro, Custom
Broker/Data: NxCore
Favorite Futures: Futures, Spreads
 
Hulk's Avatar
 
Posts: 215 since May 2014
Thanks: 509 given, 474 received


kevinkdog View Post
You don't need IntraBarOrderGeneration=True. I always keep it to False.

Thats true. Orders always generated at the close of the bar in this case so this isnt required.

Reply With Quote
 
  #7 (permalink)
Market Wizard
Cleveland Ohio/United States
 
Futures Experience: Advanced
Platform: Tradestation
Broker/Data: various
Favorite Futures: futures
 
Posts: 2,388 since Jul 2012
Thanks: 1,139 given, 4,387 received
Forum Reputation: Legendary


Hulk View Post
Thats true. Orders always generated at the close of the bar in this case so this isnt required.

If he wanted to use IBOG, I think he could do this on the green bar (please correct me if I am wrong):

INTRABARORDERGENERATION=TRUE;
If close>high[1] then buy this bar at market; //you might have to use "high" instead of "close"


But, you cannot backtest with this setup, where you can with the other approach.

If you have any questions please send me a Private Message or use the futures.io "Ask Me Anything" thread
Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
  #8 (permalink)
Elite Member
Texas, USA
 
Futures Experience: Intermediate
Platform: X_TRADER Pro, Custom
Broker/Data: NxCore
Favorite Futures: Futures, Spreads
 
Hulk's Avatar
 
Posts: 215 since May 2014
Thanks: 509 given, 474 received


kevinkdog View Post
If he wanted to use IBOG, I think he could do this on the green bar (please correct me if I am wrong):

INTRABARORDERGENERATION=TRUE;
If close>high[1] then buy this bar at market; //you might have to use "high" instead of "close"


But, you cannot backtest with this setup, where you can with the other approach.

You are right Kevin. IBOG isnt required in this case. The information required to make the trade decision is available at the close of the current bar so the next (in-progress) bar really doesnt need to decide anything.

I had written a strategy sometime back that was based on a range (momentum) bar chart and would fade the close of the current bar when certain conditions are met and I think I was getting confused because of that.

Reply With Quote
 
  #9 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

It's fine to use "close" in your example as in realtime with IOG this will be the last tick that came in (i.e. on the tick that prints the high the close should have the same value).

Regards,
ABCTG


kevinkdog View Post
If he wanted to use IBOG, I think he could do this on the green bar (please correct me if I am wrong):

INTRABARORDERGENERATION=TRUE;
If close>high[1] then buy this bar at market; //you might have to use "high" instead of "close"


But, you cannot backtest with this setup, where you can with the other approach.


Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #10 (permalink)
Trading Apprentice
boca ration,fl/usa
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: options
 
Posts: 6 since Jul 2014
Thanks: 6 given, 0 received

Thanks


Thanks all, I will review my code and post back.

Reply With Quote

Reply



futures io > > > > > How to enter long buy on a bar immediately before it closes.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
buy next bar... and set stop immediately and not for the bar after Nicolas11 EasyLanguage Programming 12 September 18th, 2017 05:43 AM
Interactive Broker---sell a stock and immediately buy another in cash account muscleman Reviews of Brokers and Data Feeds 4 September 28th, 2013 01:19 PM
automated buy order on specific size bar close ncsutrader Elite Automated NinjaTrader Trading 3 May 27th, 2013 11:24 AM
Outside Bar buy or sell ness1g NinjaTrader 7 March 7th, 2012 07:18 PM
Enter to win: Autographed copies of Al Brook's Reading Price Charts Bar by Bar Book Big Mike Feedback and Announcements 51 June 29th, 2010 04:42 PM


All times are GMT -4. The time now is 10:09 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-17 in 0.20 seconds with 20 queries on phoenix via your IP 107.20.115.174