Welcome! Log In Create A New Profile

Get Earnings and Seasonal Trends - Subscribe Today!

Advanced

TOS CC

Posted by RichieRick 
TOS CC
April 08, 2014 03:00PM
Hi everyone,

I already know what the settings numbers are, but my concern with the CC in TOS may be off a bit. I know what the offset is, and what it should be. I think you will find that even though you enter the same numbers as you would in Qcharts, they still won't line up the same. Yes I know you are supposed to use a negative sign (-) in TOS. If anyone is currently using both Qcharts, and TOS could you please check it out, and let me know what you are seeing.

Maybe it's just me. Currently to get the CC i'm using 2 SimpleMovingAvg within TOS. Maybe I should be using a different indicator instead of 2 separate ones. You tell me.
Dan
Re: TOS CC
April 08, 2014 06:16PM
I'm using 2 SMA's for the CC and when I just checked TOS against QCharts, all my indicators are exactly identical between both platforms.

On a side note, even though I created a QChartsDMI indicator to exactly match TOS to the QCharts Directional Movement indicator, the one QCharts has is wrong. The DI+ and DI- values are correct, but the ADX value is always incorrect when used with the parameters GW gave us in class. To be fair, he told us not to use the ADX line, but I find it helpful. The only way the ADX value will be correct ( I am defining correct as the original which appeared in Welles Wilder's book "New Concepts in Technical Trading System"winking smiley.is if you use the same value for ADX as for DI+ and DI-; e.g. 5,5 or 13,13. Wilder always uses the same periods for calculating both DI+/DI- and ADX.

On another note, I give up on the Autowave indicator for TOS and TradeStation. I actually contacted the programmer who wrote it for QCharts and he told me he does not have any documentation on it. I cannot "reverse engineer" the algorithm for the ZigZag lines. You can come close with Sylvain Vervoort's ZigZag line indicators, some of which have been posted in message threads here. I plan to stick with drawing my own Fibonacci extensions at the right edge of my charts, and use them in conjunction with support/resistance lines.
Re: TOS CC
April 08, 2014 09:37PM
Thanks for checking Dan. I don't use the ADX part of the DMI just as GW said. I'll go give it a look see to determine if it changes anything. On the AutoWave though, the script the Robert posted a while back seems spot on to me. Best I can tell is it seems to mirror Qchart's autowave pretty darn well. Just to keep you from hunting for it, I'll post in the next post below :-) Just in case you haven't seen it.

R
Re: TOS CC
April 08, 2014 09:38PM
## START CODE
## ZigZagSign TOMO modification, v0.2 adapted from Thinkorswim ZigZagSign Script

input showBubbleschange = no;
def price = close;
def priceH = high; # swing high
def priceL = low; # swing low
def ATRreversalfactor = 3.2;
def ATR = ATRWilder("atr length" = 5);
def reversalAmount = ATRreversalfactor * ATR;
def displace = 1;

def barNumber = BarNumber();
def barCount = HighestAll(If(IsNaN(price), 0, barNumber));

rec state = {default init, undefined, uptrend, downtrend};
rec minMaxPrice;

if (GetValue(state, 1) == GetValue(state.init, 0)) {
minMaxPrice = price;
state = state.undefined;
} else if (GetValue(state, 1) == GetValue(state.undefined, 0)) {
if (price <= GetValue(minMaxPrice, 1) - reversalAmount) {
state = state.downtrend;
minMaxPrice = priceL;
} else if (price >= GetValue(minMaxPrice, 1) + reversalAmount) {
state = state.uptrend;
minMaxPrice = priceH;
} else {
state = state.undefined;
minMaxPrice = GetValue(minMaxPrice, 1);
}
} else if (GetValue(state, 1) == GetValue(state.uptrend, 0)) {
if (price <= GetValue(minMaxPrice, 1) - reversalAmount) {
state = state.downtrend;
minMaxPrice = priceL;
} else {
state = state.uptrend;
minMaxPrice = Max(priceH, GetValue(minMaxPrice, 1));
}
} else {
if (price >= GetValue(minMaxPrice, 1) + reversalAmount) {
state = state.uptrend;
minMaxPrice = priceH;
} else {
state = state.downtrend;
minMaxPrice = Min(priceL, GetValue(minMaxPrice, 1));
}
}

def isCalculated = GetValue(state, 0) != GetValue(state, 1) and barNumber >= 1;
def futureDepth = barCount - barNumber;
def tmpLastPeriodBar;
if (isCalculated) {
if (futureDepth >= 1 and GetValue(state, 0) == GetValue(state, -1)) {
tmpLastPeriodBar = fold lastPeriodBarI = 2 to futureDepth + 1 with lastPeriodBarAcc = 1
while lastPeriodBarAcc > 0
do if (GetValue(state, 0) != GetValue(state, -lastPeriodBarI))
then -lastPeriodBarAcc
else lastPeriodBarAcc + 1;
} else {
tmpLastPeriodBar = 0;
}
} else {
tmpLastPeriodBar = Double.NaN;
}

def lastPeriodBar = if (!IsNaN(tmpLastPeriodBar)) then -AbsValue(tmpLastPeriodBar) else -futureDepth;

