DYO Volume bid/ask spread, DYO Alan's Box

July 6 , 2005

16:37 @Ensign_HA: Welcome to today's class.

16:37 @Ensign_HA: We have 138 users on the new server right now and another 120 on the old server right now. I think the new server is performing well so we will continue to encourage rooms to make the transition. Mike has some new ideas to incorporate in the new server, such as an e-mail page when it appears traffic has ceased (server down condition). And so in the next couple we weeks after we do some testing of the rewrite he is performing, we may have a better server with more features to offer. We will cross that bridge when we get there. The latest version is July 5th, and after class I will upload a July 6th version. Nothing significant has been added in the past week.

16:38 @Ensign_HA: The changes made have been to items on the To Do list which are issues requested / reported by an individual here or there and I had time over the long weekend to knock off a couple of these To Do items..... They are appreciated by the person with the request and may benefit some future user as well to either have the feature or avoid the same issue that was reported.

 

16:40 @Ensign_HA: does anyone have a DYO question they would like some help with at this time?

16:40 christophe: yes :)

16:41 @Ensign_HA: ok, chris, your question

 

DYO Volume same bid/ask spread

16:41 christophe: I was wondering if it is possible for delta DYO to collect volume for trades that have been made after the first trigger considering the same bid/ask spread? thx

16:42 @Ensign_HA: do you have a DYO you have started in this effort?

16:42 christophe: yes hold on

16:43 @Ensign_HA: ok, folks, the DYO posted by Chris is quite a complex one and requires a current version to function. Let me explain what this DYO does in the first place for the some of the room patrons it is not obvious what this DYO is doing

16:44 @Ensign_HA: The overall purpose of the DYO is to calculate to summations, one of which sums the Tick Volumes for the trades at the Bid, and the other sum is of the Tick Volumes for the trades at the Ask.

16:45 @Ensign_HA: Line A is a clever Bar Flag which will be TRUE on the first tick of the new bar and then False during the construction of the bar. This flag for the first tick of the new Bar Chris is storing in GV 247 and then testing it on Line B

16:46 @Ensign_HA: Line B is erasing 2 global variables which follow the Flag location when and only when the Flag is True. So apparently GV [248] and [249] are going to be the two summation GVs to hold the Volume at the Bid and the Volume at the Ask

16:47 @Ensign_HA: Line C needs to be explained.

16:48 @Ensign_HA: The discussion applies to C, E, F, and H where are Quote Flag and Quote Value lines, but there is NO SYMBOL in the symbol selection box. When the symbol selection field is BLANK, as in this example, the DYO will default to use the Chart symbol from the chart that owns this DYO.

16:49 @Ensign_HA: This default makes the DYO so it can be applied to any chart and still function without having to manually edit the symbol selection for the Quote lookup. If you wanted to get a value from some specific symbol, other than the chart's symbol, then a symbol could have been entered. So, assuming this DYO is on an ES U5 chart, then the Line C will Get the values from the ES U5 quote record.

16:50 @Ensign_HA: Line C is a boolean flag that tests to see if the Last value is equal to the Ask value + a number and the number is zero. So. Line C is a flag that is True when Last = Ask, or in other words, the last trade was at the ask price.... the flag is stored in [250] and used by Line D to optionally execute Line E when the flag is true

16:52 @Ensign_HA: Line E is going to Add the Tick Volume for the ES U5 symbol and the sum in [248] together and resave the sum in [248]

16:53 @Ensign_HA: So, the trio of lines, C, D, and E accomplish adding Tick Volume to the sum for the volume at the Ask, and storing the result back in [248]

16:53 @Ensign_HA: Lines F, G and H accomplish the same task of testing for a trade at the Bid, and when this occurs, then add the Tick Volume to the sum being maintained in GV [249]

6:55 @Ensign_HA: Line I is calculating the difference in these two volume sums.. AskVolSum - BidVolSum and showing this value as an integer on the chart by the last bar.

16:55 @Ensign_HA: OK, that explains this DYO

16:55 @Ensign_HA: there are some quirks about this kind of a DYO that uses data from the quote record, namely Tick Volume, Bid, and Ask values because these fields exist only in the quote record, and NOT IN THE HISTORY on the chart. THEREFORE it is very important that those of you viewing this class realize this DYO example will calculate in real-time BUT IT CANNOT show its calculations historically for the back bars on the chart when you open the chart.

16:57 @Ensign_HA: for example, an hour ago we do not have the Bid and Ask values stored anywhere. we only have a current Bid and a current Ask in the quote table to reference.

16:57 @Ensign_HA: so when you open the chart, the calculation is for the current bar only and will update as new data arrives. Ok, having explained all of that, including the warning about what it cannot do for showing a history from the back data, lets proceed with your question Chris. Ask the question again, please.

16:58 christophe: ok, but I noticed that the volume for *any* subsequent trade at that price in that BA is not counted

