Jump to content
Medved Trader Forums

PB Placement with SetColorAndShape?


Jason

Recommended Posts

I understand that we can do something like this:

Okay can't post code here but I understand how to SetColorAndShape

But how do we set PBPlacement at Band on Bottom in conjunction with this? I've played around with it but can't seem to ferret out the correct syntax/usage.

Thank you

Edited by Jason
Link to comment
Share on other sites

The PB's SetColorAndShape sets, unsurprisingly, the color and shape at the particular candle.

Where to place that color and shape is not decided at the code level (unless you do SetYValue). At the time you place the paintbar on the chart, in its parameters, you specify where you want that paintbar to appear.

Link to comment
Share on other sites

Although it makes some sense, I was kind of afraid of that. I'm trying to combine multiple paint bars into a single scanner so that multiple PBs can be used simultaneously to scan a watchlist and I don't seem to have access to all of the parameters for each. Is there any workaround for setting the options uniquely for each paintbar?

Edited by Jason
Link to comment
Share on other sites

Actually just occurred to me that I can set the paintbars on the charts separately and not use any visual indicator for the scanner itself. Sorry, getting the concept of scanning mixed up with what's visible on the chart. Wouldn't doing setting up a scanner like that while having the same paintbars set up on many charts add quite a performance penalty?

Link to comment
Share on other sites

Scanning is pretty efficient. Past the initial setting up of the scan, as the data comes in, the scan calculation is done only for the last candle. The "problem" with scans is that each symbol has to, initially, recalculate a bit of candle data for itself (how much candle data depends on the indicators in the scan) and keep those candles and the indicator values around while it is running, thus using up some memory. But I know some MT users are running 1500 symbol RT scans with some quite complex code in them and MT seems to handle it ok.

Modern computers are pretty amazing in terms of performance. I started programming in the 70s. Computers changed quite a bit during the last 40 years or so.

And yes, same code can be used for scans and paintbars. We deliberately made it that way.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...