Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with Draw.Text

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

    Issue with Draw.Text

    I am having an issue with Draw.Text() with NT8. The code using DrawText() in NT7 is working properly. The brush color always prints the same regardless of which string is printed.

    protected override void OnBarUpdate()
    {
    SimpleFont textFontTV = new Gui.Tools.SimpleFont( "Arial", 18 ) { Bold = true }; // Tick Volume Label Font
    SolidColorBrush BrushTickAsk = Brushes.LightSalmon;
    SolidColorBrush BrushTickBid = Brushes.LightGreen;

    if( Close[ 0 ] >= GetCurrentAsk() )
    Draw.Text( this, "tagBidAskVol", true, GetCurrentBidVolume().ToString() + " / >" + GetCurrentAskVolume().ToString(), -2, Close[ 0 ], 0, BrushTickAsk, textFontTV, TextAlignment.Left, Brushes.Transparent, Brushes.Transparent, 0 );
    else
    Draw.Text( this, "tagBidAskVol", true, GetCurrentBidVolume().ToString() + "< / " + GetCurrentAskVolume().ToString(), -2, Close[ 0 ], 0, BrushTickBid, textFontTV, TextAlignment.Left, Brushes.Transparent, Brushes.Transparent, 0 );
    }

    Thanks.

    #2
    Hello Omega,

    Thanks for your post and welcome to the forums.

    I was able to replicate the issue. I reduced the code down to:

    Code:
    if( Close[ 0 ] == GetCurrentAsk() )
    			{
    
    				Draw.Text (this, "test","Testing", 0,Low[0]-10*TickSize,Brushes.LightSalmon);
    			}
    			else
    			{
    				//RemoveDrawObject ("test");
    				Draw.Text (this, "test","Untesting", 0,Low[0]-10*TickSize,Brushes.LightGreen);
    			}
    As you can see I also tried removing the draw text object just to test and found that to cause the 2nd draw.text never to print.

    I have entered a bug report on the issue.

    Thanks for reporting the issue and for your participation in the beta test program.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul for your quick reply to this issue!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      26 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, Yesterday, 09:53 PM
      2 responses
      49 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      192 views
      0 likes
      Last Post Hasadafa  
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,234 views
      0 likes
      Last Post xiinteractive  
      Working...
      X