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

PRC Round2TickSize

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

    PRC Round2TickSize

    I am trying to work out if the PRC indicator for NT7 which I downloaded ages ago, can be amended so as to show its pricemarkers Rounded To Ticksize.

    Fx.Set(n,x[1]+sum);
    //DOESNOTWORK: Fx.Set(Instrument.MasterInstrument.Round2TickSize( n,x[1]+sum[0]));


    Attached is the CS file for the indicator. What I tried is at lines 166, 182 and 183.

    Could you let me know if its at all possible to do, and if yes, could you look it over and find what I am doing wrong, then correct me.

    sandman
    Attached Files

    #2
    Hello sandman,

    Thank you for the question.

    The PriceMarker will follow the plot value and also will relate to the instrument being used so it should already follow the general tick size number of decimals. Are you seeing more number of decimals or were you specifically trying to round to the tick size yourself? Can you provide an example of what value you see and what value you are expecting?

    To otherwise format the price marker would require using the FormatPriceMarker override. https://ninjatrader.com/support/help...ightsub=format

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

    Comment


      #3
      Jesse. Thanks. For most instruments it's okay, like RTY, GC, CL. But for some, like ES, NQ and 6J the price marker shows smaller decimal increments than on the DOM which are the ones I would expect to see mirrored in the pricemarker. I hope the attached samples clarify this point.

      As reducing the number of decimals would not resolve this point, I hope you see another possibility to fix this.

      sandman
      Attached Files

      Comment


        #4
        Hello sandman,

        It looks like your attachment did not come through, could you try attaching it again?

        If you are seeing more places the format override should work for that, you could use the Round2TickSize on the passed in value and return the rounded value. Can you try the following to see this this helps?


        Code:
         public override string FormatPriceMarker(double price)
                {
                    return Instrument.MasterInstrument.Round2TickSize(price).ToString();
                }
        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Jesse.
          I have attached the images to my last post. Meantime, I'll try your suggestion. Will let you know. sandman

          Comment


            #6
            Hello sandman,

            In the image you attached I am not able to see the problem, are you saying that the value does not match the TickSize for example you are seeing .26 ending values on the ES instead of .25? Or are you saying that the number of decimals do not match, I am not able to see this if so. Both the images appear to match the superdom in regard to the number of places, the values don't specifically fall into the tick sizes. Can you clarify if I have overlooked the problem here?



            I look forward to being of further assistance.

            JesseNinjaTrader Customer Service

            Comment


              #7
              Jesse.

              Right, the values of the price marker did not specifically fall into the Tick Size which is always properly portrayed in the DOM.

              BUT what you already suggested is what makes it work properly. Thanks for including it in your message as from only the sample reference I would not have been able to figure out to leave the .ToString() blank.

              So, everything's fine. Thank you. Have a good day!

              sandman

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Perr0Grande, Today, 08:16 PM
              0 responses
              1 view
              0 likes
              Last Post Perr0Grande  
              Started by elderan, Today, 08:03 PM
              0 responses
              3 views
              0 likes
              Last Post elderan
              by elderan
               
              Started by algospoke, Today, 06:40 PM
              0 responses
              10 views
              0 likes
              Last Post algospoke  
              Started by maybeimnotrader, Today, 05:46 PM
              0 responses
              9 views
              0 likes
              Last Post maybeimnotrader  
              Started by quantismo, Today, 05:13 PM
              0 responses
              7 views
              0 likes
              Last Post quantismo  
              Working...
              X