TI_MarketPulse Indicator MTF Request

S

shanc

New member
@Necr0sis Pls send a screenshot as I've shown below. Script works fine for me.

 
N

Necr0sis

New member
VIP
Mine looks identical. I see how this works now, sorry for the silly question.
I just looked at the code and noticed that I have to go by the color of the aggregation label. I thought it would write it all out (like Distribution, etc.)

I appreciate your time.
 
S

shanc

New member
Hehe. No worries @Necr0sis. Happens to every one of us. 😄. You have a great day.
 
L

liminal-rider

New member
Hello, I wish to add input to show or not show labels in the below script. Thanks.

Code:
input ChartBubblesOn = no;

input price = close;
input length = 10;

def tmp1 = if price > price[1] then price - price[1] else 0;
def tmp2 = if price[1] > price then price[1] - price else 0;
def d2 = sum(tmp1, length);
def d4 = sum(tmp2, length);
def cond = d2 + d4 == 0;
def ad3 = if cond then 0 else (d2 - d4) / (d2 + d4) * 100;
def coeff = 2 / (length + 1) * AbsValue(ad3) / 100;
def asd = compoundValue("visible data" = coeff * price + (if IsNaN(asd[1]) then 0 else asd[1]) * (1 - coeff), "historical data" = price
);
plot VMA = asd;
VMA.setDefaultColor(GetColor(0));

def vwma8 = sum(volume * close, 8) / sum(volume, 8);
def vwma13 = sum(volume * close, 13) / sum(volume, 13);
def vwma34 = sum(volume * close, 34) / sum(volume, 34);

def bullish = if vwma8 > vwma13 and vwma13 > vwma34 then 1 else 0;
def bearish = if vwma8 < vwma13 and vwma13 < vwma34 then 1 else 0;
def distribution = if !bullish and !bearish then 1 else 0;

AddLabel(yes, if bullish then "Stage: Acceleration" else if bearish then "Stage: Deceleration" else if close>=VMA then "Stage: Accumulation" else "Stage: Distribution", if bullish then color.orange else if bearish then color.blue else if close >=VMA then color.black else color.light_GRAY);

VMA.AssignValueColor(if bearish and close<= VMA then color.blue
else if bullish and close >= VMA then color.orange
else color.black);

def accumulationToAcceleration = if (bullish and close>=VMA) then 1 else 0;
AddChartBubble(ChartBubblesOn and accumulationToAcceleration and !accumulationToAcceleration[1], close, "Entering Acceleration", color.blue);

def distributionToDeceleration = if (bearish and close <= VMA) then 1 else 0;
AddChartBubble(ChartBubblesOn and distributionToDeceleration and !distributionToDeceleration[1], close, "Entering Deceleration", color.orange);
 
BenTen

BenTen

Administrative
Staff
VIP
@liminal-rider Look for the following snippet in the code:

Code:
AddLabel(yes, if bullish then "Stage: Acceleration" else if bearish then "Stage: Deceleration" else if close>=VMA then "Stage: Accumulation" else "Stage: Distribution", if bullish then color.orange else if bearish then color.blue else if close >=VMA then color.black else color.light_GRAY);

Remove it and add the following to the bottom of your script:

Code:
input labels = yes;
AddLabel(yes and labels, if bullish then "Stage: Acceleration" else if bearish then "Stage: Deceleration" else if close>=VMA then "Stage: Accumulation" else "Stage: Distribution", if bullish then color.orange else if bearish then color.blue else if close >=VMA then color.black else color.light_GRAY);
 

Similar threads

Top