Unable to align Scanner results

Nick

Active member
2019 Donor
VIP
Hi, from the FB chart, i noticed that there two Arrows being plotted( the conditions are met based on the script) but when i run the scanner with the script for the ARROWS, I am unable to get the stock FB from the scanner,

Tried to troubleshoot and like to check if my understanding on the scanner is correct.
1. The scanner will only display those stocks when ALL 3 criteria are met, in this case, FB did not meet one of the criteria and there is no result produced for FB

2. If there is no scan results for FB being produced, there should not be any ARROWs plotted on the chart.

So where are the errors?

Proposed corrections to be made
1. Add all 3 criteria into the ARROW script in order to align the scan results??

2. Add another condition group into the scanner to separate one of the condition? Not too sure how this work.

miaPwq4.jpeg


Thanks
 

rad14733

Well-known member
VIP
@Nick In addition to @BenTen's request, it would help if you were to post the Study script that is generating the arrows in question on your chart... The more information we have, the better we can assist you...
 

Nick

Active member
2019 Donor
VIP
It's impossible for us to help if you don't list out those conditions or provide the script that you're using in your scanner.
@BenTen @rad14733

Thanks for the prompt response. My bad, I have forgotten to attach the pics and added the scripts in.

Code:
#This is the script for the Arrows to be plotted

plot Trend1 = MovAvgExponential(close, 10);
Trend1.AssignValueColor(if close > Trend1 then Color.GREEN else Color.RED);
trend1.setLineWeight(2);
plot Trend2 = MovAvgExponential(close, 30);
Trend2.AssignValueColor(if close > Trend2 then Color.GREEN else Color.RED);
#########################################################################
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.WEEK;
def o = open(period = agg);
def c = close(period = agg);
def data = fold i = 0 to length
           with s
           do s + (if c > GetValue(o, i)
                   then 1
                   else if c < GetValue(o, i)
                        then - 1
                        else 0);
def EMA5 = ExpAverage(data, calcLength);
def Main = ExpAverage(EMA5, smoothLength);
def Signal = ExpAverage(Main, smoothLength);
def ob = if IsNaN(c) then Double.NaN else Round(length * 0.72);
def os = if IsNaN(c) then Double.NaN else -Round(length * 0.1);

plot Arrow_Up = Main < os and Main crosses above Signal and close>trend1;
Arrow_Up.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Arrow_Up.SetLineWeight(3);
Arrow_Up.AssignValueColor(Color.BLUE);
##########################################################
def Price2MA=MovAvgExponential(close,10);
def Condition1 = Close>Price2MA;
input length2 = 14;
input over_sold = -100;
input over_bought = 100;
def price = close + low + high;
def linDev = LinDev(price, length2);
def CCI = if linDev == 0 then 0 else (price - Average(price, length2)) / linDev / 0.015;
def ZeroLine = 0;
def condition2=CCI crosses above zeroline;

Plot Signal_2= condition1 and condition2;
Signal_2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Signal_2.SetLineWeight(5);
Signal_2.AssignValueColor(Color.White);
#End

Chart with arrows

Scanner setup

In this scanner setup, the two conditions that I have added are

Mark Minervini Trend template from this post,
https://usethinkscript.com/threads/mark-minervini-trend-template-thinkorswim-scanner.563/post-26623

and the other condition is

Code:
def conditionOne = Average(close, 7) / Average(close, 65) >= 1.05;
plot x = conditionOne;

Both of these scripts are included in the scanner together with the script for the Arrows to be plotted as shown above

I did a test, and when I removed the Mark Minervini trend condition, and did another scan, FB is able to be scanned out.

I am not sure if I should add the Mark Minervini script into the script for the arrows to be plotted?

Request some help.
Thanks
 

Similar threads

Top