Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What price is used in SMA or Bollinger?

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

    What price is used in SMA or Bollinger?

    It is not clear to me which price is used to calculate SMA or Bollinger when used in indicator code or strategy code. Yes I know that this code returns the upper bollinger band:

    Code:
    Bollinger(2, 20).Upper[0];
    But a bar has an open price, a high price, a low price and a close price. Which price is used here? How can we tell by looking at the indicator code? I see some array called Input but I don't know what is in that. Please explain.

    Note that Bollinger bands are often calculated using the "typical price" = (High + Low + Close)/3 rather than the closing price. So how can I use Bollinger with the typical price? How can I do that for any other indicator like SMA?

    #2
    Hello westofpluto,
    You can define typical as below:-
    Code:
    Bollinger(Typical, 2, 20).Upper[0]; // this will always calculate using typical price only irrespective of what you change from indicator settings input series
    If you're not specifying the Series while defining or you keep Series as Input, it enables you to change the input from indicator settings any time.
    Hope it helps!

    Comment


      #3
      Hello westofpluto,

      Thanks for your post.

      Most indicators will default to the "Close" price type. You can check this yourself on any indicator. Apply the indicator to a chart. In the indicator parameters left click in the "Input series" which will usually show the instrument and bar size. When the 'input series" window appears, on the right side (Properties) is the "default" price type. You can click the price type to select any of the price types available, including "Typical".





      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X