Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
How to enter long buy on a bar immediately before it closes.
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
Can you help answer these questions from other members on NexusFi?
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.
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.
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.
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
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.