| Sum GVs, Ergodic Candle, Duffy SnR, QnA |
Mar 2, 2005
@Ensign-HA: The weekly class with Ensign developers will begin in 20 minutes at 30 minutes past the hour. Please join us for some training and Q&A session.
16:22 swade: Howard is there a way to sum a row of variables?
16:22 @Ensign_H: yes use Global Variables | Sum[#] entry
16:23 swade: what is syntax for variables in that {31,32,33}?
16:23 @Ensign_H: have Number field with 3, and Read GV = 31
16:24 @Ensign_H: so it is Global Value | Sum[#] | #=3 | Read GV = 31
16:24 swade: yes, thank you Howard
16:33 @Ensign_H: Welcome to our training class today with the program developers.
16:34 @Ensign_H: Many of you continue to produce exceptional examples with the tools in the program, and we hope that by having weekly classes we can help others gain knowledge of and confidence in using more of the program features.
16:34 @Ensign_H: A Robert Krauz article described the Ergodic Candle as "a double smoothed ratio of the difference between the close(C) and open(O) of each bar, and the difference between the high(H) and low(L) prices for each bar" originally created by William Blau.
16:35 @Ensign_H: I believe the formula is: {ECO[Ergodic Candlestick Oscillator]}
16:35 (MOV(MOV(C-O,5,E))26,E)/MOV(MOV(H-L,5,E))26,E))*100
16:36 @Ensign_H: This formula can be implemented in the Design Your Own (DYO) study feature in Ensign and will serve as the 1st example for our class.

16:37 @Ensign_H: from the formula, we need a spread between the Close and Open, ie (C-O). This is accomplished by Line A, B and D..... Line A gets the Bar Close, Line B gets the Bar Open and store the values in GV [1] and [2]
16:38 @Ensign_H: Line D subtracts the two values, so Line D has the ( C - O ) part of the formula. The denominator needs the ( H - L ) which is the bar's range, and that can be obtained directly by Line C. The numerator had a double average, one being a 5 period average, and then a 26 period average of the 5Ave.
16:39 scooter: the # symbol just denotes using the current bar?
16:40 @Ensign_H: no scooter, the # denotes a number to be added to the value returned, and we have the number field set to 0
16:41 @Ensign_H: The Bar Offset set to zero means you are getting the current bar value, and not a prior bar value (ie Offset = -1)
16:41 @Ensign_H: Line E is an Exponential Average of Line D, and the parameter is 5..... so Line E is the MOV(C-O,5) part
16:42 @Ensign_H: Line F is an Exponential Average of Line E, and the parameter is 26..... so Line F is the Mov(Mov(C-O,5),26)
16:43 @Ensign_H: Line G and H do the same double average but for the denominator, which is the range on Line C.
16:43 @Ensign_H: the double average of the numerator, Line F is stored in GV [3], and the double average of the denominator, Line H is saved in [4]
16:44 @Ensign_H: Now Line I can do the final division and plot of the formula. Line I is [3] * 100 / [4]
16:44 @Ensign_H: This is plotted as a red line in its own sub-window scale, which example is shown next.
16:41 scooter: ok, so you are adding a value to the close in line A?
16:44 scooter: I am confused on the syntax of lines A,B,C . is the number sign there to tell the program that you will be adding those values later on?

