Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why is my code running like this in realtime?

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

    Why is my code running like this in realtime?

    It was working better with historical data.

    1) The buy counts when Close[0] < Close[4] didn't appear even though there were 9 successive counts where each close was less than the close 4 bars ago. This can be seen where there is a green dashed line and an arrowup.

    2) in the white box, a) the green dashed line should only draw after there are 9 bars in front of it. b) the green arrow up should only draw after 9 successive counts where each close < close 4 bars ago. c) the counts on one bar appear at 2 different locations (re: second bar from the right) and the current bar is actually illegible...

    3) it clears up after i right-click on the chart, select "indicator", and click "apply" or clicking "F5".

    Help!!!
    Attached Files
    Last edited by kaywai; 02-26-2010, 12:32 AM.

    #2
    Ok. it seems that every tick the bars makes is counted as 1 count. Have changed "CalculateOnBarClose" from "false" to "true" but the issue is still there...

    Not sure what else to do...

    P.S Here is another chart. The green square after the '4' is suppose to read '5'...
    Attached Files
    Last edited by kaywai; 02-26-2010, 12:12 AM.

    Comment


      #3
      Kay, as noted on other threads circling around the same topic you would need to simplify your code as much as possible and then add Print statements throughout important sections to access why calcs are different in realtime from the historically seen ones.

      Did you reapply the indicator fresh after you changed your CalculateOnBarClose setting?
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Bertrand,

        If you mean closing the old chart and opening a new chart, then "yes".

        I even tried separating the buy from the cell in another code...issue exist too. It seems that everytime, the "close" of the bar changes, the count changes along with it...it should only update the count at the same time a new bar is formed, no?

        Comment


          #5
          Yes, either a new chart and applying the indicator or pressing F5 to start a new instance of it after you compiled code changes in...if it still updates with each new tick, it indicates you did not change the CalculateOnBarClose setting successfully, please recheck.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Thanks Bertrand! Seems to be working fine now. Kay Wai

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Renejm, Today, 06:17 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by kazisl, Yesterday, 06:41 PM
            2 responses
            10 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by impactX, 05-04-2021, 01:07 AM
            2 responses
            11 views
            0 likes
            Last Post NinjaTrader_Melissa  
            Started by op1031, Yesterday, 05:51 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by aaadetos, 05-04-2021, 09:28 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_Heath  
            Working...
            X