rec currentPriceLevel;
rec currentPoints;
if (state == state.uptrend and isCalculated) {
currentPriceLevel =
fold barWithMaxOnPeriodI = lastPeriodBar to 1 with barWithMaxOnPeriodAcc = minMaxPrice
do Max(barWithMaxOnPeriodAcc, GetValue(minMaxPrice, barWithMaxOnPeriodI));
currentPoints =
fold maxPointOnPeriodI = lastPeriodBar to 1 with maxPointOnPeriodAcc = Double.NaN
while IsNaN(maxPointOnPeriodAcc)
do if (GetValue(priceH, maxPointOnPeriodI) == currentPriceLevel)
then maxPointOnPeriodI
else maxPointOnPeriodAcc;
} else if (state == state.downtrend and isCalculated) {
currentPriceLevel =
fold barWithMinOnPeriodI = lastPeriodBar to 1 with barWithMinOnPeriodAcc = minMaxPrice
do Min(barWithMinOnPeriodAcc, GetValue(minMaxPrice, barWithMinOnPeriodI));
currentPoints =
fold minPointOnPeriodI = lastPeriodBar to 1 with minPointOnPeriodAcc = Double.NaN
while IsNaN(minPointOnPeriodAcc)
do if (GetValue(priceL, minPointOnPeriodI) == currentPriceLevel)
then minPointOnPeriodI
else minPointOnPeriodAcc;
} else if (!isCalculated and (state == state.uptrend or state == state.downtrend)) {
currentPriceLevel = GetValue(currentPriceLevel, 1);
currentPoints = GetValue(currentPoints, 1) + 1;
} else {
currentPoints = 1;
currentPriceLevel = GetValue(price, currentPoints);
}

def data = if (barNumber == barCount or barNumber == 1) then if state == state.uptrend then priceH else priceL else if (currentPoints == 0) then currentPriceLevel else Double.NaN;

rec zzSave = if !IsNaN(data) then if (barNumber == barCount or barNumber == 1) then if IsNaN(barNumber[-1]) and state == state.uptrend then priceH else priceL else currentPriceLevel else GetValue(zzSave, 1);

def chg = (if barNumber == barCount and currentPoints < 0 then priceH else if barNumber == barCount and currentPoints > 0 then priceL else currentPriceLevel) - GetValue(zzSave, 1);

def isUp = chg >= 0;

#Higher/Lower/Equal High, Higher/Lower/Equal Low
def xxhigh = if zzSave == priceH then round(high,2) else round(xxhigh[1],2);
def chghigh = Round(Round(high, 2) - Round(xxhigh[1], 2), 2);
def xxlow = if zzSave == priceL then round(low,2) else round(xxlow[1],2);
def chglow = Round(Round(low, 2) - Round(xxlow[1], 2), 2);

rec isConf = AbsValue(chg) >= reversalAmount or (IsNaN(GetValue(data, 1)) and GetValue(isConf, 1));

plot "ZZ$" = if isconf then data else double.nan;
"ZZ$".EnableApproximation();
"ZZ$".setdefaultcolor(color.cyan);

DefineGlobalColor("Unconfirmed", Color.WHITE);
DefineGlobalColor("Up", Color.UPTICK);
DefineGlobalColor("Down", Color.DOWNTICK);

AddChartBubble(showBubbleschange and !IsNaN("ZZ$" ) and barNumber != 1, if isUp then high else low , round(chg,2) , if isUp then GlobalColor("Up" ) else GlobalColor("Down" ), isUp);

## END CODE
Dan
Re: TOS CC
April 08, 2014 11:10PM
I loaded the script Robert posted and I agree that it is a close match to QCharts Autowave, especially on daily charts. I did some further testing of it on intraday charts and for 5 minute charts it no longer matched up with QCharts very well. I modified the script so I could play around with the ATR length and ATR reversal factors by setting them up as inputs, but I still could not come up with a close match on the 5 minute charts.
Re: TOS CC
April 08, 2014 11:59PM
Yeah the Autowave intra day stuff seemed a bit wishy-washy to me too. The daily was good though. Try adding the max amount of time available for the intra day charts and see if that helps.
I noticed also that when I switched from say a 1 year/daily to a 3 month/daily it changed the lines in a way that didn't match Qcharts anymore, so I switched back to the 1 year/daily. Same for the weekly. When I reduced down from the 3 year/weekly to the 1 year weekly it changed the lines in a way that didn't match up with Qcharts anymore. I don't have Qcharts anymore so I can test to see if the effect is the same with Qcharts.
Dan
Re: TOS CC
April 09, 2014 08:14AM
Richie,

I think the issue with QCharts Autowave is that we don't know in detail what algorithm was used to choose the high/low points. I know we have the "wave size" parameter, which is different than all other ZigZag studies I have seen. I feel like QCharts Autowave must be using some type of price change filter like other ZigZag studies, namely some combination of ATR, percentage price change, and an ATR reversal factor, but I could not get the original developer of Autowave to share any information with me. After researching how ZigZag studies work, I just cannot commit the time right now to try and accurately reverse engineer QCharts Autowave. Besides, I don't think it is that helpful of an indicator anyway, with apologies to Gary for deviating from his RTP instructions - hey, I also use volume, but then again so does Gary if you listen to his discussion of money flow index on the Denny's Sessions recordings.

-Dan
Sorry, only registered users may post in this forum.

Click here to login