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

Strategy Drawings not showing on Chart

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

    Strategy Drawings not showing on Chart

    Hi, I'm new to NT8 so apologies if I've missed something obvious.

    I've created a very very simple condition in the Strategy Builder to the effect of

    "if the current bar's High is Higher than the previous bar's High, then draw 'HH' above the current bar".

    (I've attached the screenshot of my Strategy Builder- the Conditions & Actions part is the only area I have amended).

    What I'm trying to achieve is a 'HH' marked on the chart every time a Higher High is made.....

    Two things; 1) Nothing appears on my charts after I implement the strategy on a given chart, even though there are plenty of Higher Highs, and 2) how do I ask it to mark/draw ALL Higher Highs and not just look at the most recent two bars?

    Thanks very much in advance.
    Attached Files

    #2
    Hello ehope,

    Thanks for your post and welcome to the forums!

    The Draw.text statement shows that you are setting the Y value at a level of 5 and that would be dependent upon the price level of the chart. What you want to do is to reference the High of the bar and offset the text by a few ticks. In code this would look like High[0]+ 5 * TickSize. The Strategy builder will provide that for you.

    When drawing an object, such as text, each print must have a unique tag name. Your tag name is HH so what happens is that when you add the next HH the old one is removed and the new one is drawn as your observation has confirmed. To show all the labels, each tag name then must be unique. An easy what to do this is to add the CurrentBar number to the tag name. In code this would look like @"HH"+CurrentBar, again the strategy builder can do this for you.

    I've created a short video that covers both of these, in the strategy builder, offsetting a label and creating unique labels: https://www.screencast.com/t/Ijoqo7nde5vn
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi, Thanks very much for your reply, it was very helpful.

      However I'm still not quite there! I've followed your instructions as best I can but I still don't see anything on the chart....

      I have attached a screen shot of the current code the SB is giving me and I'm currently charting Daily candles of EURUSD.

      Also, in 'Drawing Objects', the Tags are not appearing so it can't be to do with the colour/formatting etc...

      Could you please point me in the right direction?

      Thanks vm in advance.
      Attached Files

      Comment


        #4
        Hello ehope,

        Thanks for your reply.

        Your Strategy Builder code appears correct. I replicated it here and have attached a screenshot of both the strategy builder and the chart which does display the "HH" above the candles.

        When you applied the strategy to the chart did you "Enable" it? You can tell by looking at the chart, in the upper left corner will be the name of the strategy, it is shows (D) before the name that indicates the strategy is disabled. You would enable the strategy in the "properties" of the strategy when you apply it to the chart by clicking on the "Enabled" check box.

        If you did enable the strategy and it shows as disabled on the chart, please check the "log" tab of the control center for any related error messages.
        Attached Files
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Arrr... the ol Enable button... thanks vm Paul, that's fixed it!

          Appreciate your help.

          Comment


            #6
            One more thing Paul, is there a way to edit the font of the Text in the Strategy Builder to apply to an entire condition?

            I can see that I can do this individually for each drawing but that would take forever given the number of different drawings I anticipate.

            Thanks vm.

            Comment


              #7
              Hello ehope,

              Thanks for your post.

              No, the text will be the default of the charts text tool. To see something larger you would need to set the text tool default to a larger text size. You can do this by creating text on the chart then double clicking to see the text properties, next locate the small "preset" in the lower corner of the properties box, click, then save and save with the name "default". Next, apply the strategy and it should use the charts defaults text type that you just created.
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Hi Paul, that's a shame. It's quite frustrating when you have various strategies on the same chart and you can't distinguish them with font. I would have thought this is a fairly straight forward change. How do I put a formal request in? ie. the ability to edit and change the font of each strategy that uses Text?

                Thanks vm.

                Comment


                  #9
                  Hello ehope,

                  Thanks for your reply.

                  I can certainly place a feature request. So you are asking that when using the strategy builder, that you be able to access the font/color/style of the text tool to select as you wish, is that correct?

                  Just so you know, if you (unlock) code the strategy directly you can use the Draw.Text() that allows you full text font control. Other options in the strategy builder would be to use symbols such as dots, triangles, arrows, etc.
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Paul, yes that's right. I would like to be able to customise the text for each individual strategy, ideally within the Strategy Builder.

                    Thanks, that's a good work around however I'm mindful that once I start playing with the code I'm then unable to use the Strategy Builder again.

                    cheers

                    Comment


                      #11
                      Hello eHope,

                      Thanks for your reply.

                      The feature request has been assigned as SFT-2092, "Strategy Builder to have access to text characteristics"

                      Thanks for using NinjaTrader8 and your interest in improving the product.
                      Paul H.NinjaTrader Customer Service

                      Comment


                        #12
                        Thanks Paul, much appreciated.

                        Comment


                          #13
                          Hi Paul, not sure if this idea would help the requested change, but would it be easier to allow selecting a group of Drawings and then assigning a text template to them?

                          I've attached an image of where I'm referring to.

                          Just had a thought this might be a slightly easier and therefore a quicker fix.

                          cheers
                          Attached Files

                          Comment


                            #14
                            Hello eHope,

                            Thanks for your post.

                            I will update the feature request notes to potentially use templates.

                            Thanks for your suggestion.
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi Paul, wanted to check if there had been any progress on this issue? ie. The ability to select multiple drawings and change their font?

                              Thanks very much.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Perr0Grande, Yesterday, 08:16 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by f.saeidi, Yesterday, 08:12 AM
                              3 responses
                              24 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by algospoke, Yesterday, 06:40 PM
                              1 response
                              14 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by quantismo, Yesterday, 05:13 PM
                              1 response
                              14 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by The_Sec, 04-16-2024, 02:29 PM
                              3 responses
                              16 views
                              0 likes
                              Last Post NinjaTrader_ChristopherS  
                              Working...
                              X