TrendTraderPRO Indicator for ThinkorSwim

Alkkkz

New member
VIP
I'm looking for the TrendTraderPro script for ThinkorSwim. Is there anyone who has it and tested it?

home1-1.png
 
Solution
Code:
# TS_HeikinAshiSmoothed
# http://www.thinkscripter.com
# [email protected]
# Last Update 30 June 2013

### YOU MUST HAVE THE STYLE SETTING FIT STUDIES ENABLED ###
#hint: The style setting Fit Studies must be enabled tou use these bars.

input period = 21;
input hideCandles = NO;
input candleSmoothing = {default Valcu, Vervoort};

DefineGlobalColor("RisingMA", color.uptick);
DefineGlobalColor("FallingMA", color.downtick);
#DefineGlobalColor("RisingMA", color.cyan);
#DefineGlobalColor("FallingMA", color.yellow);

input movingAverageType = {default TEMA, Exponential, Weighted, Hull, Variable, SIMPLE};

def openMA;
def closeMA;
def highMA;
def lowMA;

switch (movingAverageType) {
case Simple:
    openMA = compoundValue(1...

rad14733

Well-known member
VIP
Hi - thank you for your comment - could you elaborate as to why this is better than the HA code posted at the beginning of this thread?

@MatthewTherrien That would be up to you to decide... What I can say is that the code in the other topic is still actively being improved, unlike the code in the first post which is dated from 2013... Read both topics from beginning to end, perhaps test both HA scripts, and decide for yourself... Don't take our opinion, form your own... After all, it'll be your money at risk...
 
@MatthewTherrien That would be up to you to decide... What I can say is that the code in the other topic is still actively being improved, unlike the code in the first post which is dated from 2013... Read both topics from beginning to end, perhaps test both HA scripts, and decide for yourself... Don't take our opinion, form your own... After all, it'll be your money at risk...
Thank you for your reply. I have read both threads completely and take your point about the newer HA still being improved - I will continue to test the Completed HA Indicator you reference

 

mas429

New member
I've read in another thread altogether under usethinkscript.com where you, @BonBon and others re-created the TrendTraderPro indictors for trading. I can't seem to get any of that code work right. Would it be possible to get a copy of the scripts to make it look similar to the picture shown above? I'm just asking. If not, I understand.
Thanks,
 

BonBon

Active member
VIP
I've read in another thread altogether under usethinkscript.com where you, @BonBon and others re-created the TrendTraderPro indictors for trading. I can't seem to get any of that code work right. Would it be possible to get a copy of the scripts to make it look similar to the picture shown above? I'm just asking. If not, I understand.
Thanks,
@MatthewTherrien its great you have success with this heikin_Ashi smoothed.

@mas429 @MatthewTherrien, I created my version of the HA after researching viable indicators and created the "Completed Heikin" thread to obtain feedback from members. It is a smoothed HA and is similar to other indicators. However, is also different. The script is complete. ( have completed all the backtesting and added additional updates (these are new based on my final research into ways of improving the indicator. The completed version has not been uploaded into thread).

@rad14733 is correct in noting that members should do their due diligence regarding the indicators used.

At this time the comments are closed within the thread as I found some members were more interested in copying the script after I completed each section rather than providing viable feedback etc.

post #134 has the most updated script. Hope this helps.
 
Anyone know how to create an indicator similar to Trend Trader Pro?

I was skeptical of their indicator, and then I had them send me screenshots of 25 ticker symbols I provided them with and the results were unbelievable! I could have made 10 - 20X more than I did on these trades had I had Trend Trader Pro to keep me in the trades longer. I wouldn't mind buying it, but it's $1,500 - $2,000!!! I'm probably being a cheapo, but that's a lot of money for an indicator.
 
If you made only $100/day with it, you'd get your money back in a month - so - not sure why you're hesitating.

But I'm curious why you're not buying, if you care to share
I'm hesitating because I've spent money on several indicators that backtest well, but perform horribly in the real-world. If there was a free trial or money back guarantee, I wouldn't hesitate at all, but I don't believe there is, since it's a digital product.
 

Pensar

Well-known member
VIP
@GetRichOrDieTrying A while back, I tried to duplicate the Trend Trader Pro indicator from pictures on their site. My conclusion was that it is simply two Donchian Channels and a version of the ATR Trailing Stop. You could easily compare those indicators to the screenshots you received and decide if the Trend Trader Pro is worth it. I myself would never pay that much for any indicator.

Edit: I might be referencing a different indicator that costs $1-2K. Still, no indicator is worth that much IMO. The indicators provided here for free at useThinkScript are far more than anyone could ever want or need to be successful.
 
Last edited:

rad14733

Well-known member
VIP
I'm hesitating because I've spent money on several indicators that backtest well, but perform horribly in the real-world. If there was a free trial or money back guarantee, I wouldn't hesitate at all, but I don't believe there is, since it's a digital product.

That's how the shysters' make money... They prey upon the unknowing by selling what looks great when backtesting because all of the bad trades have repainted away, leaving only ideal trades... We live and we learn - hopefully...
 

Ilya

New member
VIP
Exactly right. If you ever see an indicator that looks amazing on backtest it is repainting. There is no holy grail, there is no Santa Claus, there is no Easter bunny, and there is no Queen of England (Hal in Megamind).
 

Christopher84

Active member
VIP
Exactly right. If you ever see an indicator that looks amazing on backtest it is repainting. There is no holy grail, there is no Santa Claus, there is no Easter bunny, and there is no Queen of England (Hal in Megamind).
Can you qualify "amazing"? I am back testing an indicator right now that looks pretty good. It doesn't repaint. I get your point, but some strategies are bound to test well (maybe not "amazing").
 

Christopher84

Active member
VIP
That's how the shysters' make money... They prey upon the unknowing by selling what looks great when backtesting because all of the bad trades have repainted away, leaving only ideal trades... We live and we learn - hopefully...
Hey rad14733,
I need a nice healthy dose of measured pessimism. Mind if I bounce a question off of you regarding back testing strategies and results? I am currently back testing a strategy and the results seem really good. Just want to make sure I am not missing any potential pitfalls in my approach. Typically, if it seems too good to be true, it probably is. Just not sure where that threshold is, and more importantly if my approach is correct. My current strategy doesn't repaint (so that shouldn't be an issue). I posted my first results on the CC Candles on the Confirmation Candles thread. I set it up to trade 1 share on the day chart. Thank you for any insights.
 

rad14733

Well-known member
VIP
Hey rad14733,
I need a nice healthy dose of measured pessimism. Mind if I bounce a question off of you regarding back testing strategies and results? I am currently back testing a strategy and the results seem really good. Just want to make sure I am not missing any potential pitfalls in my approach. Typically, if it seems too good to be true, it probably is. Just not sure where that threshold is, and more importantly if my approach is correct. My current strategy doesn't repaint (so that shouldn't be an issue). I posted my first results on the CC Candles on the Confirmation Candles thread. I set it up to trade 1 share on the day chart. Thank you for any insights.

I'd be willing to review what you have if you like... Either here or via Discord...
 

Christopher84

Active member
VIP
I'd be willing to review what you have if you like... Either here or via Discord...
Sure! I'm not on Discord though. So far I am finding that it performs similarly to MA strategy on heavily trending stocks, and better on stocks that have choppy price action. The one hour chart seems to be where it's performing best. Here's the strategy code. Thanks for taking the time to look at this. I do appreciate it.
Code:
#(Consensus Confirmation) CC Candles V.1 
#Created 04/28/2021 by Christopher84
#Based off of the Confirmation Candles Study. Main difference is that CC Candles weigh factors of positive and negative price movement to create the Consensus_Level. The Consensus_Level is considered positive if above zero and negative if below zero. 

#Keltner Channel
declare upper;
def displace = 0;
input factorK = 2.0;
input lengthK = 20;
def price = close;
input averageType = AverageType.SIMPLE;
def trueRangeAverageType = AverageType.SIMPLE;
def BulgeLengthK = 150;
def SqueezeLengthK = 150;
def BulgeLengthK2 = 40;
def SqueezeLengthK2 = 40;
input BulgeLengthPrice = 75;
input SqueezeLengthPrice = 75;
input BulgeLengthPrice2 = 20;
input SqueezeLengthPrice2 = 20;


def shift = factorK * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), lengthK);
def averageK = MovingAverage(averageType, price, lengthK);
def AvgK = averageK[-displace];
def Upper_BandK = averageK[-displace] + shift[-displace];
def Lower_BandK = averageK[-displace] - shift[-displace];

