Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Indicat color plotting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Indicat color plotting

    Hello,

    I´m using the indicator from NinjaTraer SampleGetHighLowByTimeRange and added backcoloring in that range (and some calculations and plotting lines from this). Generally all works ok but sometimes the color (with opacity only 8) is hiding the bars (sc_A and sc_B). sc_C shows how it should work, and almost all charts are ok. But sometimes it does not plot ok and bars are not visible.

    What might be the reason for this stange behavior please?

    Thank you!
    Tony
    Attached Files

    #2
    Hello tonynt,

    You mentioned that a certain opacity sometimes does this, are you able to see that if you simply draw an object with that opacity? That would be to remove any other logic which may be adding to the drawing. The images otherwise appear that the opacity is not being set for those bars, how are you checking that the opacity was set?

    Please let me know if I may be of further assistance.




    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. I do not understand what you mean, sorry. How do I check that opacity was set. Its in the syntax I use as shown in the helpguide.
      I attach the indicator, its just a few lines.

      In the meantime I experience same behavior in NT8. It as plotting with brushes.blue and opacity nicely. Then I changed the dataseries and now one can not see the bars in that backcolored range good, its very difficult to see them.

      Thank you!
      Tony
      Attached Files

      Comment


        #4
        Hello tonynt,

        The rectangle you are drawing in this script will be created as a new rectangle for every new bar where that logic is met. You are overlaying many rectangles on top of each other creating less opacity each time. You would need to work out some kind of a tag for each new instance of the rectangle you want to draw so you can update the existing rectangle instead of drawing new ones each time.

        You can start by using something that changes less frequently like the start bar, that at least lets you see the opacity on some areas where it was previously not visible. But that is not a solution, you would need to review when you are calling the DrawRectangle and how many new rectangles you are making or updating. Just as an example when I ran the script, it produced two rectangles on the chart but overlaid 68 different named rectangles in those two locations.

        If you are seeing something different with NT8 please post a new question to the NT8 sub forums, if you are just doing the same type of task please check your logic before posting a new thread.

        Please let me know if I may be of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        41 views
        0 likes
        Last Post alifarahani  
        Working...
        X