Scanner  [SOLVED]

Questions about MultiCharts and user contributed studies.
plaforte
Posts: 75
Joined: 16 Aug 2012
Has thanked: 17 times
Been thanked: 2 times

Scanner

Postby plaforte » 21 Mar 2016

Hello, I have very limited programming experience. Here is what I am trying to do.

I did a basic indicator that allows me to set as "inputs" the resistance and support level at which the indicator triggers an alarm when price gets there. That works fine on a chart.

I want to follow with this indicator on 25 forex pairs Daily time frame, so obviously with different support and resistance levels. I thought the scanner was the best solution but if I am right I cannot set the same indicator with different inputs on different instruments, so I would have to create 25 versions of the same indicator, am I right ?

I don't need to have every tick, so should I use the pre-scanning with say every 15 minutes ? rather than having the scanner to check on every tick, I am concerned about the cpu time here.

Is it possible to apply an indicator on only one instrument in the scanner or is it automatically applied to all instruments ?

And a last question, I noted that when I double click on an indicator header in the scanner, there appears a little arrow up and down if I keep double clicking, what is this function ?

After spending the day to try to get it, I decided to ask these questions, sorry for the basic of this request

Thank you
Pierre

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Scanner

Postby TJ » 21 Mar 2016

::

I don't need to have every tick, so should I use the pre-scanning with say every 15 minutes ? rather than having the scanner to check on every tick,

I am concerned about the cpu time here.

::
Thank you
Pierre
Most of today's CPU run 4 cores 8 threads at 2.5+ giga hertz.

Do you know how many "0" (zero) in a giga?

plaforte
Posts: 75
Joined: 16 Aug 2012
Has thanked: 17 times
Been thanked: 2 times

Re: Scanner

Postby plaforte » 21 Mar 2016

Thank you TJ, I understand what you mean, then no need for pre-scanning. I was worried because I often find MC slow when I have many workspaces opened at the same time with many timeframes on each.

Best regards
Pierre

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Scanner  [SOLVED]

Postby JoshM » 21 Mar 2016

I want to follow with this indicator on 25 forex pairs Daily time frame, so obviously with different support and resistance levels. I thought the scanner was the best solution but if I am right I cannot set the same indicator with different inputs on different instruments, so I would have to create 25 versions of the same indicator, am I right ?
That's not necessarily. It's much easier to create one indicator that uses inputs, and then configure that same indicator multiple times.

If you add an indicator to the Watchlist/Scanner, you can right-click the cell with the indicator's value to see options: 'Format Study' and 'Format [script name] study for all instruments':

Image

If you choose the first option ('Format Study'), you can configure that indicator for that specific row of the Scanner. So if I clicked on 'Format Study' in the image above, I could configure the indicator's inputs only for GBP/USD.

This way an indicator can be configured differently for each row in the Scanner.
I don't need to have every tick, so should I use the pre-scanning with say every 15 minutes ? rather than having the scanner to check on every tick, I am concerned about the cpu time here.
With a study with a basic goal (from a CPU standpoint) like yours, there's no need to be concerned about CPU usage. That being said, I think it's a good practice to code scripts efficiently -- even if your hardware is more than fast enough.

In your case, you can add the instruments with a 15 minute resolution to the Scanner (like in the image above), and then use the BarStatus keyword to only calculate the script's code on bar close:

Code: Select all

if (BarStatus(1) = 2) then begin

// The code in this if statement is only
// executed on the close of the bar

end;
As I said above, for your current script this isn't needed. But for scripts that require more computer resources, `BarStatus()` is a very helpful keyword to use.
Is it possible to apply an indicator on only one instrument in the scanner or is it automatically applied to all instruments ?
An indicator in the Scanner is automatically applied to all instruments. If you have different lists of instruments (like stocks and futures), you can create two Watchlists/Scanners.

Alternatively, you can perform filtering in the script's code. For example, only calculating the indicator's values when the instrument is named "ES" or is listed at the "CME" exchange name. Keywords like SymbolName, Category, and ExchListed can be used for this.
And a last question, I noted that when I double click on an indicator header in the scanner, there appears a little arrow up and down if I keep double clicking, what is this function ?
That arrow performs sorting of the values.

For instance, sorting the 'FastAvg' values from high to low:

Image

Or sorting the values from low to high:

Image
After spending the day to try to get it, I decided to ask these questions, sorry for the basic of this request
No problem, we're here to help after all.
Attachments
low-to-high-scr.21-03-2016 14.43.27.png
(7 KiB) Downloaded 544 times
high-to-low-scr.21-03-2016 14.43.19.png
(6.22 KiB) Downloaded 541 times
2016-03-21_14-30-20.png
(14.57 KiB) Downloaded 544 times

plaforte
Posts: 75
Joined: 16 Aug 2012
Has thanked: 17 times
Been thanked: 2 times

Re: Scanner

Postby plaforte » 21 Mar 2016

Thank you very much Josh, that answers all my questions, I can now continue.

Best regards
Pierre


Return to “MultiCharts”