ATR Trailing watchlist column with bar count


Category:
0
0

Pete,

I need help creating watchlist column from the ATR trailing stop study with a red sell signal and green buy signal with counter.

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on March 20, 2025 1:12 pm
9 views
0
Private answer

Before approving this question I first had to update the title of your question and move it to the correct topic. Your original question used the title: "Creating Watchlist Column" and it was posted in the Frequently Asked Questions topic.

That's a great way for your question to be lost, in which case you would never receive the free solution you are seeking. Please consider this the next time you post a question in this forum.

input trailType = {default modified, unmodified};
input ATRPeriod = 5;
input ATRFactor = 3.5;
input firstTrade = {default long, short};
input averageType = AverageType.WILDERS;
def thisATR = ATRTrailingStop(trailType, ATRPeriod, ATRFactor, firstTrade, averageType).TrailingStop;
rec countBullish = if close < thisATR then 0 else countBullish[1] + 1; rec countBearish = if close > thisATR then 0 else countBearish[1] + 1;
AddLabel(yes, if close > thisATR then "Buy: " + countBullish else "Sell: " + countBearish, if close > thisATR then Color.GREEN else Color.RED);

Marked as spam
Posted by (Questions: 37, Answers: 4130)
Answered on March 20, 2025 1:17 pm