Jump to content
Medved Trader Forums

Setline to background


Recommended Posts

I put a # of horizontal lines on my chart and have them all is individual indicators so far (putting a line at 100, 50, etc).

I was working to convert them all into one indicator using setline but they all seem to be in the foreground; in front of the chart.   Is there any way to set them to the background?   So far the paintbar option to put it in the background seems to not impact the setline itself.

Also, one other question..   I'd like to draw a line at certain market caps - like 1B market cap or 100M market cap.   Can I use SystemData.SharesOustanding in my line formula?   For instance if I said to draw a line at 50000/SystemData.SharesOutstanding what that draw a line at $50B market cap?    (Note I wasn't sure if the SharesOutstanding was in millions or not).

Thanks

Edited by mlsignups
Link to comment
Share on other sites

Fore/background - no unfortunately not. The line is drawn on the chart "overlay" - a transparent panel over the chart. The reason for this is that the chart has to be allowed to change under the line. For efficiency's sake, MT's charts do not redraw the whole chart unless a new candle is drawn. When the current candle is updated, only the small vertical slice of the chart on the right containing the candle is redrawn.

With indicators and regular paintbars that is no problem since whatever changes is also in that vertical slice and gets redrawn. But the SetLine lines may change over the whole chart, there is no restriction for that, so they cannot be drawn on the chart itself. They are instead drawn on the transparent overlay.

This efficient drawing algorithm allows MT to handle massive number of simultaneous charts without overloading the computer.

As for Shares Outstanding - try :) I think the shares outstanding is just a number.

Link to comment
Share on other sites

Thanks.   When I set to 1 wide and a light color it doesn't get in the way too much being in the foreground.

And yes the shares outstanding calc worked, although it wasn't in millions so I had to use the entire number.     Thanks

To draw a line is it possible to know a candle number based on an event in the chart.  For instance, if I want to say - draw a line from the last day the stock was up 5% I can build an indicator that looks for that situation....but is there a way to know the candle # so I can make that the starting point in the setline?

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.

 Share

×
×
  • Create New...