Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Same strategy, different ninjascript, different results

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

    #31
    Originally posted by NGorodzhiy View Post
    I am learning via Microsoft virtual school, they have great tutorials.
    Excellent.

    Comment


      #32
      Great thanks! Will do!

      Comment


        #33
        Originally posted by bltdavid View Post
        That's because the two pieces of code are not the same.

        Remove the semi-colons from the end of the conditionals of all your if statements.
        .
        Nice eye. I've caught those before -- but was on my Samsung Galaxy Note 3 trying to figure this out at the time.

        But the one still has rsi[0], and the other script is RSI(2, 0)[0]. (looking at the original green/red code posting).

        I haven't tested - but I'm not sure that would return the same exact results.

        Comment


          #34
          Same results, already tested. My friend declared before that the RSI = 2.

          Comment


            #35
            Originally posted by NGorodzhiy View Post
            I do. CrossAbove and CrossBelow is his version of ">" and "<".

            As stated already, CrossAbove is like ">" but it's actually more than that. (Make no mistake, it is definitely not the same as ">").

            Let's examine how they are different.

            If you say,

            Code:
            if (Close[0] > SMA(20)[0])
            {
            }
            it's obviously "true" for all bars where Close[0] is greater than the value returned by SMA(20)[0]. Makes sense, right?

            But CrossAbove() does an additional check, and thus is not the same as the plain vanilla ">" check by itself. This additional check is where CrossAbove's lookback argument comes into play.

            Consider that this code,

            Code:
            if (CrossAbove(Close, SMA(20), 1))
            {
            }
            is equivalent to this expanded version,

            Code:
            if (Close[0] > SMA(20)[0] && Close[1] <= SMA(20)[1])
            {
            }
            because the point of CrossAbove is to return "true" only on the bar where the cross over actually happens.

            See the difference?

            Using ">" returns true on the crossover (of course) but it also returns true on all bars *after* the crossover where the condition is still true.

            Using CrossAbove is more like a finely tuned version of ">" because it only returns true on the *actual* bar (just one bar, not 2, not 3, just 1) where the cross over *actually* occurs, all the remaining bars after the cross over return "false".

            CrossAbove returns false for bars after the cross over because of that second check where it looks back 1 bar to see if the values *on that bar* were below.

            Using ">" returns "true" repeatedly whereas CrossAbove returns "true" just once.

            Make sense?

            Comment


              #36
              Originally posted by NGorodzhiy View Post
              Same results, already tested. My friend declared before that the RSI = 2.
              On your next post, attach the actual files.

              I want to see 2 attachments that are the actual two files that you're complaining about.

              Comment


                #37
                Thank you, now I understand. What exactly am I "complaining" about?

                Comment


                  #38
                  Originally posted by NGorodzhiy View Post
                  Thank you, now I understand. What exactly am I "complaining" about?
                  Isn't this thread devoted to the lack of consistent results between 2 strategies that you say are functionally the same?

                  Therefore, isn't the "complaint" the fact the results are *not* the same?

                  So, please attach the 2 files that are producing these inconsistent results.

                  Your "complaint" or "issue" (consider it legal-speak) can be resolved faster if you'd just attach the actual 2 files causing the "issue".

                  Otherwise, from my perspective, I have insufficient data to help you solve your complaint, er, I mean, problem.

                  Look, everyone here helping you (except for Ninja folks) is volunteering their time.

                  Help us to help you (it would go sooooo much faster) if you would just attach the 2 files causing the problem.

                  Otherwise, if you can't do that (sometimes pro's ask for help here but they can't upload any code because of internal rules at their company), well, I can't read your mind and I can't download/read/investigate code I can't see, so then I'm done being able to help.
                  Last edited by bltdavid; 03-19-2015, 09:45 PM.

                  Comment


                    #39
                    The problem is already solved haha. You helped me solve it with your first post, and I appreciate it a lot. Thank you.

                    Comment


                      #40
                      Originally posted by NGorodzhiy View Post
                      Same results, already tested. My friend declared before that the RSI = 2.
                      Sorry, my mistake.

                      I mistook this to say "same incorrect results" ... thus I felt like we needed to see your actual files to investigate further ...

                      My apologies. Glad to hear it's working!

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      84 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      47 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      29 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      32 views
                      0 likes
                      Last Post TheRealMorford  
                      Started by Mindset, 02-28-2026, 06:16 AM
                      0 responses
                      67 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Working...
                      X