def conditionK1 = price >= Upper_BandK;
def conditionK2 = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
def conditionK3D = price < Lower_BandK;
def conditionK4D = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);

def conditionK2L = (Upper_BandK[2] < Upper_BandK[1]) and (Lower_BandK[2] < Lower_BandK[1]);
def conditionK3L = (Upper_BandK[3] < Upper_BandK[2]) and (Lower_BandK[3] < Lower_BandK[2]);
def conditionK3 = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);

def BandwidthK = (Upper_BandK - Lower_BandK) / AvgK * 100;
def condition_BWKUP = BandwidthK[1] < BandwidthK;
def condition_BWKDOWN = BandwidthK[1] > BandwidthK;
def BulgeK = Highest(BandwidthK, BulgeLengthK);
def SqueezeK = Lowest(BandwidthK, SqueezeLengthK);
def BulgeK2 = Highest(BandwidthK, BulgeLengthK2);
def SqueezeK2 = Lowest(BandwidthK, SqueezeLengthK2);

plot BulgePrice = Highest(price, BulgeLengthPrice);
BulgePrice.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);
plot SqueezePrice = Lowest(price, SqueezeLengthPrice);
SqueezePrice.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);

plot BulgePrice2 = Highest(price, BulgeLengthPrice2);
BulgePrice2.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);
BulgePrice2.SetStyle(Curve.SHORT_DASH);
plot SqueezePrice2 = Lowest(price, SqueezeLengthPrice2);
SqueezePrice2.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);
SqueezePrice2.SetStyle(Curve.SHORT_DASH);

