Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why Can I not declare a simple KAMA indicator in my script?

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

    Why Can I not declare a simple KAMA indicator in my script?

    Title pretty much says it all. Please see screenshot with error:
    Click image for larger version

Name:	image.png
Views:	80
Size:	68.1 KB
ID:	1309874
    Click image for larger version

Name:	image.png
Views:	79
Size:	65.4 KB
ID:	1309873

    #2
    Hello Sir Please
    change private double Kama1 ;
    to private KAMA Kama1;

    Comment


      #3
      Originally posted by ajgauss13 View Post
      Hello Sir Please
      change private double Kama1 ;
      to private KAMA Kama1;
      Thanks. It's working now. However when I try to implement CrossBelow() I get a similar error as before, please see:

      Any thoughts to fix? Thank you

      Click image for larger version

Name:	image.png
Views:	75
Size:	88.2 KB
ID:	1309877

      Comment


        #4
        CrossBelow And CrossAbove use first argument Series Not Double

        Comment


          #5
          including for reference: Click image for larger version

Name:	image.png
Views:	75
Size:	12.6 KB
ID:	1309880

          Comment


            #6
            Originally posted by ajgauss13 View Post
            CrossBelow And CrossAbove use first argument Series Not Double
            What does that mean? Can you please share an example?

            Comment


              #7
              Share with me File Please
              and i will make screenshoot

              Comment


                #8
                Hello agclub,

                Both values you are trying to use are doubles and not series. Using KAMA1[0] gets a specific value from the series, that is a single number. GetCurrentBid() also returns a single number. To use the Cross methods you need at least 1 series, you could compare the KAMA in reverse with the bid like the following:

                Code:
                if(CrossBelow(KAMA1, GetCurrentBid(), 1))

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                50 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                126 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                69 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                42 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X