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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X