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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      657 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      373 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      579 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X