Scanner wrong

Questions about MultiCharts and user contributed studies.
User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Scanner wrong

Postby tradingest » 23 Dec 2016

Hi friends,

my condition for the scanner is the following:

Code: Select all

Var:
LowerBB(0),
risk(0);

LowerBB = BollingerBand(C, 20,-2);

Condition12 = H < H[1] and L > L[1] and H[1] < H[2] and L[1] < L[2] and L[1] < LowerBB;

If Condition12
Then Begin
risk = ((H[1] - L[1])/H[1])*100;
plot1("Long","Trade",green);
plot2(risk,"rischio %",cyan);
plot3(L[1],"Exit",cyan);
End;
The stocks with resolution weekly below are wrong why?
Immagine 027.png
Immagine 027.png (16.12 KiB) Viewed 1295 times
Here is the chart for the first stock in the list above. Why the scanner is refers at the candle in the past. if the condition is gone I do not care.
Attachments
Immagine 028.png
Immagine 028.png (4.49 KiB) Viewed 1295 times

User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Re: Scanner wrong

Postby tradingest » 25 Dec 2016

somebody can you help me to resolve this problem?

User avatar
ABC
Posts: 631
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 356 times
Contact:

Re: Scanner wrong

Postby ABC » 26 Dec 2016

tradingest,

the scanner is not wrong, it does exactly what your code tells it to do.

When you set plot values they will be kept until you update them again. This means you will have to either remove them (using NoPlot) or set them to a different value when your Condition12 is no longer present.

Regards,

ABC

User avatar
JoshM
Posts: 2099
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1526 times
Been thanked: 1502 times
Contact:

Re: Scanner wrong

Postby JoshM » 26 Dec 2016

Do you have the same indicator settings on the chart as you use in the Scanner/Watchlist?

(Things like 'Update on every tick', 'Maximum number of bars a study references', and so on.)

User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Re: Scanner wrong

Postby tradingest » 26 Dec 2016

Do you have the same indicator settings on the chart as you use in the Scanner/Watchlist?
Yes. In My case L [1] is not lower at BBLower but I continue to see the signals.

User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Re: Scanner wrong

Postby tradingest » 26 Dec 2016

tradingest,

the scanner is not wrong, it does exactly what your code tells it to do.

When you set plot values they will be kept until you update them again. This means you will have to either remove them (using NoPlot) or set them to a different value when your Condition12 is no longer present.

Regards,

ABC
OK I try but if I write C <H [1] the signal is always present why?

User avatar
ABC
Posts: 631
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 356 times
Contact:

Re: Scanner wrong

Postby ABC » 26 Dec 2016

Because you set it when your condition is true, but never reset it. If you set the value of a variable within your conditional check "if Condition12 then begin..." it would keep this value until you change it again, too. It's similar for the plots in the Scanner, they will simply keep the last value you set them to.

Regards,

ABC

User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Re: Scanner wrong

Postby tradingest » 26 Dec 2016

Because you set it when your condition is true, but never reset it. If you set the value of a variable within your conditional check "if Condition12 then begin..." it would keep this value until you change it again, too. It's similar for the plots in the Scanner, they will simply keep the last value you set them to.

Regards,

ABC
Have you any suggestions to avoid this problem and capture the right signal using the scanner

User avatar
ABC
Posts: 631
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 356 times
Contact:

Re: Scanner wrong

Postby ABC » 26 Dec 2016

Yes, follow either of the two suggestions I posted here: viewtopic.php?p=124496#p124487

User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Re: Scanner wrong

Postby tradingest » 26 Dec 2016

Hi,

thank you for your suggestions but I don't understand all the scan process.
If I write condition14 = L < LowerBB, I want see only the stocks that has this condition in the currently candle and not previous candle.

I don't understand. Can you help me?

I write noPlot but doesn't work. Why?

User avatar
ABC
Posts: 631
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 356 times
Contact:

Re: Scanner wrong

Postby ABC » 26 Dec 2016

You might want to read about the NoPlot reserved word in the help file and wiki. If you are still having troubles after that, post the code modifications you made and I am sure someone is able to point you into the right direction.

Regards,

ABC

User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Re: Scanner wrong

Postby tradingest » 26 Dec 2016

Code: Select all

Var:
UpperBB(0),
LowerBB(0),
Length(20),
NumDevs(2),
risk(0);


UpperBB = BollingerBand(C, Length, NumDevs);
LowerBB = BollingerBand(C, Length, NumDevs*-1);


If H > UpperBB
then begin
risk = (H-L)/H*100;
plot10("Short","Short",red);
plot15(risk,"Rishio%",cyan);
plot20(H,"High",cyan);
end
else begin
NoPlot(0);
end;
I modified my code but there is anything that's wrong because for the SBUX stock should not see the plot because the current candle has H < upper band. Why happen this?

User avatar
ABC
Posts: 631
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 356 times
Contact:

Re: Scanner wrong

Postby ABC » 26 Dec 2016

Follow the correct usage of "NoPlot" as described here and it should work:
https://www.multicharts.com/trading-sof ... php/NoPlot

User avatar
tradingest
Posts: 268
Joined: 05 Dec 2014
Location: Italy
Has thanked: 48 times
Been thanked: 3 times

Re: Scanner wrong

Postby tradingest » 26 Dec 2016

Hi ABC,

thanks for the support. I resolved my question but below I post other question always on scanner.

Why I don't see the value for some symbols?
Immagine 030.png
Immagine 030.png (24.13 KiB) Viewed 1233 times
thanks for valuable suggestions


Return to “MultiCharts”