6:45 @Ensign_H: Line D has the sign in the formula: Value + # - Next = [1] + 0.0000 - [2] ............ [1] = Close [2] = Open.......So the effect is Close + 0 - Open
16:46 scooter: that is what is confusing me, it #=0 why bother to put it in???
16:46 @Ensign_H: we talk in terms of the current bar on the chart, but you need to realize this point.
16:47 @Ensign_H: Each of these 10 lines is an array of values, and they will pick up a data point for each bar position in the chart...so all array positions are aligned with the bars on the chart.
16:47 @Ensign_H: so Line A is an array of bar closes
16:47 @Ensign_H: Line B is an array of bar opens
16:48 @Ensign_H: Line D becomes an array of spreads between C - O
16:48 @Ensign_H: the # is not needed in this example, but the drop down selections are trying to be as flexible as possible to offer in a single selection a choice that can have multiple uses - you could have the # field be zero, or a positive or a negative number.
16:49 @Ensign_H: this one statement then serves for all of these: Value - Next, Value - Next + #, and Value - Next - #
16:49 scooter: oh, I just got it, thanks - the light went on lol
16:50 @Ensign_H: # is just the number value from the Number field on the form
16:50 scooter: thanks
16:50 @Ensign_H: On line E we needed a parameter for the ExpAve, so the # was the number field to enter the parameter, which is 5 in the example
16:51 @Ensign_H: So the DYO was a quick place to prototype/implement this formula from the article
16:52 @Ensign_H: we accomplished nesting of functions by having later lines in the DYO reference earlier lines, like in the case of Line E and F
16:54 @Ensign_H: any questions about the Ergodic Candle example?
16:55 cajun: looks good Howard - I dont know how it's used tho
16:56 Kent: Would this DYO give the same result as the Ergotic Indicator?
16:56 @Ensign_H: there are a dozen or so examples with templates already on the Help page of web site
16:56 n7rme: is this right in D Value= Close & Next=Open?
16:56 @Ensign_H: no kent, Ergodic formula is double average of the Net divided by double average of the Absolute Net
16:56 @Ensign_H: so the numerator and the denominator are different starting points
16:57 @Ensign_H: the double average in both top and bottom is same idea, but candle body size is different than net, and range is different than ABS(net)
16:58 @Ensign_H: ok, lets move on to 2nd example.
16:59 @Ensign_H: Another user recently came across a technique published in Futures Magazine used by Joe Duffy for identifying S&R levels. He calls the indicator the 3x5ATR. His method of calculation is located at the bottom of the following page:
http://www.futuresmag.com/library/daytrade97/day7.html
16:59 @Ensign_H: He defines the construction below:
1. Add up the true ranges for the last five days and divide by five. This is the 5ATR. 16:59
2. Calculate a three-day simple moving average of the highs and a three-day simple moving average of the lows. 16:59 16:59
3. To calculate the 3x5ATR for potential resistance, add the 5ATR to the three-day moving average of the lows. To calculate the 3x5ATR for support, subtract the 5ATR from the three-day average of the highs.
7:00 @Ensign_H: This formula is easy to implement in a DYO and will be demonstrated as the 2nd example.

17:01 @Ensign_H: The formula starts with a 5 period simple average of the True Range, which we can implement with Line B
7:02 @Ensign_H: Line A returns the 3 period simple average of the bar Highs, and saves in [1].
17:01 @Ensign_H: Line B selection gets the True Range, averages it (simple) using a parameter of 5.
17:02 @Ensign_H: Now we have the ave high in [1] and the ave atr in [2]
17:02 @Ensign_H: The support line was High - ave Atr, and this is calculated and plotted by Line C.
17:03 @Ensign_H: The resistance line was Low + ave Atr, and this line is calculated by line E and plotted.
17:03 @Ensign_H: Line D gets the average Low so it can be added to the ATR to make the upper resistance band.
17:03 @Ensign_H: The following chart shows the two study lines calculated by the DYO

17:04 @Ensign_H: This idea is similar to a Keltner Channel, except the average true ranges in a Keltner are offset from a moving average center line of through the closes.
17:05 @Ensign_H: This 3x5 ATR is using offsets from an average High and an average Low - that is the difference as I see it.
7:06 @Ensign_H: now if you want wider bands, you would insert a Line at C and use a global value to read [2], multiply by a number and resave in [2]
7:06 @Ensign_H: that will make for a bigger average ATR value to add and subtract from the ave High and the ave Low.
17:07 @Ensign_H: any questions about the implementation
17:08 @Ensign_H: these two examples, hopefully illustrate the flexibility and power of the DYO to do calculations and plotting using the selections you pick on the drop down lists.
17:08 scooter: in line c when you put value that just reads the global value and then -next will subtract the value from the next global value,correct??
7:09 dljtrader: how does price finder help determine at what price the channel would be broken for the next bar?
17:09 @Ensign_H: yes scooter, Value is being defined by the Read GV spinner box, and it is set to 1 so Value is the content of [1]
17:10 scooter: thanks
17:10 @Ensign_H: Next is always the next GV in sequence, ie [2]
17:10 @Ensign_H: so line C is subtracting [1] - [2] and [1] = Ave High from Line A and [2] = ave ATR from Line B because on Line A and B we stored the values in [1] and [2] using the Write GV spinners
17:10 scooter: pretty easy once understand the syntax
17:11 @Ensign_H: so [1] was just a temporary parking spot for the Line A calculation
17:11 @Ensign_H: [2] was temp parking spot for Line B calculation
17:12 @Ensign_H: that way Line C can use the subtraction formula of Value - Next, value is the Read GV [1] and Next is the Read GV[1+1]
17:13 @Ensign_H: If Line A had written to [5] and Line B to [6] then Line C Read GV would need to be a 5
17:13 @Ensign_H: cajun, the lines look very logical to me - they are high and low enough - remember you are not starting from a center line like Keltner, you are adding from a low and subtracting from a high so the band would typically be average true range apart, and that is what they look like.
17:17 @Ensign_H: I think the DYO is turning out to be a pretty slick tool for implementing lots of new great ideas, formulas, and visual effects.
17:17 @Ensign_H: any questions or comments or feedback from DYO users?
17:20 TOC: DYOS a great tool...just need my imagination stretched further now
17:20 @Ensign_H: TOC, show the room one of your creations, please