16:59 christophe: when the first trade in the current bid/ask spread happens, the volume traded get registered

16:59 @Ensign_HA: oh, that reminds me of one more thing to point out regarding this DYO before I answer the question. For a chart with this DYO, you need to press CTRL-P keys and uncheck the Optimize Speed option.

17:00 @Ensign_HA: the reason is this, Chris is wanting to sum the tick volumes for all trade ticks, including those that repeat at the same price, as in the T&S picture he posted. if Optimize Speed option is checked, we save calculation time by not recalculating studies when there is not change in the trade price. Thus, Optimize Speed needs to be unchecked so the trades at the same price get their Tick Volumes summed into the GVs.

17:01 christophe: thank you Howard!!!!! alleluia! :)

17:02 christophe: Howard, thank you so much! I am grateful for your support and the speed at which you come out every time with the solution. Nobody else in this business can match that. Thank you!

17:03 @Ensign_HA: thx chris, glad you like the DYO example, it is quite unique and uses some clever statements

17:01 @Ensign_HA: oh, I guess this discussion of what else to consider happens to be the answer to your question.

 

DYO Alan's Square

www.ensignsoftware.com/tips/tradingtips66.htm

7:02 @Ensign_HA: ok, we will now move on to Joe's question about Alan square tool

17:01 Joe-90: Howard, simple one, could you point me at where Alan's Box study flag conditions are explained please ?

17:02 @Ensign_HA: Joe, are you trying to reference Alan Sq, via ESPL GetFlag function?

17:03 Joe-90: no not espl yet only DYO ... haven't got an example though

7:03 @Ensign_HA: ok, DYO and Alan Sq flags, 1 moment while I look

17:06 @Ensign_HA: is this the form and list of flags you ask for help with Joe??

17:06 Joe-90: yes what is "Line" referring to

17:07 @Ensign_HA: ok, let me explain and demonstrate

7:07 Joe-90: thank you

17:09 @Ensign_HA: 1 moment, getting example ready to posit

17:12 @Ensign_HA: this 5-min chart has an Alan Square draw with the Auto Find HL option checked. The tool has two construction points which are at the 0% level on the Left and at the 100% level on the right side. I have drawn a thick yellow line on top of the Alan sq angular from 0% to the 100% to emphasize what the LINE is that the flag refers to. The Line is the angular that connects the 2 construction points.

17:14 Joe-90: so line refers to the major angular off the zero (low or high) number ?

17:14 @Ensign_HA: yes Joe

17:14 @Ensign_HA: To illustrate using the DYO we have selected the Flag that tests to see if the Bar close is ABOVE this angular line and in the example you can see the blue zone colors all bars whose close is above the line and not color the bars which then trade lower than the line after 14:00 in the example.

7:14 Joe-90: ok ...any way of making it an option to be other angulars ?

17:15 @Ensign_HA: There is not a way to change which Line is referred to. However you can harvest the current value of this angular line using the DYO and the add or subtract half range amounts to get to any of the angular lines that are parallel to this line., Also you can subtract the Line value from the 100% value to get the angulars that go the other direction.

17:16 Joe-90: can u give example of that ?

17:17 @Ensign_HA: 1 moment and I will see if I can quickly whip up an example.

17:17 Joe-90: ok ...need to get my thick head around that but I see where you are coming from ...

17:22 Joe-90: terrific

17:22 @Ensign_HA: ok, in this example, Line A is the value of the line drawn in the thick yellow, from 0% to 100% of main box. Line B and C get the two level values. Line D gets the average of the 2 values, so D is the Half Range size. Line E adds the half range to the main angular so we are on the 50% angular above the main angular. And Line F tests Close being above or below this new angular and colors background red accordingly. In this chart you can see the coloring is now based on a different angular than the prior chart.

17:24 @Ensign_HA: it should suffice as an example of computing which line you want to work with

17:25 Joe-90: yes that's great thank you

17:24 Joe-90: bravo Howard, last 2 related questions ... what do Study Values Close X Line, BarOn and Close>=Ala, bar Over do ?

17:25 @Ensign_HA: ok, the X is notation for a CROSSing instead of a relationship of above or below. If I change the test to the Close X Line then you will have an occasional True condition where the prior bar close is on one side of the line and the current bar close is on the other side of the line. This straddle of the line by 2 bar closes would constitute a CROSS the line condition.

7:26 Joe-90: ??? but its a study value not a flag ...so the result is a boolean ?

17:26 @Ensign_HA: the Bar ON, Close >= Alan Line is similar, in this manner. Only those Bars whose High and Low straddle the line, with the Close Being above the line are marked. You could have a few of these in a row when walking on the line. It is kind of a blend between a crossing and a relationship

17:28 Joe-90: I'll need to play with those two I think

17:28 @Ensign_HA: close is a relationship test and so is the High Low straddle being a kind of crossing

