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

DrawText Output messed up

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

    DrawText Output messed up

    I have a DrawText situation. I am printing # of contracts Filled at Bid and Ask at the appropriate price level in a bar. Below the bar I am printing net (buyers/sellers).

    As soon as I fireup the indicator the data for the current bar prints fine. But when the next bar starts the screen becomes messed up.

    I am attaching two screenshots one that shows how it prints correctly and the other one shows overlapping text (the messed up one.)

    Below is the code snippet that does DrawText. Note that the Tags are unique for each bar and price level.

    Code:
    for (i=0;i<rows.Count;i++)
    {
    netVolume += rows[i].askVolume - rows[i].bidVolume;
    DrawText(CurrentBar.ToString()+rows[i].tradePrice,false,rows[i].bidVolume.ToString()+" "+rows[i].askVolume.ToString(),Time[0],rows[i].tradePrice,0,Color.White,new Font("Arial",15,FontStyle.Regular),StringAlignment.Center,Color.Transparent,Color.Black,0);
    }
    Attached Files

    #2
    I found the problem. Had to replace DateTime with barsAgo and that solved it.

    Thanks.

    Comment


      #3
      Hello,

      Glad to hear you resolved the issue.

      Let me know if I can be of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Salahinho99, Today, 04:13 AM
      0 responses
      9 views
      0 likes
      Last Post Salahinho99  
      Started by junkone, 04-28-2024, 02:19 PM
      8 responses
      92 views
      1 like
      Last Post brucerobinson  
      Started by mkouitra, 10-23-2021, 04:40 PM
      17 responses
      1,965 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by Vietanhnguyen2hotmailcom, 05-03-2024, 10:29 AM
      4 responses
      30 views
      0 likes
      Last Post Vietanhnguyen2hotmailcom  
      Started by PhillT, 04-19-2024, 02:16 PM
      4 responses
      39 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Working...
      X