Mini-Class on modulo and time visualizations -
picking up line pts for GVs

Feb 1 , 2005

 


16:19 @Ens_HA: Let me use this example for the training discussion....

16:20 @Ens_HA: Line A gets the chart bar time in minutes from midnight (Eastern zone) ..... so the 8:00 bar returns 8x60 = 480 minutes.

16:21 @Ens_HA: we will divide this number of minutes by a time period size such as 30 to create the number of periods into the day we are in.

16:21 @Ens_HA: in this 8:00 example, 480/ 30 = 16 so we are in the 16th 30 minute period of the day.

16:22 @Ens_HA: Line B does a truncation operation on the division from Line A, because we can be fractionally into a period too.

16:22 @Ens_HA: so 8:00 through 8:29 will all return 16 as the 16th period

16:22 @Ens_HA: Line C does a modulo operation of dividing by 4, and it is the Remainder we are interested in.

16:23 @Ens_HA: so 16 divided by 4 has a remainder of 0, but 17 mod 4 is 1, and 18 mod 4 is 2, etc.

16:23 @Ens_HA: We use lines D..G to plot the four possible remainders of 0,1,2,3 from the modulo 4 operation using 4 different colors as a rotation sequence.

16:24 @Ens_HA: this you can see on the chart, every 30 minute period uses a different background color created by the Zon coloring marker.

6:24 @Ens_HA: That is a pretty slick way to get time bands on the chart

6:25 @Ens_HA: If this tool is applied to your tick, range or volume charts, the band widths will vary, but still represent a 30 minute period of time passing.

16:25 @Ens_HA: now Randy or others have used this principle to show related time bands (same colors) on different charts and that is a cool use of the idea.

6:25 @Ens_HA: any questions about lines A..G??

16:26 tradinoncoffee: @Ens_HA, could you please explain the difference between this the other zone DYOS used before?

16:26 @Ens_HA: they are similar or the same, this example used 30 min instead of 5 in an earlier example and the change to what I show on Line A and B does a better job of aligning the band to the hour and half hour chunking you would expect without the added step of the Trunc, you were getting a rounded time, where the 30 min bar was from 46 min before to 15 min after the hour instead of from the hour to the half hour, etc. so it represents a slight improvement in color alignment with the clock

16:28 tradinoncoffee: ok, so this starts it at the top of the hour...so to speak

16:28 @Ens_HA: yes last Saturday example had some rounding involved and the bands appeared to start ahead of the top of the hour.

16:29 @Ens_HA: ok, lets move on to the new stuff in lines H..J

16:30 @Ens_HA: Line H is reading the Bar Index of when an Alert was last showing a True

16:30 @Ens_HA: on the chart is a simple alert that is marking with green bars above the highs those bars that have a Higher High.

16:31 @Ens_HA: the new thing is to expose the bar index of when the bar is marked with the True condition marker.

16:31 @Ens_HA: if the chart file has 500 bars in it, then the last bar showing is index 500 and the prior bar with a green bar is bar position 499 in the file.

16:32 @Ens_HA: the Index is just the position of the bar in the collection from 1 through the number of bars in the file.

16:32 @Ens_HA: the next bar will occupy Bar Index position 501 in our 500 bar example.

16:32 @Ens_HA: ok, so what can we do with the Bar Index of when an Alert went True.

:33 @Ens_HA: Line I reads the bar index for the alert which was stored in GV[3] and adds an offset of 5 to the count and resaves in [3]

16:34 @Ens_HA: Line J is testing to see if the current bar index matches the alert index + 5

16:34 @Ens_HA: and when this is True, mark the bar with the dark blue histogram bar from the bottom

16:34 @Ens_HA: we see some examples of this on the chart.

16:35 @Ens_HA: lets look at the middle example in the yellow band from 13:00 to 13:30

16:35 @Ens_HA: the 13:00 bar has a green bar hat, that stores the index for bar 13:00 in [3] and [3] becomes this index + 5 bars

16:36 @Ens_HA: [3] still has the same value when we get to the 13:25 bar and then the current bar index at 13:25 matches the alert index +5

16:37 @Ens_HA: so the example is basically alerting us that we are 5 bars past the last alert True, and possibly we want to do something about this

16:37 @Ens_HA: another way of saying this, is mark every 5th bar AFTER an alert True if there is not intervening alert

16:38 @Ens_HA: we have gone 5 bars without seeing a higher high

6:39 @Ens_HA: so for the 3 places with the dark blue histogram, look at the bars preceding.... the prior alert 5 bars leftward is a Higher High bar and all bars after that to the blue bar have been lower high bars.

16:40 @Ens_HA: I do not know that this idea in and of itself is useful for trading, but it illustrates that you can use Bar Indexes to test for something

16:40 @Ens_HA: that is a fixed number of bars After some event and choose to do something else.

16:41 @Ens_HA: So, some of you advanced users may have an occasion where you need to test something that follows a setup signal occurs.

16:42 @Ens_HA: a possible use for this example would be if we are Long a position and have not put in a higher high in the last 5 bars then bail out.

16:42 @Ens_HA: the blue bars would be the bail out signal

6:42 @Ens_HA: the green hats are showing a higher high bar.

16:43 @Ens_HA: ok, any questions about bar indexes?

16:49 @Ens_HA: Ok, in this example we are using one of the New Chart flags which will be True for timestamps after 13:00 to 13:30

6:50 @Ens_HA: some users wanted to show they have entered a particular time of the day, such as the opening time period, or the lunch time period or a pre-closing time period.

6:50 @Ens_HA: only takes the one line as shown to color the time zone width of 30 minutes with the timestamp of the start givein in the Value field

16:50 @Ens_HA: 1300 is the 13:00 time stamp

This shows that many bars fell in that 30 minute period the day before but only one today

6:56 tradinoncoffee: it also enables you to mark specific times on non time based charts

16:57 @Ens_HA: this picture shows some of the new Study Values exposed for draw lines, and the next example will use a couple of them.

16:58 tradinoncoffee: WOW...so now we can pick up line values....

16:58 @Ens_HA: lets discuss this little example that uses Line values.....

6:58 @Ens_HA: Line A will return a Bar Count after Point A, left side.....so all bars to the left of point A return zero and all bars after point A return the spread (bar count) between the bar and point A

16:59 @Ens_HA: so bars after point A will be positive numbers.

16:59 @Ens_HA: Line B does the same thing for point B.... bars left of point B return zero and bars rightward of B return a positive number.

17:00 @Ens_HA: I use these two clues to conditionally plot the purple zone between points A and B.

17:00 @Ens_HA: Line C tests to see if we are after point A and when this line is TRUE we then execute Line D, and only execute D when C is true.

17:01 @Ens_HA: Line D does the 2nd test to see that we are ALSO leftward of point B.... and plots the zone color when D is also true.

17:01 @Ens_HA: that is why the coloring is done on bars between A and B

7:02 @Ens_HA: If I change the placement or width between A and B the zone coloring will auto change too, as illustrated in this picture

17:03 tradinoncoffee: @Ens_HA, if you have more than one line on your chart....does this DYOS affect them all???

Pick which one you want it to read from - like if you have 2 stoch and pick one you want

17:08 Shar: Looking at this chart 97, then if one had a rising trendline from 10:04:00, then the area would be colored until it broke that up trendline?

7:09 @Ens_HA: In this example, I have combined looking at the position of the line using Line A and testing position on Line C and that conditionally allows Line D to execute which plots a spread between prices on D and E

17:09 @Ens_HA: and these two prices are read from the line's A and B endpoints.

17:10 tradinoncoffee: GAPS!!!!