#MACD with Price
def fastLength = 12;
def slowLength = 26;
def MACDLength = 9;
input MACD_AverageType = {SMA, default EMA};
def MACDLevel = 0.0;

def fastEMA = ExpAverage(price, fastLength);
def slowEMA = ExpAverage(price, slowLength);
def Value;
def Avg;
switch (MACD_AverageType) {
case SMA:
    Value = Average(price, fastLength) - Average(price, slowLength);
    Avg = Average(Value, MACDLength);
case EMA:
    Value = fastEMA - slowEMA;
    Avg = ExpAverage(Value, MACDLength);
}
def Diff = Value - Avg;
def Level = MACDLevel;

def condition1 = Value[1] <= Value;
def condition1D = Value[1] > Value;

#RSI
def RSI_length = 14;
def RSI_AverageType = AverageType.WILDERS;
def RSI_OB = 70;
def RSI_OS = 30;

def NetChgAvg = MovingAverage(RSI_AverageType, price - price[1], RSI_length);
def TotChgAvg = MovingAverage(RSI_AverageType, AbsValue(price - price[1]), RSI_length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = 50 * (ChgRatio + 1);

def condition2 = (RSI[3] < RSI) is true or (RSI >= 80) is true;
def condition2D = (RSI[3] > RSI) is true or (RSI < 20) is true;
def conditionOB1 = RSI > RSI_OB;
def conditionOS1 = RSI < RSI_OS;


#MFI
def MFI_Length = 14;
def MFIover_Sold = 20;
def MFIover_Bought = 80;
def movingAvgLength = 1;
def MoneyFlowIndex = Average(MoneyFlow(high, close, low, volume, MFI_Length), movingAvgLength);
def MFIOverBought = MFIover_Bought;
def MFIOverSold = MFIover_Sold;

def condition3 = (MoneyFlowIndex[2] < MoneyFlowIndex) is true or (MoneyFlowIndex > 85) is true;
def condition3D = (MoneyFlowIndex[2] > MoneyFlowIndex) is true or (MoneyFlowIndex < 20) is true;
def conditionOB2 = MoneyFlowIndex > MFIover_Bought;
def conditionOS2 = MoneyFlowIndex < MFIover_Sold;

#Forecast
def na = Double.NaN;
def MidLine = 50;
def Momentum = MarketForecast().Momentum;
def NearT =  MarketForecast().NearTerm;
def Intermed = MarketForecast().Intermediate;
def FOB = 80;
def FOS = 20;
def upperLine = 110;

def condition4 = (Intermed[1] <= Intermed) and (NearT >= MidLine);
def condition4D = (Intermed[1] > Intermed) and (NearT < MidLine);
def conditionOB3 = Intermed > FOB;
def conditionOS3 = Intermed < FOS;
def conditionOB4 = NearT > FOB;
def conditionOS4 = NearT < FOS;


#Pivot Signals
def n = 20;
def ticks = 2.0;
def bnOK = BarNumber() > n;
def isHigher = fold i = 1 to n + 1 with p = 1 while p do high > GetValue(high, -i);
def HH = if bnOK and isHigher and high == Highest(high, n) then high else Double.NaN;
def isLower = fold j = 1 to n + 1 with q = 1 while q do low < GetValue(low, -j);
def LL = if bnOK and isLower and low == Lowest(low, n) then low else Double.NaN;
def PivH = if HH > 0 then HH else Double.NaN;
def PivL = if LL > 0 then LL else Double.NaN;

def UpPivotLow = !IsNaN(PivL);
#UpPivotLow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#UpPivotLow.SetLineWeight(4);
#UpPivotLow.SetDefaultColor(Color.GREEN);

def DownPivotHigh = !IsNaN(PivH);
#DownPivotHigh.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#DownPivotHigh.SetLineWeight(4);
#DownPivotHigh.SetDefaultColor(Color.RED);

def condition5 = !IsNaN(PivL);
def condition5D = !IsNaN(PivH);

#EMA_1
def EMA_length = 12;
def AvgExp = ExpAverage(price[-displace], EMA_length);

def condition6 = (price >= AvgExp) and (AvgExp[2] <= AvgExp);
def condition6D = (price < AvgExp) and (AvgExp[2] > AvgExp);

#EMA_2
def EMA_2length = 20;
def displace2 = 0;
def AvgExp2 = ExpAverage(price[-displace2], EMA_2length);

def condition7 = (price >= AvgExp2) and (AvgExp[2] <= AvgExp);
def condition7D = (price < AvgExp2) and (AvgExp[2] > AvgExp);

#DMI Oscillator
def DMI_length = 5;#Typically set to 10
input DMI_averageType = AverageType.WILDERS;
def diPlus = DMI(DMI_length, DMI_averageType)."DI+";
def diMinus = DMI(DMI_length, DMI_averageType)."DI-";
def Osc = diPlus - diMinus;
def Hist = Osc;
def ZeroLine = 0;

def condition8 = Osc >= ZeroLine;
def condition8D = Osc < ZeroLine;

#Trend_Periods
def TP_fastLength = 3;#Typically 7
def TP_slowLength = 4;#Typically 15
def Periods = Sign(ExpAverage(close, TP_fastLength) - ExpAverage(close, TP_slowLength));

def condition9 = Periods > 0;
def condition9D = Periods < 0;

#Polarized Fractal Efficiency
def PFE_length = 5;#Typically 10
def smoothingLength = 2.5;#Typically 5
def PFE_diff = close - close[PFE_length - 1];
def val = 100 * Sqrt(Sqr(PFE_diff) + Sqr(PFE_length)) / Sum(Sqrt(1 + Sqr(close - close[1])), PFE_length - 1);
def PFE = ExpAverage(if PFE_diff > 0 then val else -val, smoothingLength);
def UpperLevel = 50;
def LowerLevel = -50;

def condition10 = PFE > 0;
def condition10D = PFE < 0;
def conditionOB5 = PFE > UpperLevel;
def conditionOS5 = PFE < LowerLevel;


#Bollinger Bands PercentB
input BBPB_averageType = AverageType.SIMPLE;
def BBPB_length = 5;#Typically 20
def Num_Dev_Dn = -2.0;
def Num_Dev_up = 2.0;
def BBPB_OB = 100;
def BBPB_OS = 0;
def upperBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).UpperBand;
def lowerBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).LowerBand;
def PercentB = (price - lowerBand) / (upperBand - lowerBand) * 100;
def HalfLine = 50;
def UnitLine = 100;

