• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

clear text on the chart

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

  • mate41
    started a topic clear text on the chart

    clear text on the chart

    Hi,
    i use DrawTextFixed to draw a text to the chart and works well.
    But after every OnBarUpdate the new text to draw is draw above the previous one.
    A DrawTextFixed without a text don't do the trick ???

  • mate41
    replied
    Problem SOLVED....
    There was nothing wrong with the code.
    A close and open of the chart solved the problem....... ???
    Sorry for the noise.

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    I need to be able to reproduce what you are seeing on my end in order to advise further. I need a code sample I can compile and run in order to do this. I can not compile and run your sample.

    If you believe you have a strategy that may work, please try it out and post your findings here.

    Leave a comment:


  • mate41
    replied
    What more code but there are existing indicators called like rsi and so on and there is no problem about that.
    All is printed (on the chart), so no problem.
    Only the next print is printed above the previous as i said early.

    Code:
    if (CurrentBar == 0) return;
                // calculation
               
                double bolPerc = BollingerPercB(bPercOB, bPercOS,bPeriod,bStDev)[0];
                double rsiValue = RSI(rsiPeriod,rsiSmooth)[0];
                double imiValue = IMI(imiAvgP,imiPeriod,false)[0];
                double mfiValue = MFI(mfiPeriod)[0];
                double z = MarketData.Last.Price;
                double stosValue = Stochastics(stosPeriodD, stosPeriodK,stosSmooth).K[0];
    ..../......
                Font txtFont = new Font("Deja Vu Sans Mono", textSize, FontStyle.Bold);
                Font indicFont = new Font("Deja Vu Sans Mono", 8, FontStyle.Bold);
    DrawTextFixed("Indicators","\n\n\n\n\nRSI=" + rsiValue.ToString("N0")+"  IMI=" + imiValue.ToString("N0")+"  MFI=" + mfiValue.ToString("N0")+ "  Stos=" + stosValue.ToString("N0")+"  Bol%=" + bolPerc.ToString("N0")+"   \n\n", TextPosition.BottomLeft,Color.Blue,indicFont,Color.Transparent, Color.Transparent,0);
    See attached screenshot.
    Clearing the textline before write the new would be a solution ???
    Attached Files
    Last edited by mate41; 01-26-2016, 12:37 PM.

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    Since I do not have access to your private variables, I attempted to use the following :

    Code:
    private int test = 0;
    
    protected override void OnBarUpdate()
    {
       DrawTextFixed("Indicators","\n\n\n\n\nRSI=" + (++test) + "  IMI=" + (++test) + "   MFI=" + (++test) + "  Stos=" + (++test) + "  Bol%=" + (++test) + "\n\n", TextPosition.BottomLeft,Color.Blue,new Font("Arial", 20),Color.Transparent, Color.Transparent,0);
    }
    This code did not reproduce what you are describing.

    Would it be possible for you to give me a code sample with all your variables defined, which includes every instance of your using DrawTextFixed? If that is not possible, could you modify my code sample so that it reproduces the behavior you observed?

    Leave a comment:


  • mate41
    replied
    Here is the code: (NO is the code for "0" decimal)

    Code:
    DrawTextFixed("Indicators","\n\n\n\n\nRSI=" + rsiValue.ToString("N0")+"  IMI=" + imiValue.ToString("N0")+"  MFI=" + mfiValue.ToString("N0")+ "  Stos=" + stosValue.ToString("N0")+"  Bol%=" + bolPerc.ToString("N0")+"\n\n", TextPosition.BottomLeft,Color.Blue,indicFont,Color.Transparent, Color.Transparent,0);
    This line of text is draw ABOVE the previous one after every OnBarUpdate.
    Attached Files
    Last edited by mate41; 01-26-2016, 10:19 AM.

    Leave a comment:


  • billsingh
    replied
    Hi Mate41,
    Can you put the source in here...I am also trying to plot on chart not working. Just want to compre what I am doing wrong.

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    Hello mate41,

    Would it be possible for you to provide a small code sample?

    If your tag - your first argument - is the same between DrawTextFixed calls, your old DrawTextFixed object should be overwritten. I am including a link to the documentation in the NinjaScript help guide

    http://ninjatrader.com/support/helpG...wtextfixed.htm

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by sergey_z, Today, 02:34 AM
2 responses
11 views
0 likes
Last Post sergey_z  
Started by frankduc, Today, 05:24 AM
1 response
4 views
0 likes
Last Post NinjaTrader_PaulH  
Started by shmarola, Today, 01:01 AM
0 responses
4 views
0 likes
Last Post shmarola  
Started by CriticalMind, 11-29-2015, 12:39 PM
3 responses
1,323 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by novel168, 06-14-2019, 09:20 PM
2 responses
9 views
0 likes
Last Post novel168  
Working...
X