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

Stacked 1 Range Chart Style as a 30 Minutes Bar

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

    Stacked 1 Range Chart Style as a 30 Minutes Bar

    I need to plot a 30-minute chart of the ES with range bars. My target is to break each 30-minute candle by the tick.
    The problem is that there is no such Chart Style, so I have to figure it out somehow.

    My goals is to apply this new Range Style to an ES 30-minute chart, but with eack range bar stacked upon each other until they complete the 30-minute timeframe instead of creating a new bar with a higher Time.

    I newer approached creating a new Chart Style, nor adapting an existing one. So, I cloned the PriceBox Chart Style for a start. I tried to see how to proceed, got stuck, messed it up, and finally left it alone. The internal code of a Chart Style seems to be far too advanced for my current coding skills.

    I understand that the Time value of each bar has a role in the final solution, but I don't understand how to fit the logic to control this. Let alone what logic.

    Any hint about how to approach such a task.?

    #2
    Hi Gianpiero, thanks for posting. If you want to create your own bar types or chart styles, I can only recommend fully understanding and studying the bar type and chart styles that are in the platform by default. This post will remain open for other forum members to contribute their ideas and experience on the subject.

    Kind regards,
    -ChrisL​
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello ChrisL, Thanks for your reply. I looked more closely into the BoxStyle class code, and I guess I figured out where to update it.

      Just one more little help. This is a snippet of the actual @BoxStyle.cs:
      Code:
              protected override void OnStateChange()
              {
                  if (State == State.SetDefaults)
                  {
                      Name            = Custom.Resource.NinjaScriptChartStyleBox;
                      ChartStyleType  = ChartStyleType.Box;
                      BarWidth        = 1;
                  }
      ​
      I guess I have to set the ChartStyleType parameter to something else since I doubt I can mess with ChartStyleType.Box.

      Looking around, I found this kind of assignment, too, that I do not fully understand:
      Code:
                  if (State == State.SetDefaults)
                  {
                      Name = "TestStyle";
                      ChartStyleType = (ChartStyleType)58;​
      Is it the preferred way to declare ChartStyleType? What about the number 58? I surmise it has to do with an enumerated structure in NinjaScript. The only thing I know about it is to pick a high number to avoid collision with built-in values. Is that so?

      Comment


        #4
        Hi Gianpiero, thanks for the follow up. It is recommended to just choose a high number that is far away from the 8 default chart style types. We have a related example here that identifies bars types:
        This is just a simple script which prints the BarsTypes and their BarsPeriodType ID as an integer. This is to aid in finding BarsPeriodType ID’s for the use with AddDataSeries syntax. For more apps from this user, check out the Trendline Detection tool!


        Kind regards,
        -ChrisL

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GLFX005, Today, 03:23 AM
        0 responses
        1 view
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        12 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X