Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Please look at this code and tell me why it won't work

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

    Please look at this code and tell me why it won't work

    Hi;

    I'm trying to make this work in Market Analyzer.

    It was working at one time but now it's not. I'm adding the indicator to Mrkt Analyzer 9 times for the nine plots, and now all plots show the same value (in trying to figure it out I've tried to make each plot simply show a different sma and even then all the plots show the same value for the instrument.)

    I'm loading 360 days of data and lookback set to infinite.

    Thanks for your help.


    Attached Files

    #2
    It looks to me like you would still need to load more data, perhaps try it with at least 560 bars?

    Comment


      #3
      That's right, I needed to load more bars. Thank you!!!

      How did you know? the longest MA is 200 so why wouldn't 300 be enough? thanks

      Comment


        #4
        Because you already skip the 360 bars at the start of your series.

        Comment


          #5
          So you came to 560 by 360 + 200?

          And, the 360 comes from the stmt: if (CurrentBar < 360) return; correct?

          I understand this to mean "if there isn't enough data loaded then don't start"

          I don't understand how this would "skip" bars. I only put this stmt in because I thought it good programming. Do I misunderstand?


          Thanks for your help!

          Comment


            #6
            Yes - it skips bars your MA's would need to initialize properly, the technique to return out of OnBarUpdate() for certain bars in only needed really if you work with bars indices for your codes, so for example trying to get a SMA value 10 bars back at CurrentBar 0 > this will not work, as there's simply no bars to the left from this starting point.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            596 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            343 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
            556 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            554 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X