Jump to content
Medved Trader Forums
Jason

Problem with Simple Crossover Paintbar

Recommended Posts

I am trying to create a paintbar that will highlight a candle that crosses over a pivot point level. This is the code I have:



My intent is for only the candle that is overlapping the PP level to be identified. What seems to be happening is that once a candle has closed over (or above) the R1 level many (but not all) candles that close above it will also be highlighted. And vice versa after the close of the first candle below the S1. This is happening without much rhyme or reason regardless of whether or not the PP level was ever within the candle's range. I've tried experimenting with CurrentCandle without finding any traction on this.

Share this post


Link to post
Share on other sites

Here is the code:

 

public void MainCalculation()

{

          if (Close.CrossesUp(PP_R1, 0))

          {

               SetColorAndShape("Crossover", PBShape.Fill, SysColor.Positive);

          }

          if (Close.CrossesDown(PP_S1, 0))

          {

              SetColorAndShape("Crossover", PBShape.Fill, SysColor.MainIndicator3);

           }

}

Share this post


Link to post
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...