First, I managed to reproduce your problem, on the same chart (AAPL 1min July 26th, 2012).
From @Jura's post above, I understand that, when [IntrabarOrderGeneration = true], "at next bar" means "at next tick".
So the strategy was entering "at next bar" (in the common sense) only if the first tick of the next bar was above the High of the current one.
But you want to enter at any tick within "next bar" provided that this tick is above the High of the current one.
So you have to use @Jura's idea.
I have integrated it into our small code. See below. It seems to work. See picture.
"at High stop" is correct when the above 3-line block of code is read on the last tick of the current bar.
But if these lines are read at a tick within the next bar (supposed to be the entry bar), should be "at High stop".
I think that it could be corrected as follows:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
The following 2 users say Thank You to Nicolas11 for this post:
Yes that is correct. It works now... You are correct that we need to store the PriceForEntry in a variable.... Thanks so much!
Because I would like to make sophisticated stops, it would be good to use a lower time frame chart, but use a higher time frame data for entries.
Yesterday I spoke of creating a high and a low for the complete hour and drawing a trendline on the chart for each next hour.. So if during 10am to 11am the highest tick was 610.20 and the lowest tick was 605.80 then we would have horizontal trendlines from 11am to 12am at 610.20 and 605.80. This would be a visual cue , but in fact the strategy would enter a trade long if it price broke above 610.20 and would enter short if it broke below 605.80. Then I can use the smaller time frame bars in the chart to manage the exit (do a trailing stop if i am in a long trade and it breaks the highest low of the last 2 bars or something).
Actually the existing strategy would look at the trendlines of the last 2 hours, to see if trendlines are higher high and lower low, and then if so , if the next hour breaks the high it enters long...
If you have time to code something like that, I would really appreciate it.
1. You're welcome, but your thanks shall also be directed to @Jura: he solved the most difficult part.
2. Even if it is possible, I think that there is no need to use 2 timeframes to manage your strategy. With [intrabarordergeneration = true], you can manage what happens at all ticks in the bar.
3. "the strategy would enter a trade long if it price broke above 610.20 and would enter short if it broke below 605.80"
Do you mean that the strategy would enter long at any bar on a breakout (up) of last bar's High?
If yes, you can very easily adapt the above code. I do not see the problem.
4. Trendlines --> I first need to understand 3.
The following user says Thank You to Nicolas11 for this post:
9am to 10am Highest high was 505.20 Lowest Low was 502.30
10am to 11am Highest high was 506.20 Lowest Low was 503.50
Therefore, if we were in hourly chart we would see that the last bar offered a higher high and a higher low.
So if during the next hour, price rose above 503.20 we would enter long.
The reason why I would like to have lower time frame bars is because by looking at how bars are painted I can do more sophisticated stops. For example if i had 300 shares long, after it hit target 1, then i can implement an trailing stop where I would look at the last 3 five minute bars and if price fell below the lowest low of the last 3 bars then it would stop me out of the trade.
Therefore, I use the hourly highest high and lowest lows to determine if the trade is qualified to go long, and at what price, then I can use a lower time frame bar (for example, 5 minute bars) to implement a more agile and sophisticated stop strategy.