Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can I draw a short line one bar into the future?

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

    #16
    Hi Bertrand,

    Sorry but I need your help again. I've attached the code for your reference. As you can see from the attached chart, the chart, uses data from the 13th and 16th to draw the lines relevant for the 17th.

    i can't get the code to draw the lines relevant for the 18th. it should be using data from the 16th and 17th to do so. would you mind taking at look at what could be wrong.

    i can't get the lines to draw from mid-point ot mid-point.

    Regards

    Kay Wai
    Attached Files

    Comment


      #17
      Kay, I don't think the logic is correct - wouldn't you want to project the values gathered from Thursday data out for Friday?

      Comment


        #18
        Hi Bertrand, That was the intention. Unfortunately for the data that I have it is registering as Tuesday to Saturday as the work week based on the dates at the bottom of the bar.

        I will have to create another indicator for asian hours...

        The strange part of the code is that it doesn't calculate the data required for the current Thursday. The data is all available for it to do so....Even Thursday's bar is already drawn! Hence it should be able to also calculate Friday's projections which it hasn't too...Not sure what is wrong though...
        Last edited by kaywai; 02-19-2011, 06:53 AM.

        Comment


          #19
          Bertrand, can you assist?

          Comment


            #20
            Kaywai, we could unfortunately not debug your custom code for you - I suggest to simplify as much as possible, adding prints and then understanding why you not get the expected results from it. A NinjaScript consultant could be of help too - http://www.ninjatrader.com/partners#...pt-Consultants

            Comment


              #21
              Well Bertrand, I think you can see from my code I have added the Print function to the day that I am checking...I had it placed on Thursday at some stage too and it calculated the previous week's projection instead of the current week AND there was no error!

              This is really frustrating and having to hire a consultant every time something does not work for the slightest of reasons is a nightmare, not to mention the cost involved each time.

              There has got to be a better way!

              I guess just continuing to plough through the "free" license until I get it working is an alternative....could be NT10 by then!

              Comment


                #22
                Looking at your code, if you are wanting to see those lines on EVERY bar (like you had in the other chart), you need to provide unique names for the objects.

                Everyday has "myLinex" where x is 1,2,3,4,5,6.

                You need unique object names.

                I gave those objects unique names, so I was able to get it working for 5 days. You might need to come with something on the month/day to be unique.




                Originally posted by kaywai View Post
                Well Bertrand, I think you can see from my code I have added the Print function to the day that I am checking...I had it placed on Thursday at some stage too and it calculated the previous week's projection instead of the current week AND there was no error!

                This is really frustrating and having to hire a consultant every time something does not work for the slightest of reasons is a nightmare, not to mention the cost involved each time.

                There has got to be a better way!

                I guess just continuing to plough through the "free" license until I get it working is an alternative....could be NT10 by then!
                Attached Files

                Comment


                  #23
                  Maybe that doesn't apply here.


                  Looks like there is other issues in question that I don't yet fully understand.

                  Sorry for my confusion.

                  Comment


                    #24
                    Thx Sledge, I will try out your suggestion this evening.

                    What I don't understand is why when the data is available, the code is not using the data...it is most frustrating. It was a lot simpler to program this on Excel - well not the charting but the projections.

                    Comment


                      #25
                      Hi Bertrand, Please take a look at this.

                      The code I shared earlier does actually calculate for Saturday! It just doesn't calculate for the most recent bar which is also a Saturday!

                      If the data for "Saturday Jan 8" is provided, why isn't the code calculating it? It calculates for every other day!

                      Is it because NT7 can't actually DrawLines into the future and hence no calculation is done?

                      Regards

                      Kay Wai
                      Attached Files

                      Comment


                        #26
                        Kay, likely because you try working with it on CalculateOnBarClose = true - the daily bar is not closed / finished until you have received the opening tick of the new bar.

                        Comment


                          #27
                          yup. that did the trick Bertrand. thx much.

                          now we have to sort out the why it is printing Friday's data as Saturday!

                          Comment


                            #28
                            Great Kay, you would need to ensure to select a session template for your chart that corresponds to your local time zone, so the bars would be aligned as expected.

                            Comment


                              #29
                              More likely it is because, as saturday is not a trading day, NT simply does not process saturday.

                              Comment


                                #30
                                Guys, Thx for your help! The HKFE session template did the trick!

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                599 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                345 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
                                558 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