• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

barsAgo = Swing(swingStrength).SwingLowBar gives wrong anser

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

    barsAgo = Swing(swingStrength).SwingLowBar gives wrong anser

    barsAgo = Swing(swingStrength).SwingLowBar(startBar, 1, realTimeLookBack);
    The above line gives the wrong value if CalculateonBarClose = false;
    It is correct if CalculateonBarClose = true.
    This is true in either an indicator or strategy for an identical chart
    The wrong value is off by many bars.
    Usually it refers to a swing more than 1 instance back
    often as much as 3 instances back.
    The correct answer is generally quite nearby on the chart, say 2 or 3.
    In order to fix the problem i wrote my own, which works,
    but I am wondering what
    I am not understanding about the NT version usage that is causing
    an incorrect return value when CalculateOnBarClose = false.

    swingstrength is 1, realtimelookback is 20

    Note the the error occurs whether the startBar is 0 or 1.
    (Have not tried other values)

    Thank you
    Roland

    #2
    Hello roland_nt,

    Thanks for your post.

    I've tried your sample code and not found the issue you are reporting when using COBC = false.
    So I might replicate your test set-up, what bar type, timeframe, instrument(s) are you using?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Swing gives wrong answer CBOC = false

      My tests were using Ninja standard Renko, typical brick size value 11, instrument FB, BABA and other stocks
      Trading times between 9:30 and 11 AM Eastern

      Comment


        #4
        Hello Roland,

        Thanks for your reply.

        I tested with the FB, 11 renko, live data and again did not observe the issue you are reporting. I know that you have found a work around solution so perhaps this is a rhetorical question but is there any chance that the variables startbar and realtimelookback were changing or were not what you expected? I used fixed values for both in my testing.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks for your effort.
          The variables are fixed in value at the start of the program.
          I also print them out - they are stable.
          I am not sure where to go from here.
          The indicator is huge to examine.
          I could send it if you like
          along with the days it fails on
          and with some debug instructions.
          It does not require elaborate setup.
          Although I made a workaround, it is a trivial implementation
          and I would like to feel comfortable with the standard Ninja version.

          Comment


            #6
            Hello,

            Thanks for your reply.

            Is it possible to break the indicator down to just the code section of interest? If not or either way, please send your indicator and information to PlatformSupport[at]Ninjatrader[dot]Com Atten: Paul and a link to this thread.

            Thank-you.
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ballboy11, Today, 11:57 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by swcooke, Today, 09:41 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by Catalon, Today, 10:02 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by pel11, Yesterday, 06:25 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by dmackay41, Today, 09:35 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_SergeyS  
            Working...
            X