def condition11 = PercentB > HalfLine;
def condition11D = PercentB < HalfLine;
def conditionOB6 = PercentB > BBPB_OB;
def conditionOS6 = PercentB < BBPB_OS;


#STARC Bands
def ATR_length = 15;
def SMA_lengthS = 6;
def multiplier_factor = 1.5;
def valS = Average(price, SMA_lengthS);
def average_true_range = Average(TrueRange(high, close, low), length = ATR_length);
def Upper_BandS = valS[-displace] + multiplier_factor * average_true_range[-displace];
def Middle_BandS = valS[-displace];
def Lower_BandS = valS[-displace] - multiplier_factor * average_true_range[-displace];

def condition12 = (Upper_BandS[1] <= Upper_BandS) and (Lower_BandS[1] <= Lower_BandS); 
def condition12D = (Upper_BandS[1] > Upper_BandS) and (Lower_BandS[1] > Lower_BandS); 

#Klinger Histogram
def Klinger_Length = 8;
def KVOsc = KlingerOscillator(Klinger_Length).KVOsc;
def KVOH = KVOsc - Average(KVOsc, Klinger_Length);
def condition13 = (KVOH > 0) and (KVOsc[1] <= KVOsc);
def condition13D = (KVOH < 0) and (KVOsc[1] > KVOsc);

