What it would do is create a high and a low horizontal trendline for the next hour... and it would keep doing that moving forward
so each prior rounder prior hour would have a high and a low price, and then it would create a trend line for the next hour's worth of bars so u can see if it is breaking the high or the low of the prior hour.. That way I would have the power of using hour bars to determine entry prices and i can use 1 minute bars to determine exit strategy.
1. The 1-min workaround is another story. I think that we first need to solve what happens with the 1-hour bar.
2. "I cant decipher the time". I do not understand. Could you show me an example of what is printed?
On my side, it is rather clear:
3. "Is it possible to put the # of shares held Below the bar itself?"
EDIT: This works for MultiCharts. I do not know for TradeStation.
4. "I need the " BarStatus(1) = 2" because I want to enter on the next bar on the break of the prior bar high..."
I am lost.
In the first message, I have the feeling that you wanted exactly the contrary: enter within a bar.
If you want to enter right at the opening of the next bar when a condition is met, you shall not use [intrabarordergeneration = true]
Last edited by Nicolas11; August 19th, 2012 at 02:14 PM.
Reason: addition (visible)
If I have correctly understood what you are trying to do, this is not straight-forward.
I have myself struggled with it for a long time.
So thanks for your question, since it allows me clarifying things in my mind.
But the negative side is... I may be wrong!
You want the exits (stop-loss or profit target) to possibly occur on the same bar as the entry.
I think this requires [intrabarordergeneration = true].
But [IntrabarOrderGeneration = true] has a negative side effect: the condition for the entry is checked at any moment within the current bar. But you want the condition to be checked only at bar close. So there is your BarStatus = 2.
So... I'm OK with your code.
It remains that you have some problem.
I advise that you simplify your code to the simplest. For me, the simplest form is 10 lines:
Does it work? If yes, add the sophistications one by one until the problem appears.
The following user says Thank You to Nicolas11 for this post:
If one uses BarStatus = 2 with 'buy next bar', the order will be executed on the first tick of the next bar (assuming it's a market order, otherwise it will be cancelled). With IntrabarOrderGeneration set on, the stop-loss for the same bar can be send on the second tick of the bar.
I can't say I understand the whole thread, but if I understand it correctly the enter stop orders need to be submitted for the whole duration of the next bar? If so, you'll need to use a true/false value to keep continue submitting the stop order for the next bar.
Because with IntrabarOrderGeneration next bar actually means next tick, the enter stop needs to be resubmitted. Otherwise, if the enter stop conditions aren't triggered on the first tick of the next bar, the order is cancelled.
Such a thing could look like:
Last edited by Jura; August 19th, 2012 at 04:24 PM.
The following 3 users say Thank You to Jura for this post: