Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EasyLanguage to NinjaScript

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

    #31
    So how could I search for say TL81 and assign it ?

    Comment


      #32
      I would need a bit more context to the following: "So how could I search for say TL81 and assign it ?"

      Is TL81 the IRay? So IRay TL81 = DrawRay();?

      There should be no need to search for it, you have already assigned it by a name. Just call it's name:

      TL81 = DrawRay(); // here you would change your settings

      Comment


        #33
        no "TL81" is the tag and I have 100 other objects.

        Comment


          #34
          I am suggesting using unique IRay object names for each. I think you just wish to loop through all draw objects and only change a value of a specific tag?

          Comment


            #35
            THat seems a bit wasteful? How would I assign a name for each?

            Comment


              #36
              Hello,

              If you have not assigned the ray to a variable, there would be no other way to access its instance other than to search for it or run a loop to find it.

              From the questions, I could only see two ways of doing this. Either store the Ray as a variable when you create is as Patrick suggested:

              IRay TL81 = DrawRay();

              Later you would just use the variable name to call its properties: TL81


              Otherwise if you did not create the ray and save that instance to a variable, you would need to loop through the objects to find it, an example of this can be found here: http://ninjatrader.com/support/forum...1&postcount=10

              Please let me know if I may be of additional assistance.

              Comment


                #37
                I just find it amazing that there is no way of accessing the objects by name or index.

                Comment


                  #38
                  is there anything special about the last bar on chart?

                  I have the 5 minute bar at the close as the last bar.

                  It shows on the chart.

                  it does not come through to the ninjascript OnBarUpdate ().

                  The test works on all prior days

                  Comment


                    #39
                    I have put all my rays in an array so I can choose them at will and get set params. works ok.
                    problem solved.

                    any idea about lastbar ?

                    Comment


                      #40
                      Hello,

                      Thank you for the reply, I am glad you had resolved your question.

                      Regarding the last bar, if you are using COBC == true, you would need to wait for a tick to close that bar, if this is the last bar of the session this would be expected as there is no other data after that to close the final bar.

                      In the case you are using COBC == false and receive a tick, it would report as closed in that case but only if a tick is received that would close the bar.

                      Please let me know if I may be of further assistance.

                      Comment


                        #41
                        My NS did not state CBOC so it would be true by default.

                        My chart is historical and it shows the full bar with the correct close on the chart. It is also the close of the session ie 4pm EST. The software works when it is not the last bar but does not work when it isthe last bar.

                        Comment


                          #42
                          Hello,

                          Thank you for the reply.

                          Yes this would be expected as I had explained, If you are using COBC == true, you would need to wait for a new tick to close that bar. If this is the last bar on the chart and there is no tick after that bar in the session to close it, it would remain as the building bar.

                          With COBC == true the right most bar will always be the Building bar and the 0 bars ago or Close[0] would refer to the bar one position left of that bar or the last closed bar.


                          I look forward to being of further assistance.

                          Comment


                            #43
                            OK< I understand.

                            Is the a way of detecting the close of in instrument at the close time.

                            Comment


                              #44
                              can anyone help me with changing the appearance of the dot object. I can draw a dot but it has a certain style. How do I change the style and size. I am using:

                              DrawDot("AMBuy", false, value40, value49, Color.Green ) ;

                              I get a green dot with a white border.

                              Comment


                                #45
                                also still not getting the closing bar.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                601 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                347 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                103 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                559 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                558 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X