Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The Code Works!......Sort of.

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

    The Code Works!......Sort of.

    I finally got the indicator to work. However, it either works in real-time(if (State != State.Realtime) return; // just use realtime data for this example), or it shows old set ups at the very left edge of the chart data.(I comment out if (State != State.Realtime) return; // just use realtime data for this example). What do I have to do to get the code to show all historical set ups and also work in real-time?.. Like a moving average plots all historical data and also works in real-time. The following code is just a sample for demonstration. I posted it via a zip file because the code was too long.


    Attached Files

    #2
    Hello jamestrader21x,

    Thank you for the post.

    I tried the indicator however I was unable to see it plot or draw anything besides objects at a value of 0. Do you have an image of what you are seeing in your test?

    You likely will need to reduce this sample to a single instance of the problem, just draw 1 object with the values in question that are producing the wrong result. We could then look at what values are used to know why it was drawn that way.

    ​​​​​​​
    I look forward to being of further assistance.

    Comment


      #3
      Here are two pictures of what happens when "if (State != State.Realtime) return; // just use realtime data for this example" is commented out or not. I am trying to get the indicator to plot historical and real-time. Thanks for the help.
      Attached Files

      Comment


        #4
        Hello jamestrader21x,

        From the images you provides it appears that it is working historically, in the image where you commented out the realtime condition there are additional rectangles drawn before the realtime bar. I am not certain what you are trying to say is the problem in the image, were those rectangles all from realtime?

        If you are otherwise expecting more rectangles in historical, you would have to go through your logic and make sure those conditions are happening on historical bars. In addition you would need to make sure unique drawing object names are used so that new objects are drawn each time you call the draw methods.

        i look forward to being of further assistance.

        Comment


          #5
          It is not working--at least not how I want it to. When you comment out the real-time statement. All that plots is what's at the very left edge of the chart data. If you scroll forward towards the right, the indicator stops plotting and never plots real-time. If you un-comment the real-time message, It DOES plot in real-time. However, if you refresh the page with F5. The indicator starts over and with a blank chart. I don't want it to do either. I want the indicator to plot all of the data historical and real-time. And if I need to refresh the page, the historical data is still there.

          Comment


            #6
            Hello jamestrader21x,

            I understand it is not working as you want, I am trying to better understand what problem you are seeing.

            All that plots is what's at the very left edge of the chart data.
            I am not sure what you are referring to here, is this the Yellow arrow in your image? There is otherwise nothing plotted on the left of the chart.

            As I noted I was not able to see the script draw on my end, I tried using a 100 tick es chart but the sample is not currently drawing rectangles like you had pictured for me to better understand the issue. In the images you provided there is nothing specifically at the left of the chart like you describe there is so I am not certain what you are referring to there.

            For this type of issue the easiest way forward is going to be to reduce the problem down to find what is happening. Because I am not certain what the exact problem is at this point I couldn't really provide much else here.

            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            651 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            577 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X