• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enhancing Properties of Notes in the Market Scanner

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

    Enhancing Properties of Notes in the Market Scanner

    Is it possible (access via script/api...) to extend the properties of notes in the marketscanner, as for the other columns (Properties...)? #SetUp (label, type), #conditions (cell, filter) etc.)?
    Is it also possible to connect a new note line to an instrument? Thanks & regards!


    Click image for larger version

Name:	properties_notes.PNG
Views:	1
Size:	25.7 KB
ID:	1058836

    #2
    Hi signalworks, thanks for your post.

    The Notes Market Analyzer column can be copied under a new name by right-clicking the code and selecting "Save As". The script lives in the "MarketAnalyzerColumns" folder. You can add your custom code to the new copy. The CurrentValue or CurrentText property of a MA column script can be used to change the display value if some event occurs. CurrentValue is a double data type so only numerals may be displayed.

    On the question about attaching a new note line to an instrument. There is an option to add a label in the Market Analyzer right-click menu, but that label will be static. If you subscribe to an event, such as OnMarketData, then the context for that OnMarketData event will be in terms of the instrument row. I attached a copy of the Notes script to demonstrate.

    Please let me know if I can assist any further.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello Chris,


      Thank you very much for your comments. I would like to be able to use the same properties for the notes column as for the other columns, as you can see in the picture. Is this possible?

      Click image for larger version

Name:	ms_properties.PNG
Views:	2
Size:	32.8 KB
ID:	1059066
      Attached Files

      Comment


        #4
        Hi signalworks, thanks for your reply.

        Those extra properties were taken out of the Notes properties from somewhere in the NinjaTrader code base, If you make a copy of the Notes indicator, you will see that those properties appear.

        Kind regards.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris, thank you very much. This works! But could not change the name of the column under "available". Is that still possible somewhere?

          Click image for larger version

Name:	ms_properties_01.PNG
Views:	1
Size:	29.2 KB
ID:	1059089

          Comment


            #6
            Hi Chris, the column name is now displayed correctly. (I hadn't changed the assembly name before...).
            However, the properties are not fully available. The properties "Enable color distribution" and "Show in one line" are missing. Probably this is related to the different namespaces "MarketAnalyzerColumnBase" and "MarketAnalyzerColumn"? A change to the latter brings an exception ("...the type ...MarketAnalyzerColumn is defined in a non-referenced assembly...").
            (1)Is it possible to display these two properties as well?
            (2)Is it possible to format the "Label" property, such as "Align right/left/center"? Many thanks and regards.

            First pic: Last price has all properties
            Second pic: in MyNotes the the blue-marked properties from the first pic are missing

            Click image for larger version  Name:	ms_properties02.PNG Views:	1 Size:	32.9 KB ID:	1059112Click image for larger version  Name:	ms_properties03a.png Views:	1 Size:	32.0 KB ID:	1059113

            Comment


              #7
              Hi signalworks, thanks for your reply.

              This property is what causes those properties to disappear:

              DataType = typeof(string);

              It's not possible to have an editable notes column that has the color distribution property because you would need to extract the numerical part of the string that your column is displaying. Custom conditions can always be made to get around this.

              Please let me know if you have any questions.
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                Hi, Chris,
                here a further question in connection with the new note column. There are now the properties "Conditions" and "Filter". I have defined two conditions: In the column "Notes" I manually enter e.g. 100 in a row. Then the 100 should be replaced automatically with the text "Long" and the background color green. Adequately, if I enter a 0, the cell text should change to "Short" and the background color to red. See both pictures. However, the defined conditions are not executed. The respective number in the cell remains visible (100 or 0). I have set the datatype to typeof(int) for a test. Also no change. Are the "conditions" in the new note column so usable at all? How could the above mentioned conditions be implemented? Many thanks and best regards

                Click image for larger version

Name:	ms_conditions_cell_01.PNG
Views:	1
Size:	20.5 KB
ID:	1059632

                Click image for larger version

Name:	ms_conditions_cell_02.PNG
Views:	1
Size:	20.6 KB
ID:	1059633

                Comment


                  #9
                  Hi signalworks,

                  The datatype of the column must either be string, double, or int exclusively. If the data type is string, then the cell conditions cannot be used because NinjaTraders code is expecting a numeric value. If you change your script to DataType = typeof(double); and set CurrentValue instead of CurrentText then you can use the cell conditions.

                  Kind regards.
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    Thank you very much, Chris, I have understood so far, but it does not quite hit the nail on the head, as I will make my own entries in the cells of the Notes column. So I didn't define CurrentText or CurrentValue in the code.
                    The result should look like this: see picture with long/short text on different background. Since you can only define one background color per column by default, I assumed that you can define different backgrounds by defining conditions. If I enter 0 in a note cell, the background should be red and the 0 should become text "Short". If 100 is entered, the background should be green and the text "Long". By setting the datatype to typeof(int) it doesn't work. The numbers remain unchanged. Can this scenario be implemented using the condition properties? After entering the respective number, an event would have to be fired, which starts the condition query. Thank you, best regards.

                    Click image for larger version

Name:	ms_notescustom01_cond.png
Views:	1
Size:	10.7 KB
ID:	1059730

                    Click image for larger version

Name:	ms_notescustom01_ls.png
Views:	1
Size:	12.0 KB
ID:	1059731

                    Comment


                      #11
                      Hi signalworks, thanks for your reply.

                      It doesn't seem that using the cell conditions will work in this case. It not going to be possible to change the color through overriding OnRender either as the OnRender method would just override the text that is written.
                      Chris L.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by RedDuke, Today, 06:14 PM
                      0 responses
                      0 views
                      0 likes
                      Last Post RedDuke
                      by RedDuke
                       
                      Started by DariusDeck, Today, 04:22 PM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_Marco  
                      Started by pstrusi, Today, 05:05 PM
                      1 response
                      2 views
                      0 likes
                      Last Post pstrusi
                      by pstrusi
                       
                      Started by saeed, Today, 10:20 AM
                      4 responses
                      17 views
                      0 likes
                      Last Post saeed
                      by saeed
                       
                      Started by priceisking, Yesterday, 07:44 PM
                      1 response
                      27 views
                      0 likes
                      Last Post NinjaTrader_Kate  
                      Working...
                      X