17:22 TOC: Breadth analyzer
17:22 @Ensign_H: wow, toc, exceptional - all the Sections at the bottom of the chart are showing values and calculations and colors
17:23 mmaker2: very nice TOC!
17:23 scooter: that is awesome TOC. must have drank a lot of espresso to figure all that out

17:23 TOC: adv/dec issues

17:24 TOC: lower study shows cumulative ES volume compared to last 5 days and average
17:25 @Ensign_H: guess we should have TOC as a trainer for a class some week and go into greater detail with one of these examples.
17:25 JSOB: good idea, @Ensign :-)
17:27 @Ensign_H: Now, if buffy is here, I think she came with a DYO question or request, and will ask buffy to do that now.

17:28 @Buffy2: line A gets the value of the 30wma
17:28 @Buffy2: line B gets the keltner middle band
17:29 @Buffy2: line C sees if it is above line A
17:29 @Buffy2: now line D gets the value of the bline
17:30 @Buffy2: and this is where problem arises
17:30 @Buffy2: this will be true at the beginning of trend but as the trend develops it may not be but another study will be but that second study won't be true at beginning of trend. Have I confused you yet? :-)
17:31 @Buffy2: so if only D is false I would like to test another value
17:30 @Ensign_H: agree with ABC - let me think about your lines to catch up, 1 moment
17:31 @Buffy2: E gets autotrend
17:31 @Buffy2: F gets LP
17:31 @Buffy2: G gets value of Stoch k
17:31 @Buffy2: H sees where that value is
17:32 @Buffy2: I compares them all
17:32 @Buffy2: many times I see only D is false and that is when the other indicator should be used - have been going around and around with it
17:33 @Ensign_H: your idea and implementation is correct
17:33 @Buffy2: can only find an option to skip if true - it is as the trend gets stronger that need to compare to another variable
17:34 @Ensign_H: so you want to replace Line D
17:35 @Buffy2: Line D is the optional one - good for beginning of tend - bad for strong trend

17:37 @Ensign_H: Line G and H can be combined to a single Study Flag test as shown that would be a bit more efficient
17:37 @Buffy2: ok thanks
17:37 TOC: is "<=#" a possibility?
17:38 @Ensign_H: toc, you want an event instead of a relationship that makes it True on a single bar and that is much harder to have it align with the other trend and Pesavento swing bars. Would be rare to have cross event align with the other flags
17:38 TOC: exactly....was thinking that flexibility in specifying the number would make visual backtesting easier
17:38 @Ensign_H: so I discourage you on that - have common levels built in as flag tests, and for general odd number use the format buffy used of getting study value and compare to number of your choice - takes 2 lines then instead of 1
7:40 TOC: got it\out of variables
17:41 @Ensign_H: buffy, guess I do not know solution to your design search for what to do about B-Line rising or falling at the time of the other flags, however, your approach is clean and efficient and you will have to experiment for your 'other' possibility
17:41 @Buffy2: when only that is false want to test the 21-10-4 stoch instead as it has now had time to develop spread.
17:41 @Buffy2: ok tks
17:42 @Buffy2: Let me ask you this - What is the workaround for the condition do if true because I want it to do it if false.
17:42 @Ensign_H: to switch to a different test you would have to test your line D and then on E have something like Do Next If and Line F is the new study flag to replace flag in [4]
17:43 @Buffy2: do next if (true) right? But line D will be false
17:43 @Ensign_H: yes, and to do the same for False the Do Next If selection would be Not Flag
17:43 @Ensign_H: when Flag = False then Not Flag = True
17:44 @Ensign_H: if flag being tested Line D stored in [4]
17:44 @Ensign_H: then Line E would be Do Next If | Not Flag and Read GV = 4
17:45 @Ensign_H: so if [4] is False, then Line following the Do Next If would be a different study to replace content of [4]
17:43 @Buffy2: ok lets make sure I understand this - This will skip line E if line D is true?
17:45 @Ensign_H: yes it would because when [4] = True then Do Next If test would be False and skip next line using Not Flag selection for Line E's Do Next If test
17:46 @Buffy2: would you please just post the order of this
17:46 @Ensign_H: ok, let me show a picture, 1 moment

