Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with a text note indicator

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

    Issue with a text note indicator


    I currently have an indicator (drawing tool) to create a custom text note. This indicator lets me create custom template with predefined line of text. The text is held in the note.txt file. Each template in the notes.txt file is separated by new line. This indicator also lets me use only "Enter" button instead of default hotkey combination "Enter + alt" when creating a new line of text on chart.
    Each line of text which I create in the notes.txt file apears in the drawing tools menu as a separate template.
    What I would like to have is:
    1. A separator which would let me have multiple lines of text inside created as a template instead of only 1 line of text for each note.
    2. To have only a 1st line of the text visible in the drawing tool menu (just like it is right now)

    I'm sending a screenshot of the menu as well as the code of the indicator itself

    I would appreciate if you at least take a look a that and point me in the direction of how to resolve it.
    Thank you




    Attached Files

    #2
    Hello Ludwik,


    A separator which would let me have multiple lines of text inside created as a template instead of only 1 line of text for each note.
    I am a little confused on how this question is worded. Are you asking how to store more data in 1 line? If so you would have to use a delimiter like a semi colon and then use string.Split to split the string at the delimiter.


    To have only a 1st line of the text visible in the drawing tool menu (just like it is right now)

    Each line of text which I create in the notes.txt file apears in the drawing tools menu as a separate template.
    This I am also a little confused on the wording.. Are you saying that each of the text that appears in the notes.txt gets drawn as a drawing object which means each appears in the drawing tools menu as an applied tool?


    Comment


      #3
      Thank you for your reply Jesse,

      I probably should have made my description a little clearer. So let me clarify in this post:

      1. A separator which would let me have multiple lines of text inside created as a template instead of only 1 line of text for each note.
      So the text template which Notes drawing tool (or indicator if you prefer) uses is pulled from notes.txt file. So for example if I want to have a predefined text which I want have it in the Notes menu and then to to insert in a chart whenever I want to without writing it everytime. In this case I first have to write the text in the in separate file called notes.txt .

      Now here is an issue:
      Every time I write a line of text in notex.txt file the Notes drawing tool looks at it as a separate template.
      So for example if I want to have following text template, which would have to be written as multiple lines not just one line in the notes.txt file:

      Entry
      Target Profit
      Stop Loss
      So because currently Notes drawing tool looks at each new line of text as kind of separator I would have 3 separate templates in the Notes drawing tool menu:
      "Entry" -> Being template one
      "Target Profit" - Template two
      "Stop Loss" - Template three

      Instead of one template.
      I'm trying to figure out a way to have more than one line of text in Notes drawing tool template. So for example quoted text:
      Entry
      Target Profit
      Stop Loss
      Would be in one template. So everytime I want to place it on the chart I would have 3 lines of texts instead of only 1st line of text. It would essentially look like this:
      "Entry
      Target Profit
      Stop Loss"

      If I'm not clear enough I can post some pictures of the chart or record a short video in order to clarify.

      In case of this one:
      To have only a 1st line of the text visible in the drawing tool menu (just like it is right now)

      Each line of text which I create in the notes.txt file apears in the drawing tools menu as a separate template.
      Lets leave it for now as it is not that important withouth having the first one resolved
      Last edited by Ludwik; 04-05-2022, 03:02 AM.

      Comment


        #4
        Hello Ludwik,

        I would suggest to look into other datatypes for your notes.txt or to use delimiters such as semi colons between different data. Newlines can be used as a delimiter as well which you are already doing, if you wanted to store data in a different way then you need to update the way the file is saved or move to something else like xml serialization or JSON. These are concepts which are not in NinjaScript but are in C# so you can research those concepts in external C# tutorials.

        The most basic way to include more data would be to split the string using a delimiter.

        Your multiple lines would be written as one line:

        Code:
        Entry;Target Profit;Stop Loss
        you would then have to split that to an array

        Code:
        string[] myArr = myLineOfText.Split(";");

        Comment


          #5
          Having a separator for multiple lines within a template sounds pretty neat. While I'm not a coding expert, I'm sure the community here could lend a hand in tweaking your setup. By the way, have you ever checked out https://notesonline.com? It could be a cool way to keep track of all your coding experiments and ideas. Keep up the great work, and I hope you find the solution you want!
          Last edited by CamillaFrey; 08-13-2023, 05:09 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X