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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      55 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      72 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      38 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      99 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      60 views
      0 likes
      Last Post PaulMohn  
      Working...
      X