Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

doesn't SMA() return a double?

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

    doesn't SMA() return a double?

    If so, then why does this code not compile? The error message is that SMA cannot be implicitly converted into a double. I'm sure I'm missing something simple. Thank you for your help.

    /*if (varyStop) {
    stopLimit = SMA(Range(), 14);

    } else stopLimit = 10;
    */

    #2
    Originally posted by crmcwi View Post
    If so, then why does this code not compile? The error message is that SMA cannot be implicitly converted into a double. I'm sure I'm missing something simple. Thank you for your help.

    /*if (varyStop) {
    stopLimit = SMA(Range(), 14);

    } else stopLimit = 10;
    */
    SMA(Range(), 14) returns DataSeries
    if you need double you have to use SMA(Range(), 14)[0]

    Comment


      #3
      Originally posted by roonius View Post
      SMA(Range(), 14) returns DataSeries
      if you need double you have to use SMA(Range(), 14)[0]
      Thank you roonius. I realized my mistake when I woke up this morning.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      164 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      317 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X