#Projection Oscillator
def ProjectionOsc_length = 9;#Typically 10
def MaxBound = HighestWeighted(high, ProjectionOsc_length, LinearRegressionSlope(price = high, length = ProjectionOsc_length));
def MinBound = LowestWeighted(low, ProjectionOsc_length, LinearRegressionSlope(price = low, length = ProjectionOsc_length));
def ProjectionOsc_diff = MaxBound - MinBound;
def PROSC = if ProjectionOsc_diff != 0 then 100 * (close - MinBound) / ProjectionOsc_diff else 0;
def PROSC_OB = 80;
def PROSC_OS = 20;

def condition14 = PROSC > 50;
def condition14D = PROSC < 50;
def conditionOB7 = PROSC > PROSC_OB;
def conditionOS7 = PROSC < PROSC_OS;


#Trend Confirmation Calculator
#Confirmation_Factor range 1-15.
input coloredCandlesOn = yes;
def Confirmation_Factor = 3;
#Use for testing conditions individually. Remove # from line below and change Confirmation_Factor to 1.
#def Agreement_Level = condition1; 
def Agreement_LevelOB = 12;
def Agreement_LevelOS = 3;

def Agreement_Level = condition1 + condition2 + condition3 + condition4 + condition5 + condition6 + condition7 + condition8 + condition9 + condition10 + condition11 + condition12 + condition13 + condition14 + conditionK1 + conditionK2;

