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

Questions on drawing from a strategy

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

    Questions on drawing from a strategy

    I have a few questions on drawing from a strategy.

    1) Can I adjust the size of a dot or an arrow drawn using a statement such as:
    DrawArrowUp("DivUp", 1, Lows[0][1] - TickSize, Color.Green);

    2) I can't find the method for coloring a bar. What is it?

    3) Is there a way to keep previous arrows (etc.) on the chart if I keep using the same draw statement? If not, is there another way?

    Thanks,

    Folls

    #2
    Hi,

    1) Unfortunately chart marker sizes are non-adjustable

    2) See this link - http://www.ninjatrader-support.com/H.../BarColor.html

    3) No, if you remove a strategy from a chart, any draw objects will be removed
    RayNinjaTrader Customer Service

    Comment


      #3
      To be able to keep a reasonable number of markers on the chart, I used the following code:

      drawCounter += 1; //update draw counter
      if (drawCounter > 1000) drawCounter = 0; // keep the counter small
      string counter = drawCounter.ToString("n0"); //convert to string

      // draw an indication
      DrawArrowUp(counter, 1, Lows[0][1] - TickSize, Color.Green);

      I got the attached error when I installed the strategy on the chart. Prior to using the drawCounter, I was reusing a DrawArrowUp statement and thus only keeping the last marker on the chart. That did not get an error.

      Any advice or input?

      Thanks!

      Folls
      Attached Files

      Comment


        #4
        This is a rare bug that does not seem to have negative implications. We are having a hard time reproducing it. We did add some code that hopefully works around this for the next update.

        Does this happen each time you run this strategy or did it only happen once?

        It is not related to your code changes.
        RayNinjaTrader Customer Service

        Comment


          #5
          It seems repeatable. Every time I have installed the strategy, it has happened. Like you said, it doesn't seem to cause a problem.

          Folls

          Comment


            #6
            For clarification. Could you cycle through several times, appying the strategy, removing, applying removing and let us know if the error message happens each time? If yes, I would request from you some files for us to reproduce here.

            Thanks
            RayNinjaTrader Customer Service

            Comment


              #7
              It does it every time I put the strategy in the chart.

              Comment


                #8
                I sent you a PM.
                RayNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bmartz, 03-12-2024, 06:12 AM
                4 responses
                31 views
                0 likes
                Last Post bmartz
                by bmartz
                 
                Started by Aviram Y, Today, 05:29 AM
                4 responses
                12 views
                0 likes
                Last Post Aviram Y  
                Started by algospoke, 04-17-2024, 06:40 PM
                3 responses
                28 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X