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

Arrows not showing on Indicator Panel

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

    Arrows not showing on Indicator Panel

    I am trying to draw Arrows on the Indicator Panel.
    DrawOnPricePanel= false; in the Initialize() method, and is never touched again. I am well aware of NT's problems with that function. This indicator writes to the indicator panel only. In addition to this section of code, lines & text are produced and they do appear correctly. The output window shows exactly where the cross-overs were detected and is correct.

    Unfortunately the Arrows NEVER show. I also tried Triangles -- they never plotted either.

    Code:
    tagX = "X"+CurrentBar.ToString(); 
                if ( wERG[0]<wHIST[0] && wERG[1]>wHIST[1] ) // Mark triangle up
                {
                    pX = wERG[0]-5;
                    DrawArrowUp(tagX, true, CurrentBar, pX, Color.Black); 
                    Print(header+" ERG fell over Hist  @ "+pX.ToString("###.##")+" on Bar "+CurrentBar+" at "+Time[0].ToString("MM/dd HH:mm:ss"));
                }
                else if ( wERG[0]>wHIST[0] && wERG[1]<wHIST[1] ) // Mark triangle down
                {
                    pX = wERG[0]+5;
                    DrawArrowDown(tagX, true, CurrentBar, pX, Color.Black); 
                    Print(header+" ERG rose over Hist @ "+pX.ToString("###.##")+" on Bar "+CurrentBar+" at "+Time[0].ToString("MM/dd HH:mm:ss"));
                }
    tagX is a string, p1 is a double, and the wERG & wHIST are DataSeries.

    So what's going on?

    #2
    It looks like your problem might be the way that you are calculating pX. How do you know that the arrow is not simply drawing too far away for you to see? As a first step, as I do not know how the function is calculated, or what its resultant values are, draw the arrow at what I presume is the crossover point. ie., try pX = wERG[0], and see if the arrow shows up. If it does, that validates my surmise.
    Last edited by koganam; 03-16-2011, 08:17 PM.

    Comment


      #3
      I did try that. No dice. No arrows either. Thank you, koganam, for the suggestion.

      And I verified that the histogram has a final trough well below the cross-over, the arrow would be on the chart. Scrunched it anyway just to make sure. I checked several locations far back on the chart (one advantage of printing a list).

      One thing I did not try was using the alternate draw expression (time vs bar) because bar is more direct, I thought. I am actually getting that desperate, but I still think NT has a problem.

      Comment


        #4
        You would need to change to bar you are drawing at to 0 instead of CurrentBar. This would cause your arrows to be drawn zero bars back. All of your arrows are now drawing at the first bar of your chart.

        Dan

        DrawArrowUp(tagX, true, 0, pX, Color.Black);
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          Bingo! Thank you, edanny!

          such a rookie mistake...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          3 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          9 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Working...
          X