TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum » General Discussions » TC2000 version 12 or 18 » MAX( XAVG( SGN( C*1.35<=XAVG(MINL500,21) ) )*C,3) .30)
Dear Bruce,
Can I write an indicator like this,
MAX( XAVG( SGN( C*1.35<=XAVG(MINL500,21) ) )*C,3) .30)
in TC2000 12.4 ?
Br,
Mike
No. The syntax as given would not be valid in any version of TC2000 as it would not allow the nested functions.
It would be theoretically possible to create valid syntax for this by manually expanded the 3-period exponential moving average and the 30-period MAX() function, but the resulting formula would be too long and slow to be practical.
Cascades of Moving Averages Min Max PCFs
In addition, while the resulting formula might work in TC2000 version 7 (albeit very slowly), it would not work at all in TC2000 version 12.4 because only the most recent 500 bars of data are available in any given time frame.
How should I write for the maximum value of the variable 《XAVG(C,30) 》 among the current and the past 29-periods?
Because you can use XAVGC30 instead of XAVG(C,30), I would used the following:
MAX(XAVGC30,30)
What should I write for the maximum value of the variable 《XAVG(C,30) 》 among the current and the past 29-periods?
got it. Tks.
I tried my self very hard, but failed to write an expression for VARG, as shown below.
Is there any way that I can write an indicator, VARG, as shown below.
It will be greatly appreciated for your guidance.
The biggest problem is that VARA ends up being a very long formula to the point of being too slow to be practical or post in the forums even on its own (and I tried some rather significant optimizations to try and shorten it and speed it up).
You end up needing to incorporate slightly different versions of VARA into a formula for VARG. So that that means VARG ends up being even longer and slower than VARA.
VARC isn't a particularly big problem.
100 * (ABS(L - L1) + ABS(L1 - L2) + ABS(L2 - L3)) / (ABS(L > L1) * (L - L1) + ABS(L1 > L2) * (L1 - L2) + ABS(L2 > L3) * (L2 - L3))
And you have come very close to what I had for an unexpanded VARA. Once we have VARA, we don't need anything above it. You appear to be missing the outer XAVG(,21) structure and I'm not quite sure if your factors or mine are correct (they don't match).
XAVG(XAVG((6.68*XAVG(MINL450,21)+6.64*XAVG(MINL250,21)+6.58*XAVG(MINL90,21)+3.464*(XAVG(MAXH450,21)+XAVG(MAXH250,21)+XAVG(MAXH90,21)))/36*1.738,21),21)
The problem is the nested 21-period exponential moving averages which go three deep. If the EMAs were different periods, then we could combine them in a way which does not require a manual expansion of the moving averages but that is not the case. This means substituting in the base items being averaged into something like:
(1/2)*(1-a)^3 *(1*2*C0+a *(2*3*C1+a *(3*4*C2+a *... *((k+1)*(k+2)*Ck+a *...)))...
Where C0, C1, C2 and Ck are bars ago versions of MAXH450, MAXH250, MAXH90, MINL450, MINL250 and MINL90. And we need to take this expansion out to 100+ bars in order for the approximation to converge on an accurate value.
Cascades of Moving Averages
And the calculation for VARA needs to be included in every comparison used to create VARD for every term. The manual expansion of the 3-period exponential moving average can probably be done using 15-20 terms, but that still means 15-20 copies of bars ago versions of VARA to create VARD.
Then VARF requires getting the highest value for VARD over 60 bars. The technique I've devised for this has only even been expanded out to 32 bars because anything longer is too long and slow to be practical even when we aren't trying to find the high of something as complicated as VARD. Just take a look at the following topic to see how quickly the formulas increase in size.
Min Max PCFs
And then VARG itself ends up being a 3-period exponential moving average as well which needs to incorporate 15-20 bars ago copies of VARD and VARF.
We could do this using something with a full programming language like the RealCode in StockFinder or in TC2000 if the XAVG(), AVG(), MIN() and MAX() functions could accept complex formulas as arguments instead of being limited to only taking one of the indicators built into the PCF Language as arguments, but as things stand, it is not possible to create a PCF for VARG in TC2000.
Is it possible that I can export data streams of TC2000 to Multicharts?
If I change VARA formula a little bit to 20-period, such as
VARA:=EMA((VAR7*3+VAR8*2+VAR9)/6*1.738,20)
then, can we have an executable indicator expression?
TC2000 version 7 has three methods of exporting data (Smart Export to TeleChart Version 3, MetaStock and Export to Text). I do not know if any of these export methods would allow Multicharts to use the data.
Exporting data to text format - comma, space or tab delimited
But TC2000 version 12.4 does not have the ability to export data for more than one symbol at a time.
To get a reasonably short formula for VARA, the periods for VAR1-6 would need to use one period, VAR7-9 would need to use a second period and VARA would need to use a third period. If one assumes those periods should be as close to 21 as possible, then the periods used would need to be 20, 21 and 22. It doesn't matter which periods you use for each as the order in which the moving averages are applied does not matter.
1.738 * (6.68 * (361 * XAVG(MINL450, 20) - 800 * XAVG(MINL450, 21) + 441 * XAVG(MINL450, 22)) + 6.64 * (361 * XAVG(MINL250, 20) - 800 * XAVG(MINL250, 21) + 441 * XAVG(MINL250, 22)) + 6.58 * (361 * XAVG(MINL90, 20) - 800 * XAVG(MINL90, 21) + 441 * XAVG(MINL90, 22)) + 3.464 * (361 * XAVG(MAXH450, 20) - 800 * XAVG(MAXH450, 21) + 441 * XAVG(MAXH450, 22) + 361 * XAVG(MAXH250, 20) - 800 * XAVG(MAXH250, 21) + 441 * XAVG(MAXH250, 22) + 361 * XAVG(MAXH90, 20) - 800 * XAVG(MAXH90, 21) + 441 * XAVG(MAXH90, 22))) / 72
This might be short enough to get us to be able to calculate VARD, but the formula for VARD would still be thousands of characters on its own.
And even if we could shorten that considerably, it doesn't get us to the point of being able to calculate VARF (which is required for VARG).
Tks for the guidance.
Pls instruct me the detailed procedure of exporting data from TC2000 version 12.4.
There should be an Export Chart Data icon at the top of the chart in TC2000 version 12.4. It looks like two small stacks of silver coins. Clicking on the Export Chart Data icon will bring up a window with a list of indicators on that chart which can be checked and unchecked. Clicking on the Export button in that window will export all of the data for the checked indicators for the active symbol currently being used for those indicators on the chart.
As noted in my previous response, Tc2000 version 12.4 does not have the ability to export data for more than one symbol at a time.
I can not find the icon for exporting chart data. Do you mind sending me a figure showing the icon's position?
Also, any plan or schedule for TC2000.12 to be able to incorporate the arguments of complex functions?
I think I found the icon.
I am happy to read you were able to find the icon on your own.
I really couldn't say without knowing more about "BARSnumber". Almost all of the syntax in the Personal Criteria Formula Language has a bars ago parameter. So if "BARSnumber" is the number of bars ago of interest, then you could use that number in the syntax.
For example, if r = 10 and r is the number of bars ago, then my bust guess at:
((Cr-MINLr.5)/(MAXCr.5-MINLr.5))*100
Would be:
(C10 - MINL5.10) / (MAXC5.10 - MINL5.10) * 100
And my best guess at C2 would be:
(C10 ^ 2) / C
My best guess at CR would be:
(C10 ^ 2) / (C ^ 2)
And my best guess at LR would be:
(C10 ^ 2) / C / H
PCF Formula Descriptions Handy PCF example formulas to help you learn the syntax of PCFs!
[the definition , BarNumber is an EL function that allows you to determine the number of the bar that is currently being calculated.Starting with the first calculation bar after MaxBarsBack, each bar is assigned a number starting at 1.]
Cs is the value of C of BARSnumber-1 bars ago.
Cr and Lr are variables , defined by
Cr=Cs^2/C
Lr=Cs^2/H
I like to calculate the formula as follows
He is a Platinum member, could this be achieved in Stockfinder
It seems the following formula is not accepted by TC. How should I modify it?
( (C'01/03/2013' * C'01/03/2013' / C-MIN( C'01/03/2013' * C'01/03/2013' / H , 5) )/( MAX( C'01/03/2013' * C'01/03/2013' / C , 5 )-MIN( C'01/03/2013' * C'01/03/2013' / H , 5) ) )*100
wwrightjuly4, New TC2000 Platinum subscriptions no longer provide access to StockFinder Gold.
mcwang2012, The MIN() and MAX() functions do not accept compound formulas or other functions as arguments. There is no good way to modify the formula.
If I can use 330, instead of 450, in the following formula. Is that possible that we can write the formula for VARG?
----------------------------------------------
There is no significant difference in the formula when switching from 450 to 330 in the formulas. In fact, the formulas would theoretically be exactly the same length (although if the resulting formulas were possible, the 330 version would probably calculate more quickly than the 450 version).