Sorry to say this solution will not work with the conditional orders. This solution uses recursion, which is not permitted in the conditional orders (at this time). Please check the new answer I provided on 5/23/18.
This is really a great question. I can see how you would think the condition you created would do the trick. But there are some missing elements and I will explain everything.
First, let’s take a look at the code generated from your Conditional Order:
close crosses above high
And we can see that your Conditional Order is set to the 1 min time frame.
In English this is stating: “when the close of the current one min bar crosses above the high of the current one min bar”
That, is completely impossible. The close of the bar can never cross above the high of the same bar. They can be equal. But the close can never be above the high, of the same bar. So we need to add a bit to this code to get the current high of the day. And we need to do this so that we exclude the current bar. Because we only want this to be true when the close of the current bar has crossed above the “previous” daily high.
So we employ a few tricks that are compatible with the Conditional Order:
def newDay = GetDay() <> GetDay()[1];
rec highOfDay = if newDay then high else if high > highOfDay[1] then high else highOfDay[1];
plot trigger = close > highOfDay[1];
Line 1 checks the current day of each bar on the chart, and when the first bar of the day appears on the chart it equals true.
Line 2 is recursive and first checks if newDay is true and assigns the high of that bar. Next, it checks if the high of any given bar is higher than the previous value of highOfDay. So this variable always contains the highest high for the day up to that point.
Line 3 is the trigger. This checks that the close of the current bar is higher than the highOfDay of the previous bar. When this evaluates to true, you have the close crossing above the previous daily high.
Screenshot below shows what this looks like on a chart. So you can see exactly where and when the trigger is going to be true. Be sure to unchecked the Ext Hours box. Unless you want to include extended hours trade. If you do use extended hours trade, the premarket high can become the high of the day.
Hello Pete
I placed the conditional order on a stock, when I placed the condition, the OK button Is not working and it will not accept the condition, Attached is the order I placed.
Thanks.
Right, terribly sorry about that. My error occurred to me as I was drifting off to sleep last night and by the morning it had completely left my mind. I will provide the next best solution in a new answer to the question.