Anyone heard of the TrendTraderPRO indicator?

rad14733

Well-known member
VIP
Looks like smoothed Heikin Ashi to me...

 
Last edited by a moderator:

rad14733

Well-known member
VIP
@AspaTrader I hope that link isn't for a paid study from another site... This site has a policy against pirating (stealing) commercial code... If you've ever been a victim, as I have, you would understand why... Posting only a shared link raises suspicion...
 

AspaTrader

New member
2019 Donor
VIP
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, Average(open, period), open);
    closeMA = compoundValue(1, Average(close, period), close);
    highMA = compoundValue(1, Average(high, period), high);
    lowMA = compoundValue(1, Average(low, period), low);
case Exponential:
    openMA = compoundValue(1, ExpAverage(open, period), open);
    closeMA = compoundValue(1, ExpAverage(close, period), close);
    highMA = compoundValue(1, ExpAverage(high, period), high);
    lowMA = compoundValue(1, ExpAverage(low, period), low);
case Weighted:
    openMA = compoundValue(1, WMA(open, period), open);
    closeMA = compoundValue(1, WMA(close, period), close);
    highMA = compoundValue(1, WMA(high, period), high);
    lowMA = compoundValue(1, WMA(low, period), low);
Case Hull:
    openMA = compoundValue(1, HullMovingAvg(open, period), open);
    closeMA = compoundValue(1,  HullMovingAvg(close, period), close);
    highMA = compoundValue(1,  HullMovingAvg(high, period), high);
    lowMA = compoundValue(1,  HullMovingAvg(low, period), low);
case variable:
    openMA = compoundValue(1, VariableMA(open, period), open);
    closeMA = compoundValue(1, VariableMA(close, period), close);
    highMA = compoundValue(1, VariableMA(high, period), high);
    lowMA = compoundValue(1, VariableMA(low, period), low);
case TEMA:
    openMA = compoundValue(1, TEMA(open, period), open);
    closeMA = compoundValue(1, TEMA(close, period), close);
    highMA = compoundValue(1, TEMA(high, period), high);
    lowMA = compoundValue(1, TEMA(low, period), low);
}


hidePricePlot(hideCandles);

def haOpen;
def haClose;

switch(candleSmoothing) {
case Valcu:

    haOpen = CompoundValue(1, ( (haOpen[1] + (openMA[1] + highMA[1] + lowMA[1] + closeMA[1]) /4.0)/2.0), open);
    haClose = ((OpenMA + HighMA + LowMA + CloseMA)/4.0) ;
    
case Vervoort:
    haOpen = CompoundValue(1, ( (haOpen[1] + (openMA[1] + highMA[1] + lowMA[1] + closeMA[1]) /4.0)/2.0), open);
    haClose = ((((OpenMA + HighMA + LowMA + CloseMA)/4.0) + haOpen + Max(HighMA, haOpen) + Min(LowMA, haOpen))/4.0);

}

plot o = haopen;
o.hide();

def haLow =  min(lowMA, haOpen);
def haHigh = max(highMA,haOpen);

AddChart(high = haHigh, low  = haLow, open = o, close = haclose, type = ChartType.CANDLE, growColor = GlobalColor("RisingMA"), fallColor = GlobalColor("FallingMA"), neutralColor = color.gray);

def haopen1 = if haopen>haclose 
              then HAopen
              else double.nan;
def HAhigh1   = if haopen>=haclose 
              then hahigh
              else double.nan;
def HAlow1    = if haopen>=haclose 
              then halow
              else double.nan;
 
AddChart(high = haHigh1, low  = haLow1, open = haopen1, close = haclose, type = ChartType.CANDLE, growColor = GlobalColor("FallingMA"), fallColor = GlobalColor("RisingMA"), neutralColor = color.gray);

def BullishChange = if ( haclose - haopen ) >= 0 and ( haclose[1] - haopen[1] ) <= 0 then yes else no;

def BearishChange = if ( haclose - haopen ) <= 0 and ( haclose[1] - haopen[1] ) >= 0 then yes else no;



plot Bullish = BullishChange;
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Bullish.SetDefaultColor(Color.CYAN);
Bullish.SetLineWeight(2);

plot Bearish = BearishChange;
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_Down);
Bearish.SetDefaultColor(Color.CYAN);
Bearish.SetLineWeight(2);
 
Last edited:

Alkkkz

New member
VIP
@AspaTrader I appreciate your quick response, Aspatrader. You sure saved me $$$😁. Can you make a space between the candle and Heikin? It overlapped on each other. Another favor is, Can you change the color of the arrow when it's bearish, pls? Thanks.

 

AspaTrader

New member
2019 Donor
VIP
@Alkkkz You can configure it b y going to Studies -> Edit Studies -> Click on the Gear Icon of your saved study -> Plots -> Bullish/Bearish (Click on the colour to change to the required colour). For the gaps between the bars and HA, You can change the bar type to price line. (Settings -> Appearance -> Chart type -> Line)
 

Alkkkz

New member
VIP
Hi Aspa, I want to keep candle as it is with HA. I need a gap btw both? is there a way to change the color HA also? Thanks
 

Similar threads

Top