Box Magic Template

Box Magic

Here is my template for the automated recognition of events within Alan’s box. You can see that I have somewhat pretentiously called it Box Magic. As set up here, it can be used “out of the box” (hehe) for any 48 bar chart such as YM chart 1.

As you will also see it is quite complicated and presently consists of 18 DYOs and 4 Alerts.

One of the main issues I had in constructing this was how to make the template universally applicable to any chart. I do have a version that calculates where the apexes are for any chart; but where the apexes are not aligned perfectly with a bar, you get problems.

Accordingly, I decided the best way was simply to manually identify apexes by bar number. This gets away from different timezones, chart start times and so on. So a box for the 10m YM should work in Kulifornya, Germany, New Zealand or wherever. Similarly, the template can be easily modified to accommodate any chart. Change the “apex definition” DYO to identify the bar numbers of the apexes (always start with Bar 1 – yes, it is an apex also; Line B should always define the second apex otherwise you will get problems).

I also wanted to apply the template to more than one chart in the same workspace. Given that I have used up all the private GVs Ensign gives us, I had to construct more than one version in order to use unique GVs across multiple charts. Later, I will forward other versions for use in the same workspace if anyone is interested.

Anyway, fwiw here it is. Just follow the setup instructions below and you should be fine. Do not save the template over the original, you may corrupt it.

Alan Box Setup

On your box you need to do two things (see attached Box Properties picture):

The box should be moved to the top of your list of chart objects so that the DYOs can “see” it.

When you make your box always start on the left and drag it to the right. If you start on the right then “Point A” of your box will be at the box end; in this case the template will not work. Align the left edge as near as you can to the centre of the first bar of your starting period. For YM chart 1 that will be the 0820 bar (if you have timestamp on open checked in your charts setup) or the 0830 bar (if you do not have timestamp on open checked).

Below is a picture of what the box properties should look like.

Ensign will not allow Draw Tools or references to them to be saved in DYOs (Alan’s Box is a draw tool) so that leads to a little more work.

Initialize Setup

The first 3 lines of this dyo need to be set up according to the Initialize Properties picture below.

Other than to ensure that no other template in your workspace is interfering with the GVs mentioned below, that’s the setup complete. If you keep more than 1 box on your charts and, like me, if you setup a tab for the GVs in lines 1 and 2; just ensure that you blank out (set to zero) the GVs for the non active boxes.


Whatever else you decide to take off, don’t take these dyos off your charts. They set up the up and down angular boxes.

Bar Count

This is the bar counter and the sub-window used is also where I print the signals; v for vbt, 2Z for 2 zedder, P for apex predictor, coloured X for apex splitter. Technically you don’t need the bar counter, the signals will print in sub-window 1 whether the bar count is used or not.

Apex Splitter, 2Z, VBT, Apex Predictor

Should be self evident. In addition to the signal in sub-window 1, an alert (beep – this can easily be turned off or changed) should sound for each signal.


This uses sub-window 2 to print a red bar if current close is in a resistance zone, and green if in a support zone. Just drag the sub-window down to height you require; do that also for the bar counter/signal sub-window 1.


You may choose to have (or not) additional highlighting of each signal. To turn on simply go to the Highlight dyo and put a zero in the number field; to turn off put a 1. You can easily change the colors used or change to (say) highlight the signal bar instead of using “Zon” to highlight the entire bar column.

GVs Used

The following GVs are used:

That’s it. Enjoy it and I hope it helps your trading.