Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Correct way of using variables within FormatPriceMarker method?

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

    Correct way of using variables within FormatPriceMarker method?

    Hello,

    I'm using the FormatPriceMarker() method.

    Can I use another double within the method eg. a double that updates its values within OnBarUpdate?

    eg.

    PHP Code:

    double mySecondPrice
    ;

    protected 
    override void OnBarUpdate()
    {
        
    mySecondPrice x[0]; // x being any dataseries
    }

    public 
    override string FormatPriceMarker(double price)
    {
        if (
    price mySecondPrice)
            return 
    price.toString();
        else
            return 
    mySecondPrice.toString();

    Is this okay to do this? I remember reading recently with beta11 that I should not use any value (or more specifically any dataseries with indexing) that updates itself in OnBarUpdate() within OnRender() because syncing would not be guaranteed. Would this be a similar issue within FormatPriceMarker()?

    I know this seems trivial but could be a major issue if not done correctly.

    Thank you.
    Last edited by Sim22; 06-24-2016, 01:07 AM.

    #2
    Hello Sim22,

    Thank you for your post.

    Accessing a DataSeries should be accurate when running FormatPriceMarker(). What are you attempting in FormatPriceMarket()? Are you trying to switch the value of the plot or the decimal place?

    Comment


      #3
      Hi Patrick,

      basically I made my own Font that includes more symbols for the analyzer.

      Within OnBarUpdate I will find the MRO of a condition.
      I will also determine if the condition is bullish or bearish.
      Within the FormatPriceMarker() method I will use 'price' as the current input value but also add to the string the MRO and a symbol which represents the bull or bear scenario.

      See attachment. Plus find a copy of the font for your perusal. (You will need to open it up in Character Map to see the whole collection of characters otherwise you will only see a standard Arial font.

      If your response was negative I was considering exploring bitwise shifting to modify the price value and then decode it in FormatPriceMarker() to extract the other information out of the value.


      Also you might find this useful:

      The analyzer only colors the cells based on absolute values (or crossabove/below).
      How does one tell the analyzer if an EMA is trending up or down? I answered this question by creating a parallel plot (since I cannot use a custom dataseries in the analyzer )that takes on a negative signed value of the current EMA if it is trending down and keeps a positive value if trending up. Within FormatPriceMarker() I use this sign to plot an up or down arrow. The analyzer cells are set to >0 or <0 to color the cells green/red as well. I then return the negative value back to a correct positive value so the string is correctly displayed.

      Thank you for answering my question
      Attached Files
      Last edited by Sim22; 06-25-2016, 10:19 PM.

      Comment


        #4
        Hello Sim22,

        Thank you for your response.

        I still do not follow exactly what you are attempting. FormatPriceMarker() would be used to set how the value is displayed. Does the 'x' DataSeries change the values in some manner? How is the font relevant in regards to DataSeries 'x'?

        FormatPriceMarker() woudl use the 'x' DataSeries decimal place to format the values displayed for the plot. It would not provide the actual value for the plot.

        Comment


          #5
          Hi Patrick,

          I try not to complicate the question to keep it simple.

          This is working for me just fine

          This will not work if you import it. It is simply for you to understand the logic. If you would like a full copy I will upload it for you.

          Thank you for your time,

          Simon
          Attached Files
          Last edited by Sim22; 06-28-2016, 03:09 AM.

          Comment


            #6
            Thats pretty cool Sim22.......I like it....You should do that for elliot wave also

            Comment


              #7
              Here's the direct link to the sample in the download section.



              You will need to extract the zip file first. Make sure you read the instructions first and download the fonts from the link provided.
              Attached Files
              Last edited by Sim22; 07-04-2016, 08:23 PM.

              Comment


                #8
                Correct way of using variables within FormatPriceMarker method?

                This seems to offer an opportunity for enhancement.

                I have used FormatPriceMarker in NT7 to produce custom price markers. That involved "pre-" and "post-processing" the price value to incorporate "flag" information into the value -- not optimal, but the only possibility as the method is currently defined.

                I would recommend an enhancement to FormatPriceMarker that allows at least one more (optional?) parameter that can specify a string or format specifier into which the price value will be substituted for the displaying of the price marker text itself.

                For example, something like FormatPriceMarker(currentPrice,"Ask #.##'#") to achieve a price marker text like "Ask 132.78'3" or "Ask 0.7492'1".

                One might also consider allowing formatting the price marker itself; for example, colour, size, font(s), etc. Combining object formatting and text formatting would be ideal.

                Thanks.
                Last edited by jeronymite; 07-11-2016, 08:18 PM. Reason: Added additional formatting suggestion
                Multi-Dimensional Managed Trading
                jeronymite
                NinjaTrader Ecosystem Vendor - Mizpah Software

                Comment


                  #9
                  Hello jeronymite,

                  Thank you for your post.

                  I would forward your suggestion to development.

                  Comment


                    #10
                    Patrick, would you please consider the ability to select which plots or dataseries to plot in the analyzer similar to TradeStation or MultiCharts. So for example instead of a dropdown menu to select one plot, how about a check box (bool) for each plot you wish to display.

                    As you can see in the TS radar screen attached there are two plots shown within the one indicator. That way the cells can change color separately as well.

                    Thank you.
                    Attached Files
                    Last edited by Sim22; 07-12-2016, 05:34 PM.

                    Comment


                      #11
                      This seems to offer an opportunity for enhancement.
                      Absolutely, I feel the analyzer has not evolved with NT.

                      I have used FormatPriceMarker in NT7 to produce custom price markers. That involved "pre-" and "post-processing" the price value to incorporate "flag" information into the value -- not optimal, but the only possibility as the method is currently defined.
                      Yes, not optimal. However water always finds it way in to leaky hull You have to bend the rules to make something work.

                      I would recommend an enhancement to FormatPriceMarker that allows at least one more (optional?) parameter that can specify a string or format specifier into which the price value will be substituted for the displaying of the price marker text itself.
                      Yes

                      One might also consider allowing formatting the price marker itself; for example, colour, size, font(s), etc. Combining object formatting and text formatting would be ideal.
                      Absolutely!

                      Thanks.[/QUOTE]

                      Comment


                        #12
                        Originally posted by Sim22 View Post
                        Patrick, would you please consider the ability to select which plots or dataseries to plot in the analyzer similar to TradeStation or MultiCharts. So for example instead of a dropdown menu to select one plot, how about a check box (bool) for each plot you wish to display.

                        As you can see in the TS radar screen attached there are two plots shown within the one indicator. That way the cells can change color separately as well.

                        Thank you.
                        This request has been assigned ID # SFT-1493.

                        Comment


                          #13
                          Originally posted by jeronymite View Post
                          This seems to offer an opportunity for enhancement.

                          I have used FormatPriceMarker in NT7 to produce custom price markers. That involved "pre-" and "post-processing" the price value to incorporate "flag" information into the value -- not optimal, but the only possibility as the method is currently defined.

                          I would recommend an enhancement to FormatPriceMarker that allows at least one more (optional?) parameter that can specify a string or format specifier into which the price value will be substituted for the displaying of the price marker text itself.

                          For example, something like FormatPriceMarker(currentPrice,"Ask #.##'#") to achieve a price marker text like "Ask 132.78'3" or "Ask 0.7492'1".

                          One might also consider allowing formatting the price marker itself; for example, colour, size, font(s), etc. Combining object formatting and text formatting would be ideal.

                          Thanks.
                          This request has been assigned ID # SFT-1491.

                          Comment


                            #14
                            Correct way of using variables within FormatPriceMarker method?

                            Thanks, Patrick.

                            Please also reference this posting when considering the implementation details: http://ninjatrader.com/support/forum...ad.php?t=73907

                            Thanks!
                            Multi-Dimensional Managed Trading
                            jeronymite
                            NinjaTrader Ecosystem Vendor - Mizpah Software

                            Comment


                              #15
                              Please answer Sim22 quest. I am interested in... Thanks for nice topic

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by kaywai, 09-01-2023, 08:44 PM
                              5 responses
                              601 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Started by xiinteractive, 04-09-2024, 08:08 AM
                              6 responses
                              22 views
                              0 likes
                              Last Post xiinteractive  
                              Started by Pattontje, Yesterday, 02:10 PM
                              2 responses
                              19 views
                              0 likes
                              Last Post Pattontje  
                              Started by flybuzz, 04-21-2024, 04:07 PM
                              17 responses
                              230 views
                              0 likes
                              Last Post TradingLoss  
                              Started by agclub, 04-21-2024, 08:57 PM
                              3 responses
                              17 views
                              0 likes
                              Last Post TradingLoss  
                              Working...
                              X