17:48 @Ensign_H: in example, Line D emulates your Sto test save to [4]
17:48 @Ensign_H: you had rising test, whatever
17:48 @Buffy2: right, this is fine
17:48 @Ensign_H: Line E does the Not Flag test of [4]
17:49 @Ensign_H: and if [4] = False then Line F executes which is some other study flag to replace [4]
17:49 @Buffy2: explain that not flag line in real simple words please
17:50 @Ensign_H: Do the next line (F) if and only if the Flag [4] is Not True, ie do it when it is False)
17:50 @Ensign_H: selection of Flag would do it if Flag = True
17:50 @Ensign_H: selection of Not Flag is the inverse, do it if Flag = False
17:51 @Ensign_H: because a Not False is a True
17:49 @Buffy2: got it - thanks! Sorry to be a slow with this concept
17:51 scooter: you're not alone Buffy
17:51 @Ensign_H: np, you got it
17:52 @Ensign_H: the selection for the Do Next If is returning a boolean result for the selection, such as one of the many tests in the list.
17:52 @Buffy2: thanks Howard
7:52 TOC: nice example to follow...if/then logic cramps my head sometimes
17:52 @Ensign_H: Flag just looks up the GV directly..... Not Flag tests the Not case of the GV flag
17:54 @Ensign_H: buffy, time for the primer page from your dachart site, please
www.dacharts.com/qtips-dyos/get-started-gvs-dyos.htm
17:56 @Ensign_H: gn christophe
17:57 @Ensign_H: ok we are at the Q&A part of the class, and I believe we had a pending question yet to answer so ask your question
17:58 @Buffy2: Howard if I do a continuation dyo can I do the AND[#] on it or better to come off of first one with only one gv
17:59 scooter: thanks Howard for the class
17:59 @Ensign_H: buffy you can do the AND on the 2nd DYO - the gv values are still holding content
17:59 @Buffy2: ty
18:02 sputnik: hello Howard, I have a simple DYO drawing at strange chart locations

18:03 @Ensign_H: ok sputnik, show the DYO form now

18:03 @Ensign_H: sputnik the plot is correct....the sub-window scale is using chart scale and the data forward shifted 264 bars is just not in the same chart scale range.
18:05 sputnik: can I change the sub-window scale to see the whole range ?
18:05 @Ensign_H: not with the average study like you are doing
18:05 @Ensign_H: you can change to a DYO to do the same candle thing you now do with 2 averages and on the DYO you have the advantage for scale to select Data Set and then the sub-window will auto scale to the data set plotted
18:06 @Ensign_H: so on the DYO you will have 4 lines to implement
18:06 @Ensign_H: Line A and B get bar High and Low and do a thin line spread to make the wick then Line C and D to get bar Open and Close and do fat line spread to make the body change the Scale selection to be Data Set or Data Set + 5% and to get the offset effect you seek of 264 use on line A , B, C and D a Bar Offset of -264 entry
18:08 sputnik: great. thnx again
18:08 cajun: Howard - am trying to use a constant volume chart - it doesn't reset at open synch time of 8:30 ET- any way to force it? am using IB so is the volume total correct or am I missing a lot of volume in the bar building?
18:08 @Ensign_H: IB volume is correct from my data feed comparisons so you are not missing any tick volume - To reset at open time you need the New Vol Bar at Open box checked which is found on the Setup | Charts form. If the New Vol Bar at open is not checked it would be the cause of a change in a refresh
8:18 @Ensign_H: any more questions? Ok, thanks for attending class and have a good week trading.
18:19 @Buffy2: thank you for your patience Howard
18:19 @Ensign_H: see you next week - bye
18:19 hobo3: ty