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

clear text on the chart

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

  • 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

    Leave a comment:


  • 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 ???

Latest Posts

Collapse

Topics Statistics Last Post
Started by frslvr, 04-11-2024, 07:26 AM
7 responses
109 views
1 like
Last Post caryc123  
Started by rocketman7, Today, 09:41 AM
3 responses
7 views
0 likes
Last Post NinjaTrader_Jesse  
Started by traderqz, Today, 09:44 AM
2 responses
4 views
0 likes
Last Post NinjaTrader_Gaby  
Started by stafe, 04-15-2024, 08:34 PM
8 responses
40 views
0 likes
Last Post stafe
by stafe
 
Started by rocketman7, Today, 02:12 AM
7 responses
31 views
0 likes
Last Post NinjaTrader_ChelseaB  
Working...
X