Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Shadows created by DrawRegion

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

  • Harry
    replied
    Thank for your answer. I can use a workaround such as

    Code:
     
    if (rangeColor == Color.Transparent)
    opacity = 0;
    so it is no problem.

    Originally posted by NinjaTrader_Josh View Post
    Harry,

    Unfortunately development has informed me that is simply how .NET handles opacity on transparent colors.

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    Harry,

    Unfortunately development has informed me that is simply how .NET handles opacity on transparent colors.

    Leave a comment:


  • Harry
    replied
    I used the same opacity for three different colours, opacity was set to 5. I expected that transparent is transparent even with opacity 5!


    Originally posted by NinjaTrader_Bertrand View Post
    Harry, to add - what opacity's were you using for your rectangles drawn? My demo below in on 0.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Harry, to add - what opacity's were you using for your rectangles drawn? My demo below in on 0.
    Attached Files

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Hi Harry, I'm seeing the same here on a black background - will clarify why this is the case. Thanks

    Leave a comment:


  • Harry
    replied
    Not transparent

    Here is another example.

    I use the DrawRectangle() method to draw rectangles on my chart.

    Another problem is this. If I set one of the serialized colours to transparent via indicator dialogue box, the rectangles are not transparent at all. All other colours that I select show as expected. Please advise.
    Attached Files

    Leave a comment:


  • Harry
    replied
    Thanks for answering.

    Many Draw() methods need a clean up.

    -> had lots of issues with diamonds in NT 6.5., they were quick to add, but I had to wait several minutes to remove them
    -> many of them decorating the right margin of the chart
    -> speech bubble look of draw region
    -> rectangles cannot be taught to plot behind price

    I think it is not a great deal to improve this.

    Originally posted by NinjaTrader_Bertrand View Post
    Hi Harry - I'm sorry for the frustrations getting this to work the way you expected, we're checking into the issues you unfortunately stumbled upon on the way.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Hi Harry - I'm sorry for the frustrations getting this to work the way you expected, we're checking into the issues you unfortunately stumbled upon on the way.

    Leave a comment:


  • Harry
    replied
    Originally posted by NinjaTrader_Bertrand View Post
    Hi Harry, could reproduce an issue here with the Pivots call - we look into, thanks for reporting.
    Thanks for your answer.

    This really has become complicated. Call it the pain of a NinjaTrader user. This is the whole story.

    Objective: I just want to color a horizontal trading range on my with an indicator.

    Step 1: Try DrawRegion(). Result: The Baloo - Speech Bubble look. No way to code away the convex shape of the left and right border. Abandoned.

    Step 2: Try DrawRectangle(). Result: Trading range is correctly colored, but the color draws on top of the lines and text, making them invisible. With Zorder = -1, it is possible to place the colored range behind price, but all lines plotted from within the indicator are hidden by DrawRegion(), There is no way to differentiate the layer for the drawing object within an indicator. Abandoned.

    Step 3: I decide to to write a new indicator, by exposing the required data via DataSeries and catch the values with the new indicator. The new indicator works well, collects the data and by using Zorder = -1 within the indicator code, I can now plot the trading range behind all other lines and text. I am temporarily happy as my indicator works for the opening range, which is calculated from intraday data. Unfortunately, I also want to display pivot ranges, with the pivot indicator running in DailyBars mode collecting the Kinetick data. I am quite disappointed, as I understand that my newly coded indicator cannot use the values from my pivots (or the NinjaTrader pivots) indicator. Abandoned

    Step 4: I code an entirely new indicator calculating the pivots, pivot ranges and opening ranges from the instrument sessions and offsets just to display the opening, night session and pivot range. I have been successful, but it took me an entire day just to colour an existing range on my chart. There is room for improvement.

    Chart attached.
    Attached Files

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Hi Harry, could reproduce an issue here with the Pivots call - we look into, thanks for reporting.

    Leave a comment:


  • Harry
    replied
    I use Kinetick data for EOD and Interactive Brokers for Intraday Data.

    I tested this while being not connected -> no access possible,

    Originally posted by NinjaTrader_Bertrand View Post
    Harry, with which data feed are you working? Would it provide native daily bars to calc those pivots in the daily data mode?

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Harry, with which data feed are you working? Would it provide native daily bars to calc those pivots in the daily data mode?

    Leave a comment:


  • Harry
    replied
    I coded a second indicator now. I can handle the drawing problem with this. The separate indicator catches the DataSeries from the other indicators, calculates the rectangles and plots them behind price and the lines of the other indicators.

    However there is a new problem, now. If I call the pivots indicator in DailyBars mode, it does not work. For example


    PHP Code:
    double mainpivot = 0; 
    mainpivot = Pivots(PivotRange.Daily,HLCCalculationMode.DailyBars,0,0,0,20).PP.Get(CurrentBar); 
    
    always returns the value 0, whereas

    PHP Code:
    double mainpivot = 0; 
    mainpivot = Pivots(PivotRange.Daily,HLCCalculationMode.CalcFromIntradayData,0,0,0,20).PP.Get(CurrentBar); 
    
    works correctly.

    Any help would be appreciated, just trying to draw clean rectangles behind price.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Harry, sorry for my late reply - I'll check into the default ZOrders assigned in our Draw methods.

    Yes, the 2 indicators should do it, ZOrder -1 worked well in my test to default the DrawRectangle behind the price bars.

    Leave a comment:


  • Harry
    replied
    Only solution might be to write two indicators.

    Indicator 1 plots the lines and the text.

    Indicator 2 plots the filled ranges by using DrawRectangle() and by referencing indicator 1. The second indicator would be initialized with ZOrder = -1, so the rectangles will hopefully plot behind the rest of the chart.

    Just would need to reference a BoolSeries ("plot" or "do not plot"), two DataSeries containing the upper and lower range and one DataSeries containing the sessionCount to create the tags.

    Would this work?

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by CarlTrading, 03-31-2026, 09:41 PM
1 response
82 views
1 like
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 04-01-2026, 02:41 AM
0 responses
43 views
0 likes
Last Post CarlTrading  
Started by CaptainJack, 03-31-2026, 11:44 PM
0 responses
64 views
2 likes
Last Post CaptainJack  
Started by CarlTrading, 03-30-2026, 11:51 AM
0 responses
68 views
0 likes
Last Post CarlTrading  
Started by CarlTrading, 03-30-2026, 11:48 AM
0 responses
56 views
0 likes
Last Post CarlTrading  
Working...
X