Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator to swap between Candlestick and OHLC

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

    Indicator to swap between Candlestick and OHLC

    I am looking to swap between candlestick and OHLC bar types without having to go to "Data Series>Chart Style>Chart style" and selecting from the dropdown. I have an indicator with a button on the toolstrip to swap between the two.

    In my button actions, I am using the statements:
    ChartControl.ChartStyle.ChartStyleType = ChartStyleType.CandleStick;
    and
    ChartControl.ChartStyle.ChartStyleType = ChartStyleType.OHLC;
    with
    ChartControl.Refresh();

    These do not change the bar style. What should I use?

    #2
    Hello,

    Thank you for the question.

    Unfortunately there are no supported methods to do this, and I am unaware of any specific way to do this and allow the chart to correctly reload.

    One way that may work but would something you would need to develop/test would be to invoke a click on the toolbar buttons that exist already.

    Winforms allows you to Click a button through code, if you can locate the correct menu items this may be possible. Unfortunately this would not be something I could not really assist with as it would require digging through the toolbars controls.

    You may be able to locate some further help in the following items:




    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      My question is not on how to create a button on the toolbar, but how to set the ChartStyleType.
      It does not seem that what I have tried:
      ChartControl.ChartStyle.ChartStyleType = ChartStyleType.CandleStick;
      and
      ChartControl.ChartStyle.ChartStyleType = ChartStyleType.OHLC;
      are the correct statements. I am wondering if you have a suggestion on how to assign the chart type?

      Comment


        #4
        Hello,

        I understand the question is not to add a button, there are no supported/documented methods for what you are trying to do so I provided resources that may be helpful in going the direction you need.

        There is an existing drop down list in the chart tool bar, or in the DataSeries window. These would be the only supported ways to change the chart style. You could potentially use undocumented/unsupported code to achieve your goal by having your button interface with the existing drop down menu in the tool bar. This was the reason for the toolbar button example so you could see the Controls collections and how they are used.

        The syntax you are currently trying by its self would not call the internal actions needed to actually change the style. Because there are no specific documented ways to change the chart style from NinjaScript, you would likely need to look into alternative methods like using the existing buttons.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        11 views
        0 likes
        Last Post SantoshXX  
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        2 views
        0 likes
        Last Post DanielTynera  
        Started by yertle, 04-18-2024, 08:38 AM
        9 responses
        41 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        12 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Working...
        X