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 Waxavi, Today, 02:10 AM
          0 responses
          6 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by TradeForge, Today, 02:09 AM
          0 responses
          11 views
          0 likes
          Last Post TradeForge  
          Started by Waxavi, Today, 02:00 AM
          0 responses
          2 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by elirion, Today, 01:36 AM
          0 responses
          4 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          5 views
          0 likes
          Last Post gentlebenthebear  
          Working...
          X