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

Modify OHLC bars look

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

    Modify OHLC bars look

    I want to modify the OHLC bars look so that the open and close line segments are almost 100% width of the bars and the bar body remains very thin.
    Currently when I make the bars wider by using <SHIFT><CTRL><up arrow> and <down arrow> then when the bars get wider body of the bar gets way to wide so that it becomes fuzzy and outgrows the actual prices of the highs and lows of the bar. If the body of the bar remains very thin while the open and close segments of the bar are much longer than what is currently reasonable with NT then it's easier to read the OHLC values both when zoomed in or when zoomed out. I don't know why you are making the bars fuzzy when widening and I don't expect you to change your code but I'd like to make my own version of the OHLC bars as a bars add on.

    If you could give me a hint and let me know if I could reuse your bars code and maybe what section of the code to work on to keep the bars body very thin while making the Open and Close segments almost 100% width of the bar to bar spacing.
    I've attached a png (top pic) showing what I'm trying to get from NT - as you can see the open segment of the new bar almost touches the close segment of the previous bar.
    I've also attacched a png (bottom pic) of what NT looks like when I size the bar for ~100% bar spacing and you can see that the bar body is taking up about 1/3 of the total available horizontal space for the bar and I want to modify that so the bar body remains very thin or the thinnest setting possible.

    thanks

    Click image for larger version

Name:	bars-wide.png
Views:	392
Size:	10.5 KB
ID:	1123891


    Click image for larger version

Name:	ninja-bars2.png
Views:	422
Size:	28.7 KB
ID:	1123893
    Attached Files

    #2
    Hello dtl-saw, thanks for posting.

    The ChartStyle is what you would need to modify. See the original "OHLC" chart style within the Chart Styles of the editor. You may make a copy of this script and modify it. The important part of the code is in the OnRender method. Please review this code and let me know if any questions come up.

    Kind regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi, dtl-saw

      I wonder if it turned out to be such a style of displaying bars? I also try to do the same as in your screenshots.

      Best regards.
      Last edited by Blaga; 08-15-2021, 04:20 AM.

      Comment


        #4
        Yes, copy attached BarsHalf.cs file into NinjaTrader 8\bin\Custom\ChartStyles\ folder
        The style shows as BarsHalf in the Chart Style dropdown
        You can modify the length of the open and close segments by changing point 3 and point 5 if you want shorter/longer segments

        Regards,
        Attached Files

        Comment


          #5
          Originally posted by dtl-saw View Post
          Yes, copy attached BarsHalf.cs file into NinjaTrader 8\bin\Custom\ChartStyles\ folder
          The style shows as BarsHalf in the Chart Style dropdown
          You can modify the length of the open and close segments by changing point 3 and point 5 if you want shorter/longer segments

          Regards,
          This option does not work for me on 8.1.1.7 unfortunately. There is no BarsHalf in the Chart Style dropdown after copying BarsHalf.cs to the folder. Any thoughts or suggestions on how to modify OHLC, please?
          Last edited by pashalv; 10-23-2023, 12:46 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by JonesJoker, 04-22-2024, 12:23 PM
          6 responses
          32 views
          0 likes
          Last Post JonesJoker  
          Started by GussJ, 03-04-2020, 03:11 PM
          12 responses
          3,239 views
          0 likes
          Last Post Leafcutter  
          Started by AveryFlynn, Today, 04:57 AM
          0 responses
          5 views
          0 likes
          Last Post AveryFlynn  
          Started by RubenCazorla, 08-30-2022, 06:36 AM
          3 responses
          79 views
          0 likes
          Last Post PaulMohn  
          Started by f.saeidi, Yesterday, 12:14 PM
          9 responses
          25 views
          0 likes
          Last Post f.saeidi  
          Working...
          X