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 FishTrade, 05-13-2024, 11:11 PM
      3 responses
      11 views
      0 likes
      Last Post FishTrade  
      Started by Graci117, Yesterday, 09:02 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by ETFVoyageur, Yesterday, 07:55 PM
      0 responses
      9 views
      0 likes
      Last Post ETFVoyageur  
      Started by janio973, Yesterday, 07:24 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by aligator, 01-06-2022, 12:14 PM
      4 responses
      250 views
      0 likes
      Last Post john_44573  
      Working...
      X