17:28 Joe-90: however the main thing is the line still refers to the main diagonal as earlier ?

17:28 @Ensign_HA: that is one beauty of the DYO, you can play with the selections and see how the choices change what gets marked

17:28 @Ensign_HA: correct, Line is just the Main angular line

17:28 Joe-90: yes very powerful - that's great Howard thank you very much for your time and effort

17:29 @Ensign_HA: Now, as a related subject to this, on the Alan Sq itself there are some Global Variables that you can set to store values directly from the Square in this manner that might be useful in your DYO

17:30 Joe-90: great

:30 @Ensign_HA: for example in the DYO example today I used Line B and Line C to write the Point A and Point B values into GVs for reference. I could have written those 2 prices directly on the Alan Sq. and thus had them already available for the DYO to reference and eliminated the Line B and Line C lookups

17:30 Joe-90: right

7:31 @Ensign_HA: let me post the Alan Sq to show

17:31 Joe-90: yes that's clear - same as other studies, just use the GVs to save values you want

17:32 Joe-90: so I can get my horizontal values that way ?

17:32 @Ensign_HA: for sake of illustration, on this Alan Sq, I pushed the available line values into GVs [1] through [10], could have done last line too into [11]

17:33 @Ensign_HA: now lets use the Quote page Variable page to example the values that were stored by the A.Sq.

17:34 Joe-90: the values of the Up and Down diagonals are what points then Howard ? GVs 3 and 4?

17:35 @Ensign_HA: the Horizontal Line wrote to [1] a value of 1196, which is the Price A value

17:36 @Ensign_HA: the Vertical Line wrote to [2] a value of 1210.75 which is the Price B value

17:37 @Ensign_HA: the Up Diagonal Line wrote to [3] a value of 1210.73 which is the current main up angular line value for the current bar position which is near the 100% line and so it is now near the Price B value.

7:38 @Ensign_HA: the Down Diagonal line is doing for you the other main angular line value that goes from 100% left side to 0% right side. Thus this line is the other main angular that forms the primary X

17:38 Joe-90: clear

17:38 @Ensign_HA: its value in [4] is now near the Price A value as expected because we are at right side of square with current bar and this down line is back to the 0% level, price A value. The remaining lines on the form are posting to the GVs, their particular percent value in the primary square.

17:39 Joe-90: the horizontals

17:40 @Ensign_HA: for example, the 50% line was writing [8] with a value of 1203.375 which is the 50% horizontal level value you see on the Alan Square as a price on the right side of the 50% line. So you could add the spread between Price B and A to the 50% line to know the 50% line in the next square higher, etc. This should get you on your way and has also demonstrated some techniques you can use for self discovery of what the values are on the property form

17:41 Joe-90: yes from those values you can calculate everything else ..... final question Howard, is there any way of writing a short alarmed horizontal line on the chart using a DYO ? Get me on my way .??? I think I just arrived !

17:42 @Ensign_HA: write them to some GVs, go example the Quote | Variables page to see them, and find the same values on the chart to associate what you are getting with what the tool is drawing

17:43 Joe-90: right...thanks a lot Howard, very much appreciated

17:43 @Ensign_HA: the DYO does not create other objects, such as an alarmed line.

17:43 @Ensign_HA: However, you can have the DYO make a test such as a price crossing your 'line value' and perform a Global Action of a Beep. the Study Alert object is better suited for doing this kind of a test for an alarm because you can select a wav file to play, and post an alert message when your trigger conditions are met.

17:44 Joe-90: I will look at that also thank you

 

Way to compare IB and Esignal Data

17:45 @Ensign_HA: OK, now I will answer NEB's question from 20 minutes ago, which was:

17:45 @Ensign_HA: Howard....can I use Ensign on IB an eSignal.....or do I have to pick just one? I am trying to compare data......having trouble with dtn historical

17:45 @Ensign_HA: neb, there is a single version of Ensign and on the Setup | Connection form you select the data vendor. The selection can be eSignal or it can be Interactive Brokers. We do not have the program designed to be a dual feed processor, so pick one or the other. You can do this for your test:

17:46 @Ensign_HA: you can collect live ticks from IB for a period of time, such as an hour on a constant tick chart, such as -100. Then you can count the number of bars in that measured time period. You can then change your data feed to eSignal and refresh for today and recount the number of bars in the measured time period.

7:48 @Ensign_HA: the number of bars * 100 is the number of ticks in the period.

 

8:17 @Ensign_HA: well I see our 2 hours for class have again flown by today, as usual

18:17 @Ensign_HA: thanks for coming, and I will get onto the Newsletter article

8:18 @Ensign_HA: if any of you do not subscribe to the Newsletter, go to web site and enter e-mail address in the form to subscribe. It is free, and often has some really great material that is educational

18:18 Mixer: thanks Howard

18:18 @Ensign_HA: gn

18:18 christophe: Many thanks Howard! gn!