Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.TextFixed questions

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

    Draw.TextFixed questions

    I am working in two indicators that use Draw.TextFixed method and I have two questions:

    1.- How can I get the current value of an indicator?

    There is no problem with current value of the instrument

    Draw.TextFixed(this, "NinjaScriptInfo", "" + marketDataUpdate.Price, GetTextPosition(Location), Brush textBrush, SimpleFont font, Brushes.Transparent, Brushes.Transparent, 0);

    But how can I call VOL indicator for example?

    private VOL VOL1;
    ...
    else if (State == State.DataLoaded)
    {
    VOL1 = VOL(Close);
    }
    ...
    Draw.TextFixed(this, "NinjaScriptInfo", ""?, GetTextPosition(Location), Brush textBrush, SimpleFont font, Brushes.Transparent, Brushes.Transparent, 0);


    2.- In order to write my own text when opening the indicator in Parameters, how should I define en "Properties"? I have been looking in the forum and I have found examples to select brushes and other things but not to write my own text ("SHORTS", LONGS",...)

    Thanks a lot


    #2
    For the first question I have seen that VOL indicator would be

    Draw.TextFixed(this, "NinjaScriptInfo", "" + Volume[0], GetTextPosition(Location), Brush textBrush, SimpleFont font, Brushes.Transparent, Brushes.Transparent, 0);

    But what about others indicators like cumulativeDelta or EMA?

    Thanks

    Comment


      #3
      Hello Impeesa,

      Thanks for your post.

      To answer your first and second posts, in OnBarUpdate(), in the Draw.TextFixed() you could have used VOL1[0] as the value. It would be the same process for other indicators that you add in and create private instances of. Simply use the private instance name and the bar index.

      " In order to write my own text when opening the indicator in Parameters, how should I define en "Properties"? I have been looking in the forum and I have found examples to select brushes and other things but not to write my own text ("SHORTS", LONGS",...)" A good way to generate the code needed would be to use the Ninjascript wizard and create a "properties" indicator A blank indicator that contains all the different input types, added data series, plots and line type that you can always pull from. The wizard creates all of the structures/code needed: https://ninjatrader.com/support/help...?ns_wizard.htm One of the input "types" is a string input and that is what you need in this case.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      77 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X