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:	94
Size:	68.1 KB
ID:	1309874
    Click image for larger version

Name:	image.png
Views:	96
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:	93
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:	94
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 CaptainJack, 05-29-2026, 05:09 AM
                0 responses
                163 views
                0 likes
                Last Post CaptainJack  
                Started by CaptainJack, 05-29-2026, 12:02 AM
                0 responses
                82 views
                0 likes
                Last Post CaptainJack  
                Started by charlesugo_1, 05-26-2026, 05:03 PM
                0 responses
                125 views
                0 likes
                Last Post charlesugo_1  
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                206 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 05-11-2026, 05:56 AM
                0 responses
                184 views
                0 likes
                Last Post CarlTrading  
                Working...
                X