def Agreement_LevelD = (condition1D + condition2D + condition3D + condition4D + condition5D + condition6D + condition7D + condition8D + condition9D + condition10D + condition11D + condition12D + condition13D + condition14D + conditionK3D + conditionK4D);

def Consensus_Level = Agreement_Level - Agreement_LevelD;

def conditionChannel1 = Upper_BandK > price;
def conditionChannel2 = Lower_BandK < price;

def UP = (Consensus_Level >= 0);
def DOWN = (Consensus_Level < 0);

#AssignPriceColor(if coloredCandlesOn and UP then Color.LIGHT_GREEN else if coloredCandlesOn and DOWN then Color.RED else Color.CURRENT);

AddOrder(OrderType.BUY_TO_OPEN, condition = UP, price = open, 1, tickColor = GetColor(1), arrowColor = GetColor(1), name = "Long");
AddOrder(OrderType.SELL_TO_CLOSE, condition = DOWN, price = open, 1, tickColor = GetColor(2), arrowColor = GetColor(2), name = "Close");
 

rad14733

Well-known member
VIP
@Christopher84 It appears that your AddOrders are using the incorrect prices which may be why your results don't jive... If you look closely you will see that your entry and exit prices are not matching correctly, essentially buying and selling at sometimes non-existent prices... It's a common mistake and one that makes Strategies look a lot better than they should...

The whole Strategy concept using AddOrder frustrates me to no end... I was just chatting with a member on Discord about this today... The problem is that with Strategies the trades never take place until the next candle/bar from where they are triggered...

The crux of the matter is that let's say you are monitoring a stock and there is a moving average crossover and you then enter a trade... Well, with a Strategy you can't enter until the next candle so you could potentially miss a major portion of a price move, depending on timeframe... The only potential workaround would be to provide an actual price instead of relying on open or close price... I've even tried using hl2 but even that doesn't reflect live trading entry and exit, but that's the price I use when paper-trading on actual paper (actually a spreadsheet)...

I know, probably not what you wanted to hear...
 

Christopher84

Active member
VIP
@Christopher84 It appears that your AddOrders are using the incorrect prices which may be why your results don't jive... If you look closely you will see that your entry and exit prices are not matching correctly, essentially buying and selling at sometimes non-existent prices... It's a common mistake and one that makes Strategies look a lot better than they should...

The whole Strategy concept using AddOrder frustrates me to no end... I was just chatting with a member on Discord about this today... The problem is that with Strategies the trades never take place until the next candle/bar from where they are triggered...

The crux of the matter is that let's say you are monitoring a stock and there is a moving average crossover and you then enter a trade... Well, with a Strategy you can't enter until the next candle so you could potentially miss a major portion of a price move, depending on timeframe... The only potential workaround would be to provide an actual price instead of relying on open or close price... I've even tried using hl2 but even that doesn't reflect live trading entry and exit, but that's the price I use when paper-trading on actual paper (actually a spreadsheet)...

I know, probably not what you wanted to hear...
Thank you for taking a look at this. I had my suspicions that it wasn't correct. If I am understanding you correctly, its not the strategy itself that is the problem (necessarily), but more the means of executing it with the current construct of AddOrder, as well as, accurately measuring its historical performance for potential efficacy? That being the case, how would you suggest testing a strategy, pending it could actually be implemented in an effective manner?
 

rad14733

Well-known member
VIP
@Christopher84 As I've stated previously, I keep track of paper trade orders in a spreadsheet... At times I use the price from Active Trader where I would enter and exit, or use set Limits as my exits... Other times I use worst case scenario of using a candles high as the entry and the closing candles low... And other times I use hl2 for both entry and exit... I just haven't found a truly realistic method of backtesting using AddOrder... While paper trading takes longer, I feel that it is far more accurate from a real world perspective... EVen using Paper Trading isn't realistic due to how entry and exit orders are processed...
 

Similar threads

Top