TTM Trend for 10 bars


Category:
0
0

Trying to set up scan to search for TTM trend up for say 5-10 bars. Keep getting error: trying to self-assign a non-initialized rec: color after like 2 or 3 criteria…any help

Attachments:
Marked as spam
Posted by (Questions: 3, Answers: 2)
Asked on February 16, 2020 12:19 pm
195 views
0
Private answer

You can make a screenshot directly on your computer rather than taking a picture of your screen. Every modern computer includes this functionality. Google it. Then make sure whenever you post a screenshot you include the full view of whatever window or tool you are trying to work with. Data storage is cheap, so always include more detail then you think is required. There are details there that can answer questions you have not even thought to ask.

The reason I mention this up front is because your screenshot does nothing to help explain what is wrong with your attempt at building this scan using the Condition Wizard. So rather than provide a more direct answer the only thing I can do is to provide a custom code solution. I think you would have gained more from this if you had included the full screenshot so that I could explain exactly where you went wrong.

I am borrowing some code from a previous post: https://www.hahn-tech.com/ans/is-it-possible-to-add-custom-sounds-to-custom-study-chart-alerts-in-tos/

I've added a user input for the number of consecutive bars. Then I added a couple lines to run your scan.

input compBars = 6;
input paintBars = yes;
input consecutiveBars = 10;
def upTrend = TTM_Trend(compBars, paintBars).TrendUp;
def downTrend = TTM_Trend(compBars, paintBars).TrendDown;
# use this to scan for x consecutive uptrend bars
plot scan = Lowest(upTrend, consecutiveBars) > 0;
# use this to scan for x consecutive downtrend bars
plot scan = Lowest(downTrend, consecutiveBars) > 0;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 16, 2020 4:17 pm
0
Will do. Thanks for the input.
( at February 16, 2020 4:47 pm)