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 font keeps resetting to default

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

    DrawText font keeps resetting to default

    DrawText(CurrentBar.ToString()+"FamirTriggerS",tru e,"F\ne",0,TextAnchorS-SignalLabels.SizeInPoints,FamirColorS,SignalLabels ,StringAlignment.Center,Color.White,Color.White,10 );

    I've used the above to draw text on a chart; however, if I change the font from the default, it returns to the default font on the next chart opening. I have tried to save it as a template to capture the font but that doesn't seem to work, either.

    Is there a secret I should know to allow the font to be changed and saved with the workspace/template so it doesn't need to be reset each time I open a chart(s)?

    Snap

    p.s. odd about that space in tru e in the command. It is not there in the NinjaScript and I can't get it to go away in this post. I've even backspaced over the entire word, previewed it w/o the true and reentered the true. The space is still there. Hmmmm

    #2
    Not sure I follow.
    Please see how to draw text using a font parameter: http://www.ninjatrader-support.com/H.../DrawText.html

    Comment


      #3
      I declared the variable: private Font signalLabels = new Font("Tahoma", 10);

      and serialized it as:
      [XmlIgnore()]
      [Description("Signal Font to use")]
      [Category("Sound and Display")]
      [Gui.Design.DisplayName("Signal Font")]
      public Font SignalLabels
      {
      get { return signalLabels; }
      set { signalLabels = value; }
      }

      If I go to the indicator parameters and select a different face, size, style, etc., save the workspace and a template and close the chart, when I reopen the chart or workspace or apply the saved template, the font the text is written in is always the default. I need to go back in and change to a different size, face, style, etc. each and every time.

      Snap

      Comment


        #4
        Unfortunately this is beyond what we provide support for. However, here is a hint: please check out the HeikenAshi indicator for ShadowColor/ShadowColorSerialize properties, the same issue is with the "Color" structure.

        Comment


          #5
          I'll check it out.
          Thanks

          Comment


            #6
            Actually we have a tip on this: http://www.ninjatrader-support.com/v...ead.php?t=4977

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by terofs, Today, 04:18 PM
            0 responses
            3 views
            0 likes
            Last Post terofs
            by terofs
             
            Started by nandhumca, Today, 03:41 PM
            0 responses
            4 views
            0 likes
            Last Post nandhumca  
            Started by The_Sec, Today, 03:37 PM
            0 responses
            3 views
            0 likes
            Last Post The_Sec
            by The_Sec
             
            Started by GwFutures1988, Today, 02:48 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by ScottWalsh, 04-16-2024, 04:29 PM
            6 responses
            33 views
            0 likes
            Last Post ScottWalsh  
            Working...
            X