Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Barry Milan, Today, 10:35 PM
            0 responses
            2 views
            0 likes
            Last Post Barry Milan  
            Started by DJ888, Yesterday, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            40 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            167 responses
            2,260 views
            0 likes
            Last Post jeronymite  
            Working...
            X