Registered User Joined: 12/27/2013 Posts: 152
|
Thanks for that Bruce.Now the following request goes two bars into future:
Assuming the price remains static at open till the open of the second future bar; write the
(i) formula for the exponential MACDi,j at the open of the second future bar.Write the formula in terms of O and past price movement and past exponential moving averages
(ii) formula for the simple MACDi,j at the open of the second future bar.Write the formula in terms of O and past price movement and past simple moving averages
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
(i)
(2 * O + (i-1) * ((2 * O + (i-1) * ((2 * O + (i-1) * XAVGCi.1) / (i+1))) / (i+1))) / (i+1) - (2 * O + (j-1) * ((2 * O + (j-1) * ((2 * O + (j-1) * XAVGCj.1) / (j+1))) / (j+1))) / (j+1)
(ii)
(3 * O + (i-3) * AVGC(i-3).1) / i - (3 * O + (j-3) * AVGC(j-3).1) / j
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Please write the following for me:
(1) a formula that will send alert when the exponential moving average XAVGCi,j reaches a fresh low within the past 52 period and the price has not reach its fresh low
(2) (1) a formula that will send alert when the exponential moving average XAVGCi,j reaches a fresh high within the past 52 period and the price has not reach its fresh high
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Note that an EMA only has one period, not two, so I am only using XAVGCi and not XAVGCi,j in the following responses.
(1)
XAVGCi < MIN(XAVGCi.1,51) AND L > MINL52
(2)
XAVGCi > MAX(XAVGCi.1,51) AND H < MAXH52
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Thank you bruce
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
please rewrite your post on Friday, August 12, 2016 8:50:58 AM at open.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
(1)
(2 * O + (i-1) * XAVGCi.1) / (i+1) < MIN(XAVGCi.1,51) AND O > MINL51.1
(2)
(2 * O + (i-1) * XAVGCi.1) / (i+1) > MAX(XAVGCi.1,51) AND O < MAXH51.1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Assuming the next three future bars (A ,B and D) open at a value equal to the current price C, write the
(i) formula for the exponential MACDi,j at the open of the third future bar D.
(ii)formula for the simple MACDi,j at the open of the third future bar D.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
(i)
(2 * C + (i-1) * ((2 * C + (i-1) * ((2 * C + (i-1) * XAVGCi) / (i+1))) / (i+1))) / (i+1) - (2 * C + (j-1) * ((2 * C + (j-1) * ((2 * C + (j-1) * XAVGCj) / (j+1))) / (j+1))) / (j+1)
(ii)
(3 * C + (i-3) * AVGC(i-3)) / i - (3 * C + (j-3) * AVGC(j-3)) / j
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
QUOTE (Bruce_L)
Note that an EMA only has one period, not two, so I am only using XAVGCi and not XAVGCi,j in the following responses.
(1)
XAVGCi < MIN(XAVGCi.1,51) AND L > MINL52
(2)
XAVGCi > MAX(XAVGCi.1,51) AND H < MAXH52
Please write a formua for the highest absolute value reached by the exponential macdi,j over the past 480bars
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There isn't a way to write this in TC2000. We could write a pseudo formula.
MAX(ABS(XAVGCi - XAVGCj),480)
But that formula won't actually work even if you substitute in numbers for i and j.
We could use the following technique out to 32 bars, but the formulas would be way too long and slow to be practical when extended out to 480 bars.
Min Max PCFs
The best option would be to add Donchian Channels to the following Custom PCF Indicator (with numerical values substituted for i and j).
XAVGCi - XAVGCj
But even in that case, there might not be enough data to calculate the indicator (since there are only 500 bars of data in any given time frame available in TC2000 v12/v16).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
what is the highest number of bars to use in the Donchian Channels to get accurate MAX(ABS(XAVGCi - XAVGCj) ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There really isn't a fixed number. Assuming j is longer than i then it would probably be something along the lines of 500 - 5 * j. That said, you might try reducing 5 to something smaller to see if it is close enough for what you need.
If you were using simple averages instead of exponential, you could probably just use 500 - j or maybe 499 - j.
The problem with the exponential moving average is that it takes a while for there to be enough data for the value of the exponential moving average to be "accurate" (with accurate being defined as being "very close" to the value that it would have with infinite history instead of finite history).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Please repeat (i) and (ii) of your post on
Tuesday, June 14, 2016 1:42:41 PM and
Wednesday, June 29, 2016 3:00:44 PM
at 1 bar ago.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm not sure what you are asking.
Do you want the MACD at the open of the current bar if it opened at the close of the previous bar instead of the current bar?
Do you want the MACD at the open of the next future bar but if the current bar closes at the close of the previous bar and the next future bar opens at the close of the previous bar?
Something else?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
you got it right Bruce
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
In addition please write for me the value of RSI14 at open
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The following Indicator Formula for RSI14 at open assumes you mean the plain RSI without Wilder's smoothing that would be represented by RSI14 in the Personal Criteria Formula Language.
100 * ((O > C1) * (C1 - O) + (C1 > C2) * (C2 - C1) + (C2 > C3) * (C3 - C2) + (C3 > C4) * (C4 - C3) + (C4 > C5) * (C5 - C4) + (C5 > C6) * (C6 - C5) + (C6 > C7) * (C7 - C6) + (C7 > C8) * (C8 - C7) + (C8 > C9) * (C9 - C8) + (C9 > C10) * (C10 - C9) + (C10 > C11) * (C11 - C10) + (C11 > C12) * (C12 - C11) + (C12 > C13) * (C13 - C12) + (C13 > C14) * (C14 - C13)) / (ABS(O - C1) + ABS(C1 - C2) + ABS(C2 - C3) + ABS(C3 - C4) + ABS(C4 - C5) + ABS(C5 - C6) + ABS(C6 - C7) + ABS(C7 - C8) + ABS(C8 - C9) + ABS(C9 - C10) + ABS(C10 - C11) + ABS(C11 - C12) + ABS(C12 - C13) + ABS(C13 - C14) + .00001)
While the following version uses a Wilder's RSI with Wilder's smoothing.
50 * (O - XAVGC27.1) / 14 / (.071435345 * (ABS(O - C1) + 13 / 14 * (ABS(C1 - C2) + 13 / 14 * (ABS(C2 - C3) + 13 / 14 * (ABS(C3 - C4) + 13 / 14 * (ABS(C4 - C5) + 13 / 14 * (ABS(C5 - C6) + 13 / 14 * (ABS(C6 - C7) + 13 / 14 * (ABS(C7 - C8) + 13 / 14 * (ABS(C8 - C9) + 13 / 14 * (ABS(C9 - C10) + 13 / 14 * (ABS(C10 - C11) + 13 / 14 * (ABS(C11 - C12) + 13 / 14 * (ABS(C12 - C13) + 13 / 14 * (ABS(C13 - C14) + 13 / 14 * (ABS(C14 - C15) + 13 / 14 * (ABS(C15 - C16) + 13 / 14 * (ABS(C16 - C17) + 13 / 14 * (ABS(C17 - C18) + 13 / 14 * (ABS(C18 - C19) + 13 / 14 * (ABS(C19 - C20) + 13 / 14 * (ABS(C20 - C21) + 13 / 14 * (ABS(C21 - C22) + 13 / 14 * (ABS(C22 - C23) + 13 / 14 * (ABS(C23 - C24) + 13 / 14 * (ABS(C24 - C25) + 13 / 14 * (ABS(C25 - C26) + 13 / 14 * (ABS(C26 - C27) + 13 / 14 * (ABS(C27 - C28) + 13 / 14 * (ABS(C28 - C29) + 13 / 14 * (ABS(C29 - C30) + 13 / 14 * (ABS(C30 - C31) + 13 / 14 * (ABS(C31 - C32) + 13 / 14 * (ABS(C32 - C33) + 13 / 14 * (ABS(C33 - C34) + 13 / 14 * (ABS(C34 - C35) + 13 / 14 * (ABS(C35 - C36) + 13 / 14 * (ABS(C36 - C37) + 13 / 14 * (ABS(C37 - C38) + 13 / 14 * (ABS(C38 - C39) + 13 / 14 * (ABS(C39 - C40) + 13 / 14 * (ABS(C40 - C41) + 13 / 14 * (ABS(C41 - C42) + 13 / 14 * (ABS(C42 - C43) + 13 / 14 * (ABS(C43 - C44) + 13 / 14 * (ABS(C44 - C45) + 13 / 14 * (ABS(C45 - C46) + 13 / 14 * (ABS(C46 - C47) + 13 / 14 * (ABS(C47 - C48) + 13 / 14 * (ABS(C48 - C49) + 13 / 14 * (ABS(C49 - C50) + 13 / 14 * (ABS(C50 - C51) + 13 / 14 * (ABS(C51 - C52) + 13 / 14 * (ABS(C52 - C53) + 13 / 14 * (ABS(C53 - C54) + 13 / 14 * (ABS(C54 - C55) + 13 / 14 * (ABS(C55 - C56) + 13 / 14 * (ABS(C56 - C57) + 13 / 14 * (ABS(C57 - C58) + 13 / 14 * (ABS(C58 - C59) + 13 / 14 * (ABS(C59 - C60) + 13 / 14 * (ABS(C60 - C61) + 13 / 14 * (ABS(C61 - C62) + 13 / 14 * (ABS(C62 - C63) + 13 / 14 * (ABS(C63 - C64) + 13 / 14 * (ABS(C64 - C65) + 13 / 14 * (ABS(C65 - C66) + 13 / 14 * (ABS(C66 - C67) + 13 / 14 * (ABS(C67 - C68) + 13 / 14 * (ABS(C68 - C69) + 13 / 14 * (ABS(C69 - C70) + 13 / 14 * (ABS(C70 - C71) + 13 / 14 * (ABS(C71 - C72) + 13 / 14 * (ABS(C72 - C73) + 13 / 14 * (ABS(C73 - C74) + 13 / 14 * (ABS(C74 - C75) + 13 / 14 * (ABS(C75 - C76) + 13 / 14 * (ABS(C76 - C77) + 13 / 14 * (ABS(C77 - C78) + 13 / 14 * (ABS(C78 - C79) + 13 / 14 * (ABS(C79 - C80) + 13 / 14 * (ABS(C80 - C81) + 13 / 14 * (ABS(C81 - C82) + 13 / 14 * (ABS(C82 - C83) + 13 / 14 * (ABS(C83 - C84) + 13 / 14 * (ABS(C84 - C85) + 13 / 14 * (ABS(C85 - C86) + 13 / 14 * (ABS(C86 - C87) + 13 / 14 * (ABS(C87 - C88) + 13 / 14 * (ABS(C88 - C89) + 13 / 14 * (ABS(C89 - C90) + 13 / 14 * (ABS(C90 - C91) + 13 / 14 * (ABS(C91 - C92) + 13 / 14 * (ABS(C92 - C93) + 13 / 14 * (ABS(C93 - C94) + 13 / 14 * (ABS(C94 - C95) + 13 / 14 * (ABS(C95 - C96) + 13 / 14 * (ABS(C96 - C97) + 13 / 14 * (ABS(C97 - C98) + 13 / 14 * (ABS(C98 - C99) + 13 / 14 * (ABS(C99 - C100) + 13 / 14 * (ABS(C100 - C101) + 13 / 14 * (ABS(C101 - C102) + 13 / 14 * (ABS(C102 - C103) + 13 / 14 * (ABS(C103 - C104) + 13 / 14 * (ABS(C104 - C105) + 13 / 14 * (ABS(C105 - C106) + 13 / 14 * (ABS(C106 - C107) + 13 / 14 * (ABS(C107 - C108) + 13 / 14 * (ABS(C108 - C109) + 13 / 14 * (ABS(C109 - C110) + 13 / 14 * (ABS(C110 - C111) + 13 / 14 * (ABS(C111 - C112) + 13 / 14 * (ABS(C112 - C113) + 13 / 14 * (ABS(C113 - C114) + 13 / 14 * (ABS(C114 - C115) + 13 / 14 * (ABS(C115 - C116) + 13 / 14 * (ABS(C116 - C117) + 13 / 14 * (ABS(C117 - C118) + 13 / 14 * (ABS(C118 - C119) + 13 / 14 * (ABS(C119 - C120) + 13 / 14 * (ABS(C120 - C121) + 13 / 14 * (ABS(C121 - C122) + 13 / 14 * (ABS(C122 - C123) + 13 / 14 * (ABS(C123 - C124) + 13 / 14 * (ABS(C124 - C125))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) + 50
I presented two options for the MACD in my Wednesday, September 21, 2016 2:46:26 PM ET post. These options should be entirely different. Which one is "right"?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
For clarity I will write the question:
(1)Assuming the current bar open at the price C1 of the close of the previous bar ,
write the formula for the MACD at the open of the current bar in terms of C1 and past exponential moving averages.
(2)Assuming the current bar open at the price C1 of the close of the previous bar and the price remain static at C1 and the next future bar also open at C1, write the formula for the MACD at the open of the next future bar in terms of C1 and past exponential moving averages.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
(1)
(2 * C1 + (i-1) * XAVGCi.1) / (i+1) - (2 * C1 + (j-1) * XAVGCj.1) / (j+1)
(2)
(2 * C1 + (i-1) * (2 * C1 + (i-1) * XAVGCi.1) / (i+1)) / (i+1) - (2 * C1 + (j-1) * (2 * C1 + (j-1) * XAVGCj.1) / (j+1)) / (j+1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Refering to my post on Wednesday, September 28, 2016 11:58:05 AM, i would like you to move the question (2) one step back as follows:
(a) 2 bars ago close at C2.Assuming the price remains at C2 till the open of the previous bar and the open of the current bar;
write the formula for the MACD at the open of the current bar in terms of C2 and past exponential moving averages.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If I'm understanding correctly, it should basically just the (2) formula from my Wednesday, September 28, 2016 12:58:27 PM ET post using C2 instead of C1 as the basis.
(2 * C2 + (i-1) * (2 * C2 + (i-1) * XAVGCi.2) / (i+1)) / (i+1) - (2 * C2 + (j-1) * (2 * C2+ (j-1) * XAVGCj.2) / (j+1)) / (j+1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
The "XAVGC2.1" in the formula should be "XAVGCi.2" isn`t it?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You are correct. Both of the XAVGCs should have been changed from .1 to .2.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Assuming the next future bar opens at a value equal to the current price C; write the
(i) RSIi at the open of the next future bar.
(i) RSI exponential histogram RSIi,k at the open of the next future bar.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Are you interested in the plain RSI without Wilder's smoothing or the Wilder's RSI with Wilder's smoothing?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
plain RSI
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
This isn't going to be all that helpful from a PCF standpoint because you would need to manually expand the moving averages.
(i)
100 * AVG(ABS(C > C1) * (C - C1),i-1) / AVG(ABS(C - C1),i-1)
(ii) This assumes the histogram is RSIi minus the j period moving average of RSIi.
100 * (AVG(ABS(C > C1) * (C - C1),i-1) / AVG(ABS(C - C1),i-1) - ((AVG(ABS(C > C1) * (C - C1),i-1) / AVG(ABS(C - C1),i-1) + (j-1) * AVG(AVG(ABS(C > C1) * (C - C1),i-1) / AVG(ABS(C - C1),i-1),j-1)) / j))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
I refer to your Tuesday, November 08, 2016 3:14:18 PM
I don't know how to expand the moving averages:please explain how to expand the moving averages and give examples using RSI50 for (i) and RSI50,20 for (ii)
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
So doing the manual expansions on RSI50 and RSI50,20 is just too long and slow to be practical. The exponential Histogram would be really bad even with short periods like RSI5,2.
This had me thinking about if there is a way to do this which would be shorter, and I think so. I am pretty sure the value of RSI50 at the next open if price stays at the current close would just be:
RSI49
Which would make the exponential RSI50,20 histogram the following at the open of the next bar if price stays at the current close.
RSI49 - (2 * RSI49 + 19 * XAVG(RSI50,20)) / 21
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Thank you bruce.
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Assuming the next two future bars (A and B) open at a value equal to the current price C, write the
(i) formula for the exponential histogram MACDi,j,k at the open of the second future bar B.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
(1 - (i - 1) / (i - k)) * (2 * C + (i - 1) * (2 * C + (i - 1) * XAVGCi) / (i + 1)) / (i + 1) + ((j - 1) / (j - k) - 1) * (2 * C + (j - 1) * (2 * C + (j - 1) * XAVGCj) / (j + 1)) / (j + 1) + ((k - 1) / (i - k) - (k - 1) / (j - k)) * (2 * C + (k - 1) * (2 * C + (k - 1) * XAVGCk) / (k + 1)) / (k + 1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Please write the following for me.All the formulas should contain the current open price and past exponential moving averages.
(i) Formula for exponential histogram MACDi,j,k at open
(ii) Assuming the price at current open remains static till the open of the next future bar
write the formula of exponential histogram MACDi,j,k at the open of the next future bar
(iii) Assuming the price at current open remains static till the open of the second future bar
write the formula of exponential histogram MACDi,j,k at the open of the second future bar
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (email2norman) (i) Formula for exponential histogram MACDi,j,k at open
(1 - (i - 1) / (i - k)) * (2 * O + (i - 1) * XAVGOi.1) / (i + 1) + ((j - 1) / (j - k) - 1) * (2 * O + (j - 1) * XAVGOj.1) / (j + 1) + ((k - 1) / (i - k) - (k - 1) / (j - k)) * (2 * O + (k - 1) * XAVGOk.1) / (k + 1)
QUOTE (email2norman) (ii) Assuming the price at current open remains static till the open of the next future bar
write the formula of exponential histogram MACDi,j,k at the open of the next future bar
(1 - (i - 1) / (i - k)) * (2 * O + (i - 1) * (2 * O + (i - 1) * XAVGOi.1) / (i + 1)) / (i + 1) + ((j - 1) / (j - k) - 1) * (2 * O + (j - 1) * (2 * O + (j - 1) * XAVGOj.1) / (j + 1)) / (j + 1) + ((k - 1) / (i - k) - (k - 1) / (j - k)) * (2 * O + (k - 1) * (2 * O + (k - 1) * XAVGOk.1) / (k + 1)) / (k + 1)
QUOTE (email2norman) (iii) Assuming the price at current open remains static till the open of the second future bar
write the formula of exponential histogram MACDi,j,k at the open of the second future bar
(1 - (i - 1) / (i - k)) * (2 * O + (i - 1) * (2 * O + (i - 1) * (2 * O + (i - 1) * XAVGOi.1) / (i + 1)) / (i + 1)) / (i + 1) + ((j - 1) / (j - k) - 1) * (2 * O + (j - 1) * (2 * O + (j - 1) * (2 * O + (j - 1) * XAVGOj.1) / (j + 1)) / (j + 1)) / (j + 1) + ((k - 1) / (i - k) - (k - 1) / (j - k)) * (2 * O + (k - 1) * (2 * O + (k - 1) * (2 * O + (k - 1) * XAVGOk.1) / (k + 1)) / (k + 1)) / (k + 1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/27/2013 Posts: 152
|
Please write the formula for the exponential Histogram MACDi,j,k at
(i) one bar ago
(ii) two bar ago
(iii) three bar ago
|
|
Guest-1 |