Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dataseries - Draw.TextFixed

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

    Dataseries - Draw.TextFixed

    Hello,

    I´m experiencing the most strange behavior in 10 years from NT6.5 to NT8. I´m testing round to find the reason and there is no error in log.

    My strategy is plotting in the chart doubles eg Draw.TextFixed(this,"str2",str2, TextPosition.Center,Brushes.Blue, new SimpleFont ("Arial",10), Brushes.Transparent,Brushes.White,100); (screenshot)
    this works for years.

    Today I found out that it does not when I add volumetric dataseries (which I use without errors in other strategy)
    For testing purposes I changed nothing else in the strategy than adding
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = Bars.BarsSeries.BarsType as
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;
    if (barsType == null)

    Compiling, enable again in the chart. No more Draw.TextFixed.

    When "//" the 3 lines for volumetric" and F5 in the chart its plotting again the Draw.TextFixed.
    When I change in the script the dataseries and apply the script to a tickchart and now using volumetric as added Dataseries then it is plotting OK in the chart. (But I assume adding volumetric in a script needs more cpu than running the script with calculations from volumetric in a volumetric chart)

    Why?

    Thank you!
    Tony
    Attached Files
    Last edited by tonynt; 04-22-2021, 07:04 AM. Reason: add more info

    #2
    Hello tonynt,

    The code you have highlighted is required for volumetric bars, if you have that in the code it should prevent the text from displaying on other chart types.

    If you need to support other bars types you need to make a condition for volumetric bars and another for when it is not volumetric bars.

    Please let me know if I may be of additional assistance.

    Comment


      #3
      Hello,

      sorry I dont understand from this reply. Maybe I did the question inaccurately... I try again:

      A.) When I run the script on a tickchart and having volumetric as added dataseries with "NinjaTrader.NinjaScript.BarsTypes.VolumetricB arsT y pe barsType = BarsArray[3].BarsSeries.BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;" and change conditions Bars[0] and Bars[3] for having conditions correct then the script plots the values in the chart with Draw.Textfixed ok
      B.) When I run the script on a volumetric chart with "NinjaTrader.NinjaScript.BarsTypes.VolumetricB arsT y pe barsType = Bars.BarsSeries.BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;" and of course modifying Bars[0] and Bars[3] then the script does not plot the values with Draw.TextFixed in the chart. Does a chart with volumetric prevent anything with Draw.TextFixed?


      Thank you!
      Tony
      Last edited by tonynt; 04-22-2021, 08:35 AM. Reason: typo

      Comment


        #4
        Hello tonynt,

        There is nothing specific with the volumetric chart that would cause Draw.Text to not draw.

        If there is no error and no text your code is likely not being executed at that point.

        You would need to use Prints and find out if your logic is being called or not.



        Please let me know if I may be of further assistance.

        Comment


          #5
          Perhaps its being drawn perfectly fine but overwritten by something else related to the volumetric bars?

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          49 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          67 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X