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

Modification to bar type

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

    Modification to bar type

    Hello,

    I wanted to know if I should be posting here or another part of the forum about modifying a bar type code to add a Tick reversal option in the data series for the Sverenko.
    Attached Files

    #2
    Hello Ken7787,

    Thanks for your post.

    I have moved your post to the NinjaTrader Desktop General Development section of the forums since it is not specifically related to Indicator Development.

    That said, the SveRenko barstype script from the Ecosystem User App Share uses custom logic and it would be up to you to come up with the custom logic to modify the script to add a Tick reversal option.

    You could consider reviewing the UniRenko barstype script from the Ecosystem User App Share which has Tick reversal to see how this might be accomplished.

    UniRenko: https://ninjatraderecosystem.com/use...nko-bartype-8/

    This forum thread will also be open for other community members to share their insights.

    Let me know if you have further questions on this.

    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.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello!

      Thank you for moving the post.

      I wanted to know if I'm on the right track. I was able to put in some code to add for the reversal type box in data series. I can see the tick trend showing up at

      ApplyDefaultValue(BarsPeriod period)
      {
      period.Value = 10;

      But no way to change the numeric value for reversal type box in data series .



      namespace NinjaTrader.NinjaScript.BarsTypes
      {
      public class SveRenkoNT8 : BarsType
      {
      private double renkoMax;
      private double renkoMin;

      protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Description = @"SV Renko Type";
      Name = "SveRenkoNT8";
      BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 1414, BarsPeriodTypeName = "SveRenkoNT8(14)", Value = 1 };
      BuiltFrom = BarsPeriodType.Tick;
      DefaultChartStyle = Gui.Chart.ChartStyleType.CandleStick;
      DaysToLoad = 3;
      IsIntraday = true;
      IsTimeBased = false;
      }
      else if (State == State.Configure)
      {
      Name = string.Format(Core.Globals.GeneralOptions.CurrentC ulture, "SveRenko", BarsPeriod.Value);

      Properties.Remove(Properties.Find("BaseBarsPeriodT ype", true));
      Properties.Remove(Properties.Find("BaseBarsPeriodV alue", true));
      Properties.Remove(Properties.Find("PointAndFigureP riceType", true));
      Properties.Remove(Properties.Find("Reversal type", true));
      Properties.Remove(Properties.Find("Value2", true));

      SetPropertyName("Value", "Tick Trend");
      SetPropertyName("Value2", "Tick reversal");

      ​I got part of what I want, now just putting the rest together.

      Comment


        #4
        This is how the data series looks now. hopefully this makes sense, instead of tick to get a numeric value

        Comment


          #5
          Hello Ken7787,

          Thanks for your note.

          Yes, you are on the right track.

          The default Tick Reversal property value is set in the ApplyDefaultValue class in the UniRenko BarsType script. This could be seen on line 69 in the UniRenko script.

          The 'reversalOffset' value could be seen in the script on line 102 for calculating values if the Bars object is mid-session. On line 116 you could see how 'reveralOffset' is set on the first bar in the UniRenko BarsType script.

          Please let me know if I may assist further.
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            I think that's for the unirenko bar type. The bar type i have is the SverenkoNT8 from the ecosystem.
            Attached Files

            Comment


              #7
              Hello Ken7787,

              Thanks for your note.

              It seems like this is not included in the SveRenkoNT8 script from the Ecosystem User App Share. You would need to add this logic to the script if you want it included.

              As stated in post # 2, "the SveRenko barstype script from the Ecosystem User App Share uses custom logic and it would be up to you to come up with the custom logic to modify the script to add a Tick reversal option."

              You could compare the UniRenko script to the SveRenko script to see how you might go about accomplishing adding a tick reversal option.

              Let me know if I may assist further.
              Brandon H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by thanajo, 05-04-2021, 02:11 AM
              3 responses
              468 views
              0 likes
              Last Post tradingnasdaqprueba  
              Started by Christopher_R, Today, 12:29 AM
              0 responses
              10 views
              0 likes
              Last Post Christopher_R  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              166 responses
              2,237 views
              0 likes
              Last Post sidlercom80  
              Started by thread, Yesterday, 11:58 PM
              0 responses
              4 views
              0 likes
              Last Post thread
              by thread
               
              Started by jclose, Yesterday, 09:37 PM
              0 responses
              9 views
              0 likes
              Last Post jclose
              by jclose